diff --git a/.circleci/config.yml b/.circleci/config.yml index 1358ee78653..bf994be945e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,7 +141,7 @@ commands: # a reusable command with parameters jobs: node0: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2024.01.1 working_directory: ~/OpenAPITools/openapi-generator shell: /bin/bash --login environment: @@ -154,7 +154,7 @@ jobs: nodeNo: "0" node1: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2024.01.1 working_directory: ~/OpenAPITools/openapi-generator shell: /bin/bash --login environment: @@ -167,7 +167,7 @@ jobs: nodeNo: "1" node2: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2024.01.1 working_directory: ~/OpenAPITools/openapi-generator shell: /bin/bash --login environment: @@ -180,7 +180,7 @@ jobs: nodeNo: "2" node3: machine: - image: ubuntu-2004:202201-02 + image: ubuntu-2004:2024.01.1 working_directory: ~/OpenAPITools/openapi-generator shell: /bin/bash --login environment: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3c64d59bd9b..92423daeffb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,8 +26,8 @@ "java.configuration.runtimes": [ { "name": "JavaSE-11", - "path": "/usr/local/sdkman/candidates/java/11.0.16.1-ms", - "sources": "/usr/local/sdkman/candidates/java/11.0.16.1-ms/lib/src.zip", + "path": "/usr/local/sdkman/candidates/java/current", + "sources": "/usr/local/sdkman/candidates/java/current/lib/src.zip", "javadoc": "https://docs.oracle.com/en/java/javase/11/docs/api", "default": true } @@ -50,4 +50,4 @@ // "postCreateCommand": "mvn clean package -DskipTests", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode" -} \ No newline at end of file +} diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0e596306d9d..fce2cdd52a6 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,5 +17,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*`. IMPORTANT: Do **NOT** purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed. -- [ ] 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) +- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.6.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/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 8923e20077b..84903ee1128 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -10,7 +10,7 @@ on: - 'samples/client/petstore/java/**' - 'samples/openapi3/client/petstore/java/**' env: - GRADLE_VERSION: 7.2 + GRADLE_VERSION: 8.7 jobs: build: diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 3eaee80ef24..f61055efd42 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}-gradle- - name: Setup Maven - uses: s4u/setup-maven-action@v1.12.0 + uses: s4u/setup-maven-action@v1.13.0 with: java-version: ${{ matrix.java }} maven-version: 3.8.8 @@ -87,7 +87,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Setup Maven - uses: s4u/setup-maven-action@v1.12.0 + uses: s4u/setup-maven-action@v1.13.0 with: java-version: 11 maven-version: 3.8.8 diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 1e9fb800ba5..6070ca97d95 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -140,8 +140,23 @@ jobs: with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target + - name: Delete samples that are entirely generated + run: | + rm -rf samples/client/petstore/csharp/generichost/net8/AllOf + rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf + rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare + rm -rf samples/client/petstore/csharp/generichost/net8/FormModels + rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes + rm -rf samples/client/petstore/csharp/generichost/net8/OneOf + rm -rf samples/client/petstore/csharp/generichost/net8/Petstore + rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration + rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate + rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore - name: Generate samples - run: bash bin/generate-samples.sh + run: | + bash bin/generate-samples.sh + # when a sample is deleted, you have to generate it twice for all files to get created + bash bin/generate-samples.sh - name: Verify git status run: | if [[ "$(git status --porcelain)" != "" ]]; then diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml index b65195b8bf9..567ab1e1c87 100644 --- a/.github/workflows/samples-cpp-qt-client.yaml +++ b/.github/workflows/samples-cpp-qt-client.yaml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt-version }} tools: ${{ matrix.tools }} diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml index 62218739f56..c1b8973ba06 100644 --- a/.github/workflows/samples-go.yaml +++ b/.github/workflows/samples-go.yaml @@ -1,4 +1,4 @@ -name: Samples Go +name: Samples Go on: push: @@ -6,15 +6,17 @@ on: - 'samples/server/petstore/go-echo-server/**' - 'samples/server/petstore/go-api-server/**' - 'samples/server/petstore/go-chi-server/**' + - 'samples/server/others/go-server/no-body-path-params/**' pull_request: paths: - 'samples/server/petstore/go-echo-server/**' - 'samples/server/petstore/go-api-server/**' - 'samples/server/petstore/go-chi-server/**' + - 'samples/server/others/go-server/no-body-path-params/**' jobs: build: - name: Build Go + name: Build Go runs-on: ubuntu-latest strategy: fail-fast: false @@ -23,6 +25,7 @@ jobs: - samples/server/petstore/go-echo-server/ - samples/server/petstore/go-api-server/ - samples/server/petstore/go-chi-server/ + - samples/server/others/go-server/no-body-path-params/ steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml new file mode 100644 index 00000000000..3c193ea204f --- /dev/null +++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml @@ -0,0 +1,42 @@ +name: Java Client (Echo API) JDK17 + +on: + push: + paths: + - samples/client/echo_api/java/restclient + pull_request: + paths: + - samples/client/echo_api/java/restclient +jobs: + build: + name: Build Java Client JDK17 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/echo_api/java/restclient + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + - name: Cache maven dependencies + uses: actions/cache@v4 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Setup node.js + uses: actions/setup-node@v4 + - 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: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 11eb1fb933c..15994e5b749 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -15,6 +15,7 @@ on: - samples/client/others/java/webclient-useAbstractionForFiles/** - samples/client/others/java/jersey2-oneOf-duplicates/** - samples/client/others/java/jersey2-oneOf-Mixed/** + - samples/client/others/java/resttemplate-list-schema-validation/** pull_request: paths: - 'samples/client/petstore/java/**' @@ -29,6 +30,7 @@ on: - samples/client/others/java/webclient-useAbstractionForFiles/** - samples/client/others/java/jersey2-oneOf-duplicates/** - samples/client/others/java/jersey2-oneOf-Mixed/** + - samples/client/others/java/resttemplate-list-schema-validation/** jobs: build: name: Build Java Client JDK11 @@ -73,10 +75,12 @@ jobs: - samples/client/petstore/java/resttemplate-swagger2/ - samples/openapi3/client/petstore/java/jersey2-java8-swagger2/ - samples/client/others/java/okhttp-gson-oneOf/ + - samples/client/echo_api/java/okhttp-gson-user-defined-templates/ - samples/client/others/java/resttemplate-useAbstractionForFiles/ - samples/client/others/java/webclient-useAbstractionForFiles/ - samples/client/others/java/jersey2-oneOf-duplicates/ - samples/client/others/java/jersey2-oneOf-Mixed/ + - samples/client/others/java/resttemplate-list-schema-validation/ steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml index 65bdb2a3413..b43fee7981c 100644 --- a/.github/workflows/samples-java-client-jdk17.yaml +++ b/.github/workflows/samples-java-client-jdk17.yaml @@ -5,10 +5,12 @@ on: paths: - samples/client/petstore/java/resttemplate-jakarta/** - samples/client/petstore/java/webclient-jakarta/** + - samples/client/petstore/java/restclient-*/** pull_request: paths: - samples/client/petstore/java/resttemplate-jakarta/** - samples/client/petstore/java/webclient-jakarta/** + - samples/client/petstore/java/restclient-*/** jobs: build: name: Build Java Client JDK17 @@ -20,6 +22,9 @@ jobs: # clients - samples/client/petstore/java/resttemplate-jakarta - samples/client/petstore/java/webclient-jakarta + - samples/client/petstore/java/restclient + - samples/client/petstore/java/restclient-nullable-arrays + - samples/client/petstore/java/restclient-swagger2 steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -34,9 +39,27 @@ jobs: path: | ~/.m2 key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build with Maven working-directory: ${{ matrix.sample }} run: mvn clean package - - name: Build with Gradle + + - name: Cache gradle dependencies + uses: actions/cache@v4 + env: + cache-name: gradle-caches + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} + + - name: Cache gradle wrapper + uses: actions/cache@v4 + env: + cache-name: gradle-wrapper + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} + + - name: Build working-directory: ${{ matrix.sample }} - run: gradle clean build + run: ./gradlew build -x test diff --git a/.github/workflows/samples-java-helidon.yaml b/.github/workflows/samples-java-helidon-v3.yaml similarity index 59% rename from .github/workflows/samples-java-helidon.yaml rename to .github/workflows/samples-java-helidon-v3.yaml index 0ea61f91ff5..7f2bce545c7 100644 --- a/.github/workflows/samples-java-helidon.yaml +++ b/.github/workflows/samples-java-helidon-v3.yaml @@ -1,14 +1,14 @@ -name: Samples Java Helidon +name: Samples Java Helidon v3 on: push: paths: - - samples/client/petstore/java-helidon-client/** - - samples/server/petstore/java-helidon-server/** + - samples/client/petstore/java-helidon-client/v3/** + - samples/server/petstore/java-helidon-server/v3/** pull_request: paths: - - samples/client/petstore/java-helidon-client/** - - samples/server/petstore/java-helidon-server/** + - samples/client/petstore/java-helidon-client/v3/** + - samples/server/petstore/java-helidon-server/v3/** jobs: build: name: Build Java Helidon @@ -17,10 +17,10 @@ jobs: fail-fast: false matrix: sample: - - samples/client/petstore/java-helidon-client/mp - - samples/client/petstore/java-helidon-client/se - - samples/server/petstore/java-helidon-server/mp - - samples/server/petstore/java-helidon-server/se + - samples/client/petstore/java-helidon-client/v3/mp + - samples/client/petstore/java-helidon-client/v3/se + - samples/server/petstore/java-helidon-server/v3/mp + - samples/server/petstore/java-helidon-server/v3/se version: [17] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml new file mode 100644 index 00000000000..3b2bc66ec90 --- /dev/null +++ b/.github/workflows/samples-java-helidon-v4.yaml @@ -0,0 +1,39 @@ +name: Samples Java Helidon v4 + +on: + push: + paths: + - samples/client/petstore/java-helidon-client/v4/** + - samples/server/petstore/java-helidon-server/v4/** + pull_request: + paths: + - samples/client/petstore/java-helidon-client/v4/** + - samples/server/petstore/java-helidon-server/v4/** +jobs: + build: + name: Build Java Helidon + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/java-helidon-client/v4/mp + - samples/server/petstore/java-helidon-server/v4/mp + version: [21] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.version }} + - name: Cache maven dependencies + uses: actions/cache@v4 + 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-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml index 51de7249423..56694212c96 100644 --- a/.github/workflows/samples-java-server-jdk8.yaml +++ b/.github/workflows/samples-java-server-jdk8.yaml @@ -10,6 +10,7 @@ on: - 'samples/server/petstore/java-pkmst/**' # test in circleci instead - 'samples/server/petstore/java-undertow/**' + - 'samples/server/petstore/java-microprofile/**' pull_request: paths: #- 'samples/server/petstore/java-camel/**' @@ -17,6 +18,7 @@ on: - 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-pkmst/**' #- 'samples/server/petstore/java-undertow/**' + - 'samples/server/petstore/java-microprofile/**' jobs: build: name: Build Java Server @@ -31,6 +33,7 @@ jobs: - samples/server/petstore/java-inflector/ - samples/server/petstore/java-pkmst/ #- samples/server/petstore/java-undertow/ + - samples/server/petstore/java-microprofile/ steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index 41ebe0190d9..f013cd851c0 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -4,28 +4,28 @@ on: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** - - samples/client/petstore/java-helidon-client/mp/** - - samples/client/petstore/java-helidon-client/se/** + - samples/client/petstore/java-helidon-client/v3/mp/** + - samples/client/petstore/java-helidon-client/v3/se/** - samples/client/petstore/spring-http-interface-reactive/** - samples/client/petstore/spring-http-interface/** - samples/client/petstore/java/webclient-jakarta/** # servers - samples/openapi3/server/petstore/springboot-3/** - - samples/server/petstore/java-helidon-server/mp/** - - samples/server/petstore/java-helidon-server/se/** + - samples/server/petstore/java-helidon-server/v3/mp/** + - samples/server/petstore/java-helidon-server/v3/se/** pull_request: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** - - samples/client/petstore/java-helidon-client/mp/** - - samples/client/petstore/java-helidon-client/se/** + - samples/client/petstore/java-helidon-client/v3/mp/** + - samples/client/petstore/java-helidon-client/v3/se/** - samples/client/petstore/spring-http-interface-reactive/** - samples/client/petstore/spring-http-interface/** - samples/client/petstore/java/webclient-jakarta/** # servers - samples/openapi3/server/petstore/springboot-3/** - - samples/server/petstore/java-helidon-server/mp/** - - samples/server/petstore/java-helidon-server/se/** + - samples/server/petstore/java-helidon-server/v3/mp/** + - samples/server/petstore/java-helidon-server/v3/se/** jobs: build: name: Build with JDK17 @@ -36,15 +36,15 @@ jobs: sample: # clients - samples/openapi3/client/petstore/spring-cloud-3 - - samples/client/petstore/java-helidon-client/mp - - samples/client/petstore/java-helidon-client/se + - samples/client/petstore/java-helidon-client/v3/mp/ + - samples/client/petstore/java-helidon-client/v3/se - samples/client/petstore/spring-http-interface-reactive - samples/client/petstore/spring-http-interface - samples/client/petstore/java/webclient-jakarta # servers - samples/openapi3/server/petstore/springboot-3 - - samples/server/petstore/java-helidon-server/mp - - samples/server/petstore/java-helidon-server/se + - samples/server/petstore/java-helidon-server/v3/mp/ + - samples/server/petstore/java-helidon-server/v3/se - samples/client/petstore/spring-http-interface-reactive - samples/client/petstore/spring-http-interface steps: diff --git a/.github/workflows/samples-jdk21.yaml b/.github/workflows/samples-jdk21.yaml new file mode 100644 index 00000000000..e09a4485348 --- /dev/null +++ b/.github/workflows/samples-jdk21.yaml @@ -0,0 +1,43 @@ +name: Samples JDK21 +on: + push: + paths: + # clients + - samples/client/petstore/java-helidon-client/v4/mp/** + # servers + - samples/server/petstore/java-helidon-server/v4/mp/** + pull_request: + paths: + # clients + - samples/client/petstore/java-helidon-client/v4/mp/** + # servers + - samples/server/petstore/java-helidon-server/v4/mp/** +jobs: + build: + name: Build with JDK21 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/java-helidon-client/v4/mp/ + # servers + - samples/server/petstore/java-helidon-server/v4/mp/ + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + - name: Cache maven dependencies + uses: actions/cache@v4 + 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-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index ab5b2c91b59..9689c0d02b6 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -10,9 +10,6 @@ on: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' -env: - GRADLE_VERSION: 6.9 - jobs: build: name: Build Kotlin client @@ -65,7 +62,6 @@ jobs: - samples/client/echo_api/kotlin-jvm-spring-3-webclient - samples/client/petstore/kotlin-jvm-spring-3-restclient - samples/client/echo_api/kotlin-jvm-spring-3-restclient - - samples/client/petstore/kotlin-spring-cloud - samples/client/petstore/kotlin-name-parameter-mappings - samples/client/others/kotlin-jvm-okhttp-parameter-tests steps: @@ -73,7 +69,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 8 + java-version: 11 - name: Cache maven dependencies uses: actions/cache@v4 env: @@ -85,7 +81,6 @@ jobs: - name: Install Gradle wrapper uses: eskatos/gradle-command-action@v3 with: - gradle-version: ${{ env.GRADLE_VERSION }} build-root-directory: ${{ matrix.sample }} arguments: wrapper - name: Build diff --git a/.github/workflows/samples-kotlin-echo-api.yaml b/.github/workflows/samples-kotlin-echo-api.yaml index f4fc53d0c5a..0d92c30383b 100644 --- a/.github/workflows/samples-kotlin-echo-api.yaml +++ b/.github/workflows/samples-kotlin-echo-api.yaml @@ -7,8 +7,7 @@ on: pull_request: paths: - samples/client/echo_api/kotlin** -env: - GRADLE_VERSION: 7.4 + jobs: build: name: Build Kotlin Client JDK17 @@ -37,7 +36,6 @@ jobs: - name: Install Gradle wrapper uses: eskatos/gradle-command-action@v3 with: - gradle-version: ${{ env.GRADLE_VERSION }} build-root-directory: ${{ matrix.sample }} arguments: wrapper - name: Setup node.js diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index 5f76d2fb9bc..b98d4c69532 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -43,6 +43,7 @@ jobs: - samples/server/petstore/kotlin-server/javalin - samples/server/others/kotlin-server/jaxrs-spec - samples/server/others/kotlin-server/jaxrs-spec-array-response + - samples/server/petstore/kotlin-spring-cloud # comment out due to gradle build failure #- samples/server/petstore/kotlin-spring-default # no build.gradle file diff --git a/.github/workflows/samples-kotlin-wiremock.yaml b/.github/workflows/samples-kotlin-wiremock.yaml new file mode 100644 index 00000000000..6b40912dd26 --- /dev/null +++ b/.github/workflows/samples-kotlin-wiremock.yaml @@ -0,0 +1,44 @@ +name: Samples Kotlin WireMock + +on: + push: + branches: + - samples/server/petstore/kotlin-wiremock/** + - samples/server/echo_api/kotlin-wiremock/** + pull_request: + paths: + - samples/server/petstore/kotlin-wiremock/** + - samples/server/echo_api/kotlin-wiremock/** + +jobs: + build: + name: Build Kotlin WireMock + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + - samples/server/petstore/kotlin-wiremock + - samples/server/echo_api/kotlin-wiremock + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 11 + - name: Cache maven dependencies + uses: actions/cache@v4 + env: + cache-name: maven-repository + with: + path: | + ~/.gradle + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Install Gradle wrapper + uses: eskatos/gradle-command-action@v3 + with: + build-root-directory: ${{ matrix.sample }} + arguments: wrapper + - name: Build + working-directory: ${{ matrix.sample }} + run: ./gradlew build -x test diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml index 82ead5c953a..0d2941f6e3c 100644 --- a/.github/workflows/samples-php8.yaml +++ b/.github/workflows/samples-php8.yaml @@ -4,9 +4,11 @@ on: push: paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** + - samples/server/petstore/php-flight/** pull_request: paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** + - samples/server/petstore/php-flight/** jobs: build: name: Build PHP projects @@ -17,6 +19,7 @@ jobs: sample: # servers - samples/server/petstore/php-symfony/SymfonyBundle-php/ + - samples/server/petstore/php-flight/ steps: - uses: actions/checkout@v4 - name: Setup PHP with tools diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 20176edc84f..7387aba6203 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -39,7 +39,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- - name: Setup Maven - uses: s4u/setup-maven-action@v1.12.0 + uses: s4u/setup-maven-action@v1.13.0 with: java-version: ${{ matrix.java }} maven-version: 3.8.8 diff --git a/.gitignore b/.gitignore index bdc4f34b4d8..0bebe6bad6e 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,11 @@ samples/client/petstore/cpp-restsdk/CMakeCache.txt samples/client/petstore/cpp-restsdk/CMakeFiles/ samples/client/petstore/cpp-restsdk/Makefile samples/client/petstore/cpp-restsdk/cmake_install.cmake +samples/client/petstore/cpp-restsdk/client/CMakeFiles +samples/client/petstore/cpp-restsdk/client/Makefile +samples/client/petstore/cpp-restsdk/client/cmake_install.cmake +samples/client/petstore/cpp-restsdk/client/CppRestPetstoreClientConfig.cmake +samples/client/petstore/cpp-restsdk/client/CMakeCache.txt #Java/Android **/.gradle diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 00000000000..f9967f3a5db --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1,2 @@ +java=11.0.23-tem +maven=3.8.8 diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 837eaa0b522..06e2f163e4e 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -43,6 +43,7 @@ elif [ "$NODE_INDEX" = "2" ]; then (cd samples/client/petstore/go && mvn integration-test) (cd samples/openapi3/client/petstore/go && mvn integration-test) (cd samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false && mvn integration-test) + (cd samples/client/others/go/allof_multiple_ref_and_discriminator && mvn integration-test) elif [ "$NODE_INDEX" = "3" ]; then @@ -110,5 +111,6 @@ else (cd samples/client/petstore/java/resteasy && mvn integration-test) (cd samples/client/petstore/java-micronaut-client && mvn integration-test) (cd samples/client/petstore/java/apache-httpclient && mvn integration-test) + (cd samples/client/petstore/java/resttemplate-jakarta && mvn integration-test) fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25b8c613622..695a8d95a02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages) -If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. +If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. ### Templates @@ -84,6 +84,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master - For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit` - For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. +### Building + +The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs. + +```shell +./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true +``` + +Or on Windows: + +```shell +mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true +``` + +The binary can run via `java -jar`. For example: + +```shell +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help +``` + ### Testing To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen) @@ -112,5 +132,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/ - File a PR with meaningful title, description and commit messages - Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed. - Recommended git settings - - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around + - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around - To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) diff --git a/README.md b/README.md index 89b69acd365..6f963522835 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.5.0`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.7.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) @@ -69,6 +69,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa [](https://www.svix.com/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship) [](https://litslink.com/services/artificial-intelligence?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship) [](https://designli.co?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship) +[](https://opensource.muenchen.de?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship) #### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity @@ -85,7 +86,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.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, pekko), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (9.x - 17.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/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) | +| **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** ([Flight](https://docs.flightphp.com/), 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/), [Cask](https://github.com/com-lihaoyi/cask), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** | @@ -126,8 +127,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI Generator Version | Release Date | Notes | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | -| 7.5.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.5.0-SNAPSHOT/) | 12.04.2024 | Minor release with breaking changes (with fallback) | -| [7.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.4.0) (latest stable release) | 11.03.2024 | Minor release with breaking changes (with fallback) | +| 7.7.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.7.0-SNAPSHOT/) | 20.06.2024 | Minor release with breaking changes (with fallback) | +| [7.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.6.0) (latest stable release) | 20.05.2024 | Minor release with breaking changes (with fallback) | | [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) | @@ -190,16 +191,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -260,7 +261,7 @@ To build from source, you need the following installed and available in your `$P * [Java 11](https://adoptium.net/) -* [Apache Maven 3.3.4 or greater](https://maven.apache.org/) (optional) +* [Apache Maven 3.8.8 or greater](https://maven.apache.org/) (optional) After cloning the project, you can build it from source using [maven wrapper](https://maven.apache.org/wrapper/): @@ -705,6 +706,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [REST United](https://restunited.com) - [Robocorp](https://www.robocorp.com) - [Robotinfra](https://www.robotinfra.com) +- [SearchApi](https://www.searchapi.io/) - [SmartHR](https://smarthr.co.jp/) - [Sony Interactive Entertainment](https://www.sie.com/en/index.html) - [Splitit](https://www.splitit.com/) @@ -931,6 +933,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2023-12-10 - [UnityでOpenAPI Generatorを使う](https://www.youtube.com/watch?v=CbNwKVV5LRM) by [Soup Tori](https://www.youtube.com/@souptori8417) - 2024-03-04 - [Generating TypeScript Types with OpenAPI for REST API Consumption](https://www.pullrequest.com/blog/generating-typescript-types-with-openapi-for-rest-api-consumption/) by [PullRequest](https://www.pullrequest.com/) - 2024-03-07 - [Fully typed Web Apps with OpenAPI (Part 1)](https://medium.com/@gfox1984/fully-typed-web-apps-with-openapi-part-1-595d55766670) by [Guillaume Renard](https://medium.com/@gfox1984) +- 2024-03-08 - [Laravel OpenAPIによる "辛くない" スキーマ駆動開発](https://fortee.jp/phperkaigi-2024/proposal/9e2e6c38-d078-4efa-99b4-83ebf9033b34) by [KentarouTakeda](https://twitter.com/KentarouTakeda) ## [6 - About Us](#table-of-contents) @@ -1089,7 +1092,9 @@ Here is a list of template creators: * Kotlin (Spring Boot): @dr4ke616 * Kotlin (Vertx): @Wooyme * Kotlin (JAX-RS): @anttileppa + * Kotlin WireMock: @stefankoppier * NodeJS Express: @YishTish + * PHP Flight: @daniel-sc * PHP Laravel: @renepardon * PHP Lumen: @abcsun * PHP Mezzio (with Path Handler): @Articus diff --git a/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml b/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml new file mode 100644 index 00000000000..b18ff7270d9 --- /dev/null +++ b/bin/configs/cpp-pistache-server-cpp-pistache-everything.yaml @@ -0,0 +1,7 @@ +generatorName: cpp-pistache-server +outputDir: samples/server/petstore/cpp-pistache-everything +inputSpec: modules/openapi-generator/src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +additionalProperties: + useStructModel: "false" + addExternalLibs: "true" diff --git a/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml new file mode 100644 index 00000000000..32657b4cf37 --- /dev/null +++ b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml @@ -0,0 +1,7 @@ +generatorName: cpp-pistache-server +outputDir: samples/server/petstore/cpp-pistache-nested-schema-refs +inputSpec: modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +additionalProperties: + useStructModel: "false" + addExternalLibs: "true" diff --git a/bin/configs/cpp-restsdk-client.yaml b/bin/configs/cpp-restsdk-client.yaml index fedc628a69e..ccd23932b49 100644 --- a/bin/configs/cpp-restsdk-client.yaml +++ b/bin/configs/cpp-restsdk-client.yaml @@ -1,6 +1,6 @@ generatorName: cpp-restsdk outputDir: samples/client/petstore/cpp-restsdk/client -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-restsdk/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/cpp-rest-sdk-client additionalProperties: packageName: CppRestPetstoreClient diff --git a/bin/configs/go-multiple-allof-ref-with-discriminator.yaml b/bin/configs/go-multiple-allof-ref-with-discriminator.yaml new file mode 100644 index 00000000000..c2c8a195dc5 --- /dev/null +++ b/bin/configs/go-multiple-allof-ref-with-discriminator.yaml @@ -0,0 +1,5 @@ +generatorName: go +outputDir: samples/client/others/go/allof_multiple_ref_and_discriminator +inputSpec: modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/go-server-no-body-path-params.yaml b/bin/configs/go-server-no-body-path-params.yaml new file mode 100644 index 00000000000..06b9d63908b --- /dev/null +++ b/bin/configs/go-server-no-body-path-params.yaml @@ -0,0 +1,8 @@ +generatorName: go-server +outputDir: samples/server/others/go-server/no-body-path-params +inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/no-body-path-params.yaml +templateDir: modules/openapi-generator/src/main/resources/go-server +additionalProperties: + hideGenerationTimestamp: "true" + packageName: petstoreserver + addResponseHeaders: true diff --git a/bin/configs/unmaintained/html2.yaml b/bin/configs/html2.yaml similarity index 100% rename from bin/configs/unmaintained/html2.yaml rename to bin/configs/html2.yaml diff --git a/bin/configs/java-helidon-client-mp.yaml b/bin/configs/java-helidon-client-mp_3.yaml similarity index 82% rename from bin/configs/java-helidon-client-mp.yaml rename to bin/configs/java-helidon-client-mp_3.yaml index 5dc5c6883c6..6b5babac3c1 100644 --- a/bin/configs/java-helidon-client-mp.yaml +++ b/bin/configs/java-helidon-client-mp_3.yaml @@ -1,8 +1,9 @@ generatorName: java-helidon-client library: mp -outputDir: samples/client/petstore/java-helidon-client/mp +outputDir: samples/client/petstore/java-helidon-client/v3/mp inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml additionalProperties: + helidonVersion: 3.2.7 artifactId: petstore-helidon-client-mp hideGenerationTimestamp: "true" configureAuth: "false" diff --git a/bin/configs/java-helidon-client-mp_4.yaml b/bin/configs/java-helidon-client-mp_4.yaml new file mode 100644 index 00000000000..188afa0e86b --- /dev/null +++ b/bin/configs/java-helidon-client-mp_4.yaml @@ -0,0 +1,14 @@ +generatorName: java-helidon-client +library: mp +outputDir: samples/client/petstore/java-helidon-client/v4/mp +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + helidonVersion: 4.0.8 + artifactId: petstore-helidon-client-mp + hideGenerationTimestamp: "true" + configureAuth: "false" + build: "all" + test: "spock" + requiredPropertiesInConstructor: "false" + visitable: "true" + fullProject: "true" diff --git a/bin/configs/java-helidon-client-se.yaml b/bin/configs/java-helidon-client-se_3.yaml similarity index 82% rename from bin/configs/java-helidon-client-se.yaml rename to bin/configs/java-helidon-client-se_3.yaml index bd4d7a363fd..41e816215af 100644 --- a/bin/configs/java-helidon-client-se.yaml +++ b/bin/configs/java-helidon-client-se_3.yaml @@ -1,8 +1,9 @@ generatorName: java-helidon-client library: se -outputDir: samples/client/petstore/java-helidon-client/se +outputDir: samples/client/petstore/java-helidon-client/v3/se inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml additionalProperties: + helidonVersion: 3.2.7 artifactId: petstore-helidon-client-se hideGenerationTimestamp: "true" configureAuth: "false" diff --git a/bin/configs/java-helidon-server-mp.yaml b/bin/configs/java-helidon-server-mp_3.yaml similarity index 82% rename from bin/configs/java-helidon-server-mp.yaml rename to bin/configs/java-helidon-server-mp_3.yaml index 80a72e4f3bd..3be0b87e189 100644 --- a/bin/configs/java-helidon-server-mp.yaml +++ b/bin/configs/java-helidon-server-mp_3.yaml @@ -1,9 +1,10 @@ generatorName: java-helidon-server library: mp -outputDir: samples/server/petstore/java-helidon-server/mp +outputDir: samples/server/petstore/java-helidon-server/v3/mp 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-helidon/server additionalProperties: + helidonVersion: 3.2.7 artifactId: petstore-helidon-server-mp hideGenerationTimestamp: "true" build: "all" diff --git a/bin/configs/java-helidon-server-mp_4.yaml b/bin/configs/java-helidon-server-mp_4.yaml new file mode 100644 index 00000000000..40de63bc808 --- /dev/null +++ b/bin/configs/java-helidon-server-mp_4.yaml @@ -0,0 +1,13 @@ +generatorName: java-helidon-server +library: mp +outputDir: samples/server/petstore/java-helidon-server/v4/mp +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-helidon/server +additionalProperties: + helidonVersion: 4.0.8 + artifactId: petstore-helidon-server-mp + hideGenerationTimestamp: "true" + build: "all" + test: "spock" + useAuth: "false" + fullProject: "true" \ No newline at end of file diff --git a/bin/configs/java-helidon-server-se.yaml b/bin/configs/java-helidon-server-se_3.yaml similarity index 80% rename from bin/configs/java-helidon-server-se.yaml rename to bin/configs/java-helidon-server-se_3.yaml index 641f131f5ed..154e428f725 100644 --- a/bin/configs/java-helidon-server-se.yaml +++ b/bin/configs/java-helidon-server-se_3.yaml @@ -1,9 +1,10 @@ generatorName: java-helidon-server library: se -outputDir: samples/server/petstore/java-helidon-server/se +outputDir: samples/server/petstore/java-helidon-server/v3/se 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-helidon/server additionalProperties: + helidonVersion: 3.2.7 artifactId: petstore-helidon-server-se hideGenerationTimestamp: "true" fullProject: "true" \ No newline at end of file diff --git a/bin/configs/java-jersey2-special-characters.yaml b/bin/configs/java-jersey2-special-characters.yaml index c73b70cc36c..d2fb98091a2 100644 --- a/bin/configs/java-jersey2-special-characters.yaml +++ b/bin/configs/java-jersey2-special-characters.yaml @@ -10,6 +10,4 @@ additionalProperties: dateLibrary: java8 useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false -systemProperties: - skipValidateSpec: "false" - +validateSpec: false 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 index 8dc08e4a4bb..40500d64508 100644 --- 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 @@ -3,10 +3,10 @@ outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-wit 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" hideGenerationTimestamp: true + withXml: true diff --git a/bin/configs/java-microprofile-rest-client.yaml b/bin/configs/java-microprofile-rest-client.yaml index 384a6aa7f30..325cebe61ca 100644 --- a/bin/configs/java-microprofile-rest-client.yaml +++ b/bin/configs/java-microprofile-rest-client.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/microprofile-rest-client library: microprofile -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: microprofile-rest-client - configKey: petstore + configKeyFromClassName: true diff --git a/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml b/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml new file mode 100644 index 00000000000..44bf605f09e --- /dev/null +++ b/bin/configs/java-microprofile-server-multiple-2xx-responses.yaml @@ -0,0 +1,8 @@ +generatorName: java-microprofile +outputDir: samples/server/petstore/java-microprofile +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-multiple-2xx-responses.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + hideGenerationTimestamp: "true" + microprofileMutiny: "true" + serializationLibrary: "jackson" diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml index cac729a68aa..ba1795d9de3 100644 --- a/bin/configs/java-native.yaml +++ b/bin/configs/java-native.yaml @@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-native hideGenerationTimestamp: "true" + generateBuilders: true diff --git a/bin/configs/java-okhttp-user-defined-templates.yaml b/bin/configs/java-okhttp-user-defined-templates.yaml new file mode 100644 index 00000000000..650c2dc1b19 --- /dev/null +++ b/bin/configs/java-okhttp-user-defined-templates.yaml @@ -0,0 +1,17 @@ +generatorName: java +outputDir: samples/client/echo_api/java/okhttp-gson-user-defined-templates +library: okhttp-gson +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + hideGenerationTimestamp: "true" +files: + README.mustache: + destinationFilename: info.md + api_doc.mustache: + templateType: APIDocs + destinationFilename: Documentation.md + pojo.mustache: + templateType: Model + folder: modelCopy + destinationFilename: .java diff --git a/bin/configs/java-restclient-echo-api.yaml b/bin/configs/java-restclient-echo-api.yaml new file mode 100644 index 00000000000..9612901f8f7 --- /dev/null +++ b/bin/configs/java-restclient-echo-api.yaml @@ -0,0 +1,13 @@ +generatorName: java +outputDir: samples/client/echo_api/java/restclient +library: restclient +inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml +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-restclient-nullable-array.yaml b/bin/configs/java-restclient-nullable-array.yaml new file mode 100644 index 00000000000..99e45bfd551 --- /dev/null +++ b/bin/configs/java-restclient-nullable-array.yaml @@ -0,0 +1,8 @@ +generatorName: java +outputDir: samples/client/petstore/java/restclient-nullable-arrays +library: restclient +inputSpec: modules/openapi-generator/src/test/resources/3_0/schema-with-nullable-arrays.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-restclient-nullable-arrays + hideGenerationTimestamp: "true" diff --git a/bin/configs/java-restclient-swagger2.yaml b/bin/configs/java-restclient-swagger2.yaml new file mode 100644 index 00000000000..a4fc8ba02cd --- /dev/null +++ b/bin/configs/java-restclient-swagger2.yaml @@ -0,0 +1,10 @@ +generatorName: java +outputDir: samples/client/petstore/java/restclient-swagger2 +library: restclient +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-restclient + hideGenerationTimestamp: "true" + containerDefaultToNull: "true" + annotationLibrary: "swagger2" diff --git a/bin/configs/java-restclient-useAbstractionForFiles.yaml b/bin/configs/java-restclient-useAbstractionForFiles.yaml new file mode 100644 index 00000000000..ea2e03468ec --- /dev/null +++ b/bin/configs/java-restclient-useAbstractionForFiles.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/others/java/restclient-useAbstractionForFiles +library: restclient +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-restclient + hideGenerationTimestamp: "true" + useAbstractionForFiles: true diff --git a/bin/configs/java-restclient.yaml b/bin/configs/java-restclient.yaml new file mode 100644 index 00000000000..e5c5ac1e73f --- /dev/null +++ b/bin/configs/java-restclient.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/restclient +library: restclient +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-restclient + hideGenerationTimestamp: "true" + containerDefaultToNull: "true" diff --git a/bin/configs/java-resttemplate-jakarta.yaml b/bin/configs/java-resttemplate-jakarta.yaml index 098e0d96e76..88b094e18ec 100644 --- a/bin/configs/java-resttemplate-jakarta.yaml +++ b/bin/configs/java-resttemplate-jakarta.yaml @@ -8,3 +8,4 @@ additionalProperties: hideGenerationTimestamp: "true" java8: true useJakartaEe: true + generateConstructorWithAllArgs: true diff --git a/bin/configs/java-resttemplate-list-schema-validation.yaml b/bin/configs/java-resttemplate-list-schema-validation.yaml new file mode 100644 index 00000000000..7121a1163db --- /dev/null +++ b/bin/configs/java-resttemplate-list-schema-validation.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/others/java/resttemplate-list-schema-validation +library: resttemplate +inputSpec: modules/openapi-generator/src/test/resources/3_1/issue-17485.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: java-resttemplate-list-schema-validation + hideGenerationTimestamp: "true" + useBeanValidation: true + generateConstructorWithAllArgs: true + diff --git a/bin/configs/java-resttemplate.yaml b/bin/configs/java-resttemplate.yaml index e71609cbcf3..9d8bec57461 100644 --- a/bin/configs/java-resttemplate.yaml +++ b/bin/configs/java-resttemplate.yaml @@ -8,3 +8,5 @@ additionalProperties: hideGenerationTimestamp: "true" java8: true containerDefaultToNull: true + generateConstructorWithAllArgs: true + generateBuilders: true diff --git a/bin/configs/jaxrs-spec-quarkus-mutiny.yaml b/bin/configs/jaxrs-spec-quarkus-mutiny.yaml new file mode 100644 index 00000000000..5620523e027 --- /dev/null +++ b/bin/configs/jaxrs-spec-quarkus-mutiny.yaml @@ -0,0 +1,15 @@ +generatorName: jaxrs-spec +outputDir: samples/server/petstore/jaxrs-spec-quarkus-mutiny +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/spec +additionalProperties: + artifactId: jaxrs-spec-petstore-server + serializableModel: "true" + hideGenerationTimestamp: "true" + implicitHeadersRegex: (api_key|enum_header_string) + generateBuilders: "true" + useMicroProfileOpenAPIAnnotations: "true" + useAsync: "true" + useMutiny: "true" + library: "quarkus" + dateLibrary: "java8-localdatetime" diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml index dbbb86bb420..0eca24e4259 100644 --- a/bin/configs/jaxrs-spec.yaml +++ b/bin/configs/jaxrs-spec.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-spec outputDir: samples/server/petstore/jaxrs-spec -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/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec additionalProperties: artifactId: jaxrs-spec-petstore-server diff --git a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml index ddafa03ed68..ac7972643cd 100644 --- a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml +++ b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml @@ -1,6 +1,6 @@ generatorName: kotlin outputDir: samples/client/echo_api/kotlin-jvm-spring-3-webclient -library: jvm-spring-restclient +library: jvm-spring-webclient inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-client additionalProperties: diff --git a/bin/configs/kotlin-spring-cloud.yaml b/bin/configs/kotlin-spring-cloud.yaml index 10e6f95a805..676e15788e1 100644 --- a/bin/configs/kotlin-spring-cloud.yaml +++ b/bin/configs/kotlin-spring-cloud.yaml @@ -1,5 +1,5 @@ generatorName: kotlin-spring -outputDir: samples/client/petstore/kotlin-spring-cloud +outputDir: samples/server/petstore/kotlin-spring-cloud library: spring-cloud inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-spring diff --git a/bin/configs/kotlin-wiremock-echo-api.yaml b/bin/configs/kotlin-wiremock-echo-api.yaml new file mode 100644 index 00000000000..5230b295075 --- /dev/null +++ b/bin/configs/kotlin-wiremock-echo-api.yaml @@ -0,0 +1,4 @@ +generatorName: kotlin-wiremock +outputDir: samples/server/echo_api/kotlin-wiremock +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-wiremock diff --git a/bin/configs/kotlin-wiremock.yaml b/bin/configs/kotlin-wiremock.yaml new file mode 100644 index 00000000000..0e63dfe3cc4 --- /dev/null +++ b/bin/configs/kotlin-wiremock.yaml @@ -0,0 +1,4 @@ +generatorName: kotlin-wiremock +outputDir: samples/server/petstore/kotlin-wiremock +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-wiremock diff --git a/bin/configs/manual/rust-axum-header-uuid.yaml b/bin/configs/manual/rust-axum-header-uuid.yaml new file mode 100644 index 00000000000..7e04339b464 --- /dev/null +++ b/bin/configs/manual/rust-axum-header-uuid.yaml @@ -0,0 +1,9 @@ +generatorName: rust-axum +outputDir: samples/server/petstore/rust-axum/output/rust-axum-header-uuid +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-header-uuid.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-axum +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: rust-axum-header-uui +enablePostProcessFile: true diff --git a/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml index 69ca39092e4..5a537e65b85 100644 --- a/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml +++ b/bin/configs/manual/rust-axum-petstore-with-fake-endpoints-models-for-testing.yaml @@ -7,4 +7,6 @@ additionalProperties: hideGenerationTimestamp: "true" packageName: petstore-with-fake-endpoints-models-for-testing publishRustRegistry: crates-io -enablePostProcessFile: true \ No newline at end of file +globalProperties: + skipFormModel: false +enablePostProcessFile: true diff --git a/bin/configs/manual/rust-axum-petstore.yaml b/bin/configs/manual/rust-axum-petstore.yaml index 3149c741858..179e370639a 100644 --- a/bin/configs/manual/rust-axum-petstore.yaml +++ b/bin/configs/manual/rust-axum-petstore.yaml @@ -6,4 +6,6 @@ generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" packageName: petstore +globalProperties: + skipFormModel: false enablePostProcessFile: true diff --git a/bin/configs/manual/rust-axum-validation.yaml b/bin/configs/manual/rust-axum-validation.yaml new file mode 100644 index 00000000000..3fd5ba01b5e --- /dev/null +++ b/bin/configs/manual/rust-axum-validation.yaml @@ -0,0 +1,10 @@ +generatorName: rust-axum +outputDir: samples/server/petstore/rust-axum/output/rust-axum-validation-test +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-validation-test.yaml +templateDir: modules/openapi-generator/src/main/resources/rust-axum +generateAliasAsModel: true +additionalProperties: + hideGenerationTimestamp: "true" + packageName: rust-axum-validation-test + disableValidator: "true" +enablePostProcessFile: true diff --git a/bin/configs/php-flight.yaml b/bin/configs/php-flight.yaml new file mode 100644 index 00000000000..2c3dedc1911 --- /dev/null +++ b/bin/configs/php-flight.yaml @@ -0,0 +1,6 @@ +generatorName: php-flight +outputDir: samples/server/petstore/php-flight +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-flight +additionalProperties: + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml index 5dea2cbda5e..472f660ac7a 100644 --- a/bin/configs/spring-boot-3.yaml +++ b/bin/configs/spring-boot-3.yaml @@ -11,3 +11,5 @@ additionalProperties: useBeanValidation: true withXml: true hideGenerationTimestamp: "true" + generateConstructorWithAllArgs: true + generateBuilders: true diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 56199a182d1..cf5e016cdbf 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -8,3 +8,4 @@ additionalProperties: hideGenerationTimestamp: "true" java8: true delegatePattern: "true" + generateConstructorWithAllArgs: true diff --git a/bin/configs/spring-boot-lombok-data.yaml b/bin/configs/spring-boot-lombok-data.yaml index ac48f433214..57f54d71d3d 100644 --- a/bin/configs/spring-boot-lombok-data.yaml +++ b/bin/configs/spring-boot-lombok-data.yaml @@ -7,3 +7,5 @@ additionalProperties: artifactId: springboot-lombok-data hideGenerationTimestamp: "true" additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor" + generateConstructorWithAllArgs: true + generateBuilders: true diff --git a/bin/configs/spring-boot-oneof.yaml b/bin/configs/spring-boot-oneof.yaml index a986fc8fabe..f4a7ca7a99c 100644 --- a/bin/configs/spring-boot-oneof.yaml +++ b/bin/configs/spring-boot-oneof.yaml @@ -8,3 +8,4 @@ additionalProperties: artifactId: springboot-oneof snapshotVersion: "true" hideGenerationTimestamp: "true" + generateBuilders: true diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index 2b3dbdc1a86..82530260d67 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -8,3 +8,4 @@ additionalProperties: useOptional: true artifactId: spring-boot-useoptional hideGenerationTimestamp: "true" + generateBuilders: true diff --git a/bin/utils/dart-keywords/README.md b/bin/utils/dart-keywords/README.md index 2873e00dbe1..2d14a81b61d 100644 --- a/bin/utils/dart-keywords/README.md +++ b/bin/utils/dart-keywords/README.md @@ -11,10 +11,7 @@ The last Dart version that was used to generate the keywords can be found in `da ## What does the shellscript do? -1. compile a dart app - - `dart2native save-dart-keywords.dart` - 1. run the dart app - - `./save-dart-keywords.exe` + - `dart run save-dart-keywords.dart` 1. the output is `dart-keywords.txt` and `dart-version.txt` diff --git a/bin/utils/dart-keywords/dart-version.txt b/bin/utils/dart-keywords/dart-version.txt index 81b2d0d2cd6..d580ed2666a 100644 --- a/bin/utils/dart-keywords/dart-version.txt +++ b/bin/utils/dart-keywords/dart-version.txt @@ -1 +1 @@ -Dart VM version: 2.7.0-dev.0.0 (Tue Nov 5 12:57:33 2019 +0100) on "macos_x64" +Dart SDK version: 3.3.0 (stable) (Tue Feb 13 10:25:19 2024 +0000) on "macos_arm64" diff --git a/bin/utils/dart-keywords/pubspec.lock b/bin/utils/dart-keywords/pubspec.lock index f01fb3f2efb..62299e22a52 100644 --- a/bin/utils/dart-keywords/pubspec.lock +++ b/bin/utils/dart-keywords/pubspec.lock @@ -5,190 +5,145 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "67.0.0" analyzer: dependency: "direct main" description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + url: "https://pub.dev" source: hosted - version: "0.39.1" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" + version: "6.4.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.4.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" + version: "2.11.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.14.12" + version: "1.18.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "2.1.3" - csslib: + version: "3.0.3" + file: dependency: transitive description: - name: csslib - url: "https://pub.dartlang.org" + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" source: hosted - version: "0.16.1" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.29" + version: "7.0.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "1.2.0" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+3" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.1+1" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.29" + version: "2.1.2" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" source: hosted - version: "1.1.8" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1+2" + version: "1.12.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.6.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0+1" + version: "1.9.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "1.4.2" + version: "2.1.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.5.5" + version: "1.10.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "1.3.2" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "0.9.7+12" + version: "1.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "3.1.2" sdks: - dart: ">=2.6.0 <3.0.0" + dart: ">=3.0.0 <4.0.0" diff --git a/bin/utils/dart-keywords/pubspec.yaml b/bin/utils/dart-keywords/pubspec.yaml index addb9924168..51e99b0ee94 100644 --- a/bin/utils/dart-keywords/pubspec.yaml +++ b/bin/utils/dart-keywords/pubspec.yaml @@ -4,7 +4,7 @@ description: Use the Dart SDK to generate Dart keywords. version: 1.0.0+1 environment: - sdk: ">=2.6.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: analyzer: diff --git a/bin/utils/dart-keywords/save-dart-keywords.dart b/bin/utils/dart-keywords/save-dart-keywords.dart index 4ad6908a3d5..c48de13d376 100644 --- a/bin/utils/dart-keywords/save-dart-keywords.dart +++ b/bin/utils/dart-keywords/save-dart-keywords.dart @@ -4,13 +4,8 @@ import 'package:analyzer/dart/ast/token.dart'; main() { // save keywords to a text file - final txtFile = File( + final output = File( '../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt'); - String txtString = ''; - for (String keyword in Keyword.keywords.keys.toList()) { - txtString += keyword + '\n'; - } - txtString = - txtString.substring(0, txtString.length - 1); // remove last newline - txtFile.writeAsStringSync(txtString); + final keywords = Keyword.keywords.keys.join('\n'); + output.writeAsStringSync(keywords); } diff --git a/bin/utils/dart-keywords/save_dart_keywords.sh b/bin/utils/dart-keywords/save_dart_keywords.sh index 4211200c8e5..5cb1e40173f 100755 --- a/bin/utils/dart-keywords/save_dart_keywords.sh +++ b/bin/utils/dart-keywords/save_dart_keywords.sh @@ -1,3 +1,2 @@ -dart2native save-dart-keywords.dart -./save-dart-keywords.exe -dart --version &> dart-version.txt \ No newline at end of file +dart run save-dart-keywords.dart +dart --version &> dart-version.txt diff --git a/bin/utils/test_file_list.yaml b/bin/utils/test_file_list.yaml index c86ca6ea74f..31e862ffb19 100644 --- a/bin/utils/test_file_list.yaml +++ b/bin/utils/test_file_list.yaml @@ -8,9 +8,9 @@ sha256: 0a67c32728197e942b13bdda064b73793f12f5c795f1e5cf35a3adf69c973230 # java okhttp gson test files - filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java" - sha256: db505f7801fef62c13a08a8e9ca1fc4c5c947ab46b46f12943139d353feacf17 + sha256: 325fdd5d7e2c97790c0fb44f712ab7b2ba022d7e1a5b0056f47b07f342682b6d - filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java" - sha256: 8210bdaf06aae8dc46521515a8a0ef10e48c980fadd3efd95313e6c806f409c2 + sha256: e673d9928c8eb848262d0116fe0d28db832e128671a810a7c966d06d90cb9b63 - filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java" sha256: 0d64cdc11809a7b5b952ccdad2bd91bd0045b3894d6fabf3e368fa0be12b8217 - filename: "samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java" diff --git a/docs/contributing.md b/docs/contributing.md index 9502582ac4e..2b7f268aefb 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -35,7 +35,7 @@ Please file the pull request against the correct branch, e.g. `master` for non-b All the code generators can be found in [modules/openapi-generator/src/main/java/org/openapitools/codegen/languages](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages) -If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. +If you want to add a new generator, follow the [new-generator](https://openapi-generator.tech/docs/new-generator) guide. ### Templates @@ -88,6 +88,26 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master - For language-specified vendor extension, put it in the form of `x-{lang}-{extension-name}`. e.g. `x-objc-operation-id`, `x-java-feign-retry-limit` - For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page. +### Building + +The `openapi-generator-cli` can be built using the following command. This will generate the `openapi-generator-cli.jar` in the `modules/openapi-generator-cli/target` directory without running the tests and generating the Javadocs. + +```shell +./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true +``` + +Or on Windows: + +```shell +mvnw.cmd clean install -DskipTests -Dmaven.javadoc.skip=true +``` + +The binary can run via `java -jar`. For example: + +```shell +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help +``` + ### Testing To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen) @@ -116,5 +136,5 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/ - File a PR with meaningful title, description and commit messages - Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed. - Recommended git settings - - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around + - `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around - To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) diff --git a/docs/generators.md b/docs/generators.md index 749f43f15db..bb058761aea 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -101,6 +101,7 @@ The following generators are available: * [java-helidon-server (beta)](generators/java-helidon-server.md) * [java-inflector](generators/java-inflector.md) * [java-micronaut-server (beta)](generators/java-micronaut-server.md) +* [java-microprofile](generators/java-microprofile.md) * [java-msf4j](generators/java-msf4j.md) * [java-pkmst](generators/java-pkmst.md) * [java-play-framework](generators/java-play-framework.md) @@ -119,7 +120,9 @@ The following generators are available: * [kotlin-server](generators/kotlin-server.md) * [kotlin-spring](generators/kotlin-spring.md) * [kotlin-vertx (beta)](generators/kotlin-vertx.md) +* [kotlin-wiremock (beta)](generators/kotlin-wiremock.md) * [nodejs-express-server (beta)](generators/nodejs-express-server.md) +* [php-flight (experimental)](generators/php-flight.md) * [php-laravel](generators/php-laravel.md) * [php-lumen](generators/php-lumen.md) * [php-mezzio-ph](generators/php-mezzio-ph.md) diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index 178a0f2bbe8..35886a25a0a 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -28,9 +28,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | -|Object|#include "Object.h"| |nlohmann::json|#include <nlohmann/json.hpp>| |std::map|#include <map>| +|std::set|#include <set>| |std::string|#include <string>| |std::vector|#include <vector>| diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index c60305614de..aef6bfe1c39 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -32,9 +32,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | +|AnyType|#include "AnyType.h"| |HttpContent|#include "HttpContent.h"| |Object|#include "Object.h"| |std::map|#include <map>| +|std::set|#include <set>| |std::string|#include <string>| |std::vector|#include <vector>| |utility::datetime|#include <cpprest/details/basic_types.h>| @@ -184,7 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Uuid|✗| |Array|✓|OAS2,OAS3 |Null|✗|OAS3 -|AnyType|✗|OAS2,OAS3 +|AnyType|✓|OAS2,OAS3 |Object|✓|OAS2,OAS3 |Maps|✓|ToolingExtension |CollectionFormat|✓|OAS2 diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 644631f6272..f93b09ffbf8 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -23,6 +23,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|equalityCheckMethod|Specify equality check method. Takes effect only in case if serializationLibrary is json_serializable.|
**default**
[DEFAULT] Built in hash code generation method
**equatable**
Uses equatable library for equality checking
|default| |finalProperties|Whether properties are marked as final when using Json Serializable for serialization| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| @@ -70,7 +71,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • as
  • assert
  • async
  • +
  • augment
  • await
  • +
  • base
  • break
  • case
  • catch
  • @@ -118,6 +121,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • required
  • rethrow
  • return
  • +
  • sealed
  • set
  • show
  • source
  • @@ -132,6 +136,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • typedef
  • var
  • void
  • +
  • when
  • while
  • with
  • yield
  • diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 45972f5e65b..79148a7e479 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -11,7 +11,7 @@ title: Documentation for the dart Generator | generator type | CLIENT | | | generator language | Dart | | | generator default templating engine | mustache | | -| helpTxt | Generates a Dart 2.x client library. | | +| helpTxt | Generates a Dart client library. | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. @@ -68,7 +68,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • as
  • assert
  • async
  • +
  • augment
  • await
  • +
  • base
  • break
  • case
  • catch
  • @@ -116,6 +118,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • required
  • rethrow
  • return
  • +
  • sealed
  • set
  • show
  • source
  • @@ -130,6 +133,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • typedef
  • var
  • void
  • +
  • when
  • while
  • with
  • yield
  • diff --git a/docs/generators/go.md b/docs/generators/go.md index 31dae23e98b..e81de548e95 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumClassPrefix|Prefix enum with class name| |false| |generateInterfaces|Generate interfaces for api classes| |false| |generateMarshalJSON|Generate MarshalJSON method| |true| +|generateUnmarshalJSON|Generate UnmarshalJSON method| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |isGoSubmodule|whether the generated Go module is a submodule| |false| |packageName|Go package name (convention: lowercase).| |openapi| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 1c83fce3874..12bc9a24ae9 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -39,6 +39,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index a46b87970da..1c7efa14ec8 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -55,6 +55,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index 484df2e5115..7f60cf91dbd 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -38,8 +38,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| -|helidonVersion|Helidon version for generated code| |3.0.1| +|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index 3c2e448a913..2035bb8c6fb 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -37,16 +37,18 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |gradleProject|Whether to generate gradle project instead of maven.| |false| |groupId|groupId in generated pom.xml| |org.openapitools| -|helidonVersion|Helidon version for generated code| |3.0.1| +|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| |implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| |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.server| |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|
    **mp**
    Helidon MP Server
    **se**
    Helidon SE Server
    **nima**
    Helidon NIMA Server
    **nima-annotations**
    Helidon NIMA Annotations Server
    |se| +|library|library template (sub-template) to use|
    **mp**
    Helidon MP Server
    **se**
    Helidon SE Server
    |se| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.server.model| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 93bcc5e03d4..c97cc488b15 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index c83bce61bad..f8c968280ec 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -50,6 +50,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |false| |generateSwaggerAnnotations|Specify if you want to generate swagger annotations and which version|
    **swagger2**
    Use io.swagger.core.v3:swagger-annotations for annotating operations and schemas
    **true**
    Equivalent to "swagger2"
    **false**
    Do not generate swagger annotations
    **swagger1**
    Use io.swagger:swagger-annotations for annotating operations and schemas
    |false| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md index fce177a4697..9cb2ad4dbbc 100644 --- a/docs/generators/java-micronaut-server.md +++ b/docs/generators/java-micronaut-server.md @@ -45,6 +45,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false| |generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false| |generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |true| diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md new file mode 100644 index 00000000000..dada45f96d5 --- /dev/null +++ b/docs/generators/java-microprofile.md @@ -0,0 +1,365 @@ +--- +title: Documentation for the java-microprofile Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-microprofile | pass this to the generate command after -g | +| generator stability | STABLE | | +| generator type | SERVER | | +| generator language | Java | | +| generator default templating engine | mustache | | +| helpTxt | Generates a microprofile server. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|annotationLibrary|Select the complementary documentation annotation library.|
    **none**
    Do not annotate Model and Api with complementary annotations.
    **swagger1**
    Annotate Model and Api using the Swagger Annotations 1.x library.
    **swagger2**
    Annotate Model and Api using the Swagger Annotations 2.x library.
    |none| +|apiPackage|package for generated api classes| |org.openapitools.client.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |1.0.0| +|asyncNative|If true, async handlers will be used, instead of the sync version| |false| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| +|configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null| +|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null| +|containerDefaultToNull|Set containers (array, set, map) default to null| |false| +|dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| +|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    |source| +|dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null| +|generateBuilders|Whether to generate builders for models| |false| +|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| +|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|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|
    **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
    **restclient**
    HTTP client: Spring RestClient 6.1. 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| +|microprofileMutiny|Whether to use async types for microprofile (currently only Smallrye Mutiny is supported).| |null| +|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null| +|modelPackage|package for generated models| |org.openapitools.client.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| +|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|performBeanValidation|Perform BeanValidation| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serializationLibrary|Serialization library, default depends on value of the option library|
    **jsonb**
    Use JSON-B as serialization library
    **jackson**
    Use Jackson as serialization library
    **gson**
    Use Gson as serialization library
    |null| +|snapshotVersion|Uses a SNAPSHOT version.|
    **true**
    Use a SnapShot Version
    **false**
    Use a Release Version
    |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|supportStreaming|Support streaming endpoint (beta)| |false| +|supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false| +|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, restclient, 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 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, microprofile support this option.| |false| +|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false| +|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## SUPPORTED VENDOR EXTENSIONS + +| Extension name | Description | Applicable for | Default value | +| -------------- | ----------- | -------------- | ------------- | +|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL| +|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array +|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value +|x-tags|Specify multiple swagger tags for operation|OPERATION|null +|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null +|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-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono/Flux` or `return T/List/Set` & execute `.block()` inside generated method)|OPERATION|false + + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + +
      +
    • Boolean
    • +
    • Double
    • +
    • Float
    • +
    • Integer
    • +
    • Long
    • +
    • Object
    • +
    • String
    • +
    • boolean
    • +
    • byte[]
    • +
    + +## RESERVED WORDS + +
      +
    • _
    • +
    • abstract
    • +
    • apiclient
    • +
    • apiexception
    • +
    • apiresponse
    • +
    • assert
    • +
    • boolean
    • +
    • break
    • +
    • byte
    • +
    • case
    • +
    • catch
    • +
    • char
    • +
    • class
    • +
    • configuration
    • +
    • const
    • +
    • continue
    • +
    • default
    • +
    • do
    • +
    • double
    • +
    • else
    • +
    • enum
    • +
    • extends
    • +
    • file
    • +
    • final
    • +
    • finally
    • +
    • float
    • +
    • for
    • +
    • goto
    • +
    • if
    • +
    • implements
    • +
    • import
    • +
    • instanceof
    • +
    • int
    • +
    • interface
    • +
    • list
    • +
    • localdate
    • +
    • localreturntype
    • +
    • localtime
    • +
    • localvaraccept
    • +
    • localvaraccepts
    • +
    • localvarauthnames
    • +
    • localvarcollectionqueryparams
    • +
    • localvarcontenttype
    • +
    • localvarcontenttypes
    • +
    • localvarcookieparams
    • +
    • localvarformparams
    • +
    • localvarheaderparams
    • +
    • localvarpath
    • +
    • localvarpostbody
    • +
    • localvarqueryparams
    • +
    • long
    • +
    • native
    • +
    • new
    • +
    • null
    • +
    • object
    • +
    • offsetdatetime
    • +
    • package
    • +
    • private
    • +
    • protected
    • +
    • public
    • +
    • return
    • +
    • short
    • +
    • static
    • +
    • strictfp
    • +
    • stringutil
    • +
    • super
    • +
    • switch
    • +
    • synchronized
    • +
    • this
    • +
    • throw
    • +
    • throws
    • +
    • transient
    • +
    • try
    • +
    • void
    • +
    • volatile
    • +
    • while
    • +
    + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✓|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 +|SignatureAuth|✓|OAS3 +|AWSV4Signature|✓|ToolingExtension + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 624040df9be..52455c5fea1 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 20345fb4a23..6ecb576ac90 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| |eurekaUri|Eureka URI| |null| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |com.prokarma| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index c83e4827e31..bfdef88970f 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -44,6 +44,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 8556f93afc7..202f013209d 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index aa29fbbc514..3144df23e1a 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 08672146b4c..4592996516e 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md index 26cf0167653..081a1296745 100644 --- a/docs/generators/java-wiremock.md +++ b/docs/generators/java-wiremock.md @@ -11,7 +11,7 @@ title: Documentation for the java-wiremock Generator | generator type | SERVER | | | generator language | Java | | | generator default templating engine | mustache | | -| helpTxt | Generates Java Wiremock stubs, requests and responses samples. | | +| helpTxt | Generates Java WireMock stubs, requests and responses samples. | | ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index e08e5d2a6f6..028280b4562 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -34,6 +34,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| |configKey|Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.| |null| +|configKeyFromClassName|If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option.| |null| |containerDefaultToNull|Set containers (array, set, map) default to null| |false| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app only)
    **legacy**
    Legacy java.util.Date
    **java8-localdatetime**
    Java 8 using LocalDateTime (for legacy app only)
    **java8**
    Java 8 native JSR310 (preferred for jdk 1.8+)
    |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| @@ -47,8 +48,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| +|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null| +|generateBuilders|Whether to generate builders for models| |false| |generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |gradleProperties|Append additional Gradle properties to the gradle.properties file| |null| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| @@ -57,7 +60,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|
    **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
    **restclient**
    HTTP client: Spring RestClient 6.1. 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| @@ -83,7 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |supportStreaming|Support streaming endpoint (beta)| |false| |supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false| |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| +|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries| |false| |useBeanValidation|Use BeanValidation API annotations| |false| |useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false| |useGzipFeature|Send gzip-encoded requests| |false| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 82b1b863e73..f990de40ddb 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -41,7 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|generateBuilders|Whether to generate builders for models.| |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| @@ -78,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBeanValidation|Use BeanValidation API annotations| |true| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false| +|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |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| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 203688c5302..68d153daf20 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 08a0fe67750..f72c477c3b7 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| |generateOperationBody|Generate fully functional operation bodies| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 975ba1a0579..89caf27c7ad 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -42,6 +42,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| |generateSpringApplication|Generate Spring application| |false| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 1565d04f0d4..d3b30f001e4 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index ce8e83b6518..8645361f843 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index b7613483d24..af6e8c0aa2d 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -41,6 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 6572bfa7247..f1ff6d31bb6 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -41,7 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| -|generateBuilders|Whether to generate builders for models.| |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| @@ -78,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBeanValidation|Use BeanValidation API annotations| |true| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false| +|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |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| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/kotlin-wiremock.md b/docs/generators/kotlin-wiremock.md new file mode 100644 index 00000000000..c836ebc7f23 --- /dev/null +++ b/docs/generators/kotlin-wiremock.md @@ -0,0 +1,277 @@ +--- +title: Documentation for the kotlin-wiremock Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | kotlin-wiremock | pass this to the generate command after -g | +| generator stability | BETA | | +| generator type | SERVER | | +| generator language | Kotlin | | +| generator default templating engine | mustache | | +| helpTxt | Generates Kotlin WireMock stub request and response samples. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|apiSuffix|suffix for api classes| |Api| +|artifactId|Generated artifact id (name of jar).| |null| +|artifactVersion|Generated artifact's package version.| |1.0.0| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|modelMutable|Create mutable models| |false| +|packageName|Generated artifact package name.| |org.openapitools| +|parcelizeModels|toggle "@Parcelize" for generated models| |null| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|BigDecimal|java.math.BigDecimal| +|Date|java.time.LocalDate| +|DateTime|java.time.OffsetDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|kotlin.collections.ArrayList| +|list|kotlin.collections.ArrayList| +|map|kotlin.collections.HashMap| + + +## LANGUAGE PRIMITIVES + +
      +
    • kotlin.Array
    • +
    • kotlin.Boolean
    • +
    • kotlin.Byte
    • +
    • kotlin.ByteArray
    • +
    • kotlin.Char
    • +
    • kotlin.Double
    • +
    • kotlin.Float
    • +
    • kotlin.Int
    • +
    • kotlin.Long
    • +
    • kotlin.Short
    • +
    • kotlin.String
    • +
    • kotlin.collections.List
    • +
    • kotlin.collections.Map
    • +
    • kotlin.collections.MutableList
    • +
    • kotlin.collections.MutableMap
    • +
    • kotlin.collections.MutableSet
    • +
    • kotlin.collections.Set
    • +
    + +## RESERVED WORDS + +
      +
    • ApiResponse
    • +
    • abstract
    • +
    • actual
    • +
    • annotation
    • +
    • as
    • +
    • break
    • +
    • class
    • +
    • companion
    • +
    • const
    • +
    • constructor
    • +
    • continue
    • +
    • contract
    • +
    • crossinline
    • +
    • data
    • +
    • delegate
    • +
    • do
    • +
    • dynamic
    • +
    • else
    • +
    • enum
    • +
    • expect
    • +
    • external
    • +
    • false
    • +
    • field
    • +
    • final
    • +
    • finally
    • +
    • for
    • +
    • fun
    • +
    • if
    • +
    • import
    • +
    • in
    • +
    • infix
    • +
    • init
    • +
    • inline
    • +
    • inner
    • +
    • interface
    • +
    • internal
    • +
    • is
    • +
    • it
    • +
    • lateinit
    • +
    • noinline
    • +
    • null
    • +
    • object
    • +
    • open
    • +
    • operator
    • +
    • out
    • +
    • override
    • +
    • package
    • +
    • param
    • +
    • private
    • +
    • property
    • +
    • protected
    • +
    • public
    • +
    • receiver
    • +
    • reified
    • +
    • return
    • +
    • sealed
    • +
    • setparam
    • +
    • super
    • +
    • suspend
    • +
    • tailrec
    • +
    • this
    • +
    • throw
    • +
    • true
    • +
    • try
    • +
    • typealias
    • +
    • typeof
    • +
    • val
    • +
    • value
    • +
    • var
    • +
    • vararg
    • +
    • when
    • +
    • where
    • +
    • while
    • +
    + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✗|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✓|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 +|SignatureAuth|✗|OAS3 +|AWSV4Signature|✗|ToolingExtension + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/php-flight.md b/docs/generators/php-flight.md new file mode 100644 index 00000000000..8b7c90a069b --- /dev/null +++ b/docs/generators/php-flight.md @@ -0,0 +1,270 @@ +--- +title: Documentation for the php-flight Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | php-flight | pass this to the generate command after -g | +| generator stability | EXPERIMENTAL | | +| generator type | SERVER | | +| generator language | PHP | | +| generator default templating engine | mustache | | +| helpTxt | Generates a PHP Flight Framework server library. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |null| +|artifactUrl|artifact URL in generated pom.xml| |null| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|composerPackageName|The name to use in the composer package name field. e.g. `vendor/project` (must be lowercase and consist of words separated by `-`, `.` or `_`).| |null| +|developerOrganization|developer organization in generated pom.xml| |null| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |null| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| +|licenseName|The name of the license| |null| +|modelPackage|package for generated models| |null| +|packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|srcBasePath|The directory to serve as source root.| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|array| +|map|array| + + +## LANGUAGE PRIMITIVES + +
      +
    • \DateTime
    • +
    • \SplFileObject
    • +
    • array
    • +
    • bool
    • +
    • boolean
    • +
    • byte
    • +
    • float
    • +
    • int
    • +
    • integer
    • +
    • mixed
    • +
    • number
    • +
    • object
    • +
    • string
    • +
    • void
    • +
    + +## RESERVED WORDS + +
      +
    • __halt_compiler
    • +
    • _header_accept
    • +
    • _tempbody
    • +
    • abstract
    • +
    • and
    • +
    • array
    • +
    • as
    • +
    • break
    • +
    • callable
    • +
    • case
    • +
    • catch
    • +
    • class
    • +
    • clone
    • +
    • const
    • +
    • continue
    • +
    • declare
    • +
    • default
    • +
    • die
    • +
    • do
    • +
    • echo
    • +
    • else
    • +
    • elseif
    • +
    • empty
    • +
    • enddeclare
    • +
    • endfor
    • +
    • endforeach
    • +
    • endif
    • +
    • endswitch
    • +
    • endwhile
    • +
    • eval
    • +
    • exit
    • +
    • extends
    • +
    • final
    • +
    • for
    • +
    • foreach
    • +
    • formparams
    • +
    • function
    • +
    • global
    • +
    • goto
    • +
    • headerparams
    • +
    • httpbody
    • +
    • if
    • +
    • implements
    • +
    • include
    • +
    • include_once
    • +
    • instanceof
    • +
    • insteadof
    • +
    • interface
    • +
    • isset
    • +
    • list
    • +
    • namespace
    • +
    • new
    • +
    • or
    • +
    • print
    • +
    • private
    • +
    • protected
    • +
    • public
    • +
    • queryparams
    • +
    • require
    • +
    • require_once
    • +
    • resourcepath
    • +
    • return
    • +
    • static
    • +
    • switch
    • +
    • throw
    • +
    • trait
    • +
    • try
    • +
    • unset
    • +
    • use
    • +
    • var
    • +
    • while
    • +
    • xor
    • +
    + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✗|ToolingExtension +|MapOfModel|✗|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✗|ToolingExtension +|MapOfCollectionOfEnum|✗|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✗|OAS2 +|FormMultipart|✗|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 +|SignatureAuth|✗|OAS3 +|AWSV4Signature|✗|ToolingExtension + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/php.md b/docs/generators/php.md index 05b9bd48887..b3997fb00d7 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -219,7 +219,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ExternalDocumentation|✓|OAS2,OAS3 |Examples|✓|OAS2,OAS3 |XMLStructureDefinitions|✗|OAS2,OAS3 -|MultiServer|✗|OAS3 +|MultiServer|✓|OAS3 |ParameterizedServer|✗|OAS3 |ParameterStyling|✗|OAS3 |Callbacks|✗|OAS3 diff --git a/docs/generators/scala-cask.md b/docs/generators/scala-cask.md index d187ba56939..802870eef7b 100644 --- a/docs/generators/scala-cask.md +++ b/docs/generators/scala-cask.md @@ -21,6 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (preferred for JDK 1.8+)
    |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 9e426fb0f04..6ae3b647ac6 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -48,6 +48,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |documentationProvider|Select the OpenAPI documentation provider.|
    **none**
    Do not publish an OpenAPI specification.
    **source**
    Publish the original input OpenAPI specification.
    **springfox**
    Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.
    **springdoc**
    Generate an OpenAPI 3 specification using SpringDoc.
    |springdoc| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|generateBuilders|Whether to generate builders for models| |false| +|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false| |generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 20a758ccf3f..63a97cf5360 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |enumPropertyNamingReplaceSpecialChar|Set to true to replace '-' and '+' symbols with 'minus_' and 'plus_' in enum of type string| |false| |enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
    **false**
    No changes to the enum's are made, this is the default option.
    **true**
    With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
    |false| +|fileNaming|Naming convention for the output files: 'PascalCase', 'camelCase', 'kebab-case'.| |PascalCase| |importFileExtension|File extension to use with relative imports. Set it to '.js' or '.mjs' when using [ESM](https://nodejs.org/api/esm.html).| || |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| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index 9788a613971..11748efb4ec 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |stringEnums|Generate string enums instead of objects for enum values.| |false| |supportsES6|Generate code that conforms to ES6.| |false| |taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |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.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING diff --git a/docs/global-properties.md b/docs/global-properties.md index 1fe76f58013..445b7f21ce5 100644 --- a/docs/global-properties.md +++ b/docs/global-properties.md @@ -5,23 +5,22 @@ title: Global Properties ## Available Global Properties -| Property | Description | Acceptable value | -| -------- | ------------| ---------------- | -| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none | -| debugModels | Dumps JSON formatted template-bound model information during generation | none | -| debugOperations | Dumps JSON formatted template-bound operation information during generation | none | -| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none | -| verbose | Defines the verbosity | `true` or `false` | -| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` | -| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` | -| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names | -| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names | -| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names | -| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | -| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | -| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | -| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | -| withXml | Allows the user to control support of XML generated constructs, where supported | none | +| Property | Description | Acceptable value | +|---------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------| +| debugOpenAPI | Dumps JSON formatted and fully parsed OpenAPI document during generation | none | +| debugModels | Dumps JSON formatted template-bound model information during generation | none | +| debugOperations | Dumps JSON formatted template-bound operation information during generation | none | +| debugSupportingFiles | Dumps JSON formatted Supporting File information during generation | none | +| verbose | Defines the verbosity | `true` or `false` | +| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` | +| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` | +| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names | +| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names | +| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names | +| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | +| modelTests | Allows the user to define if model tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` | ## Note on Global Property declaration diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 00144d2dacc..804d41c4a69 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid [source,group] ---- plugins { - id "org.openapi.generator" version "7.2.0" + id "org.openapi.generator" version "7.5.0" } ---- @@ -389,11 +389,6 @@ apply plugin: 'org.openapi.generator' |true |Defines whether or not api-related _documentation_ files should be generated. -|withXml -|Boolean -|false -|A special-case setting which configures some generators with XML support. In some cases, this forces json OR xml, so the default here is false. - |configOptions |Map(String,String) |None @@ -545,9 +540,7 @@ openApiGenerate { apiPackage.set("org.openapi.example.api") invokerPackage.set("org.openapi.example.invoker") modelPackage.set("org.openapi.example.model") - configOptions.set([ - dateLibrary: "java8" - ]) + configOptions.put("dateLibrary", "java8") } ---- diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index f660266e856..90bf9dcc8d1 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -8,7 +8,7 @@ plugins { id("java-gradle-plugin") id("maven-publish") id("org.gradle.kotlin.kotlin-dsl") version "2.4.1" - id("org.jetbrains.kotlin.jvm") version "1.7.10" + id("org.jetbrains.kotlin.jvm") version "1.9.0" id("signing") } @@ -26,8 +26,8 @@ specifications as part of your build. Other tasks are available as command line java { withSourcesJar() withJavadocJar() - sourceCompatibility = 1.11 - targetCompatibility = 1.11 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } repositories { @@ -41,7 +41,7 @@ repositories { dependencies { implementation("org.openapitools:openapi-generator:$openApiGeneratorVersion") - testImplementation("org.jetbrains.kotlin:kotlin-test-testng:1.7.10") + testImplementation("org.jetbrains.kotlin:kotlin-test-testng:1.9.0") } tasks.named("test", Test).configure { @@ -63,7 +63,7 @@ tasks.named("test", Test).configure { tasks.withType(KotlinCompile).configureEach { kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" } } diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index c86ac39b259..5d82081e5ea 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,9 @@ # RELEASE_VERSION +<<<<<<< HEAD openApiGeneratorVersion=8.0.0-SNAPSHOT +======= +openApiGeneratorVersion=7.7.0-SNAPSHOT +>>>>>>> master # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties index f398c33c4b0..c7d437bbb47 100644 --- a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 9b6da7792d6..0ea4bf9bbfc 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -17,8 +17,8 @@ true - 7.6 - 7.3-20210825160000+0000 + 7.6.4 + 7.4.2 diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 6a4917a957a..40cc6251ebe 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,7 +1,11 @@ # RELEASE_VERSION <<<<<<< HEAD +<<<<<<< HEAD openApiGeneratorVersion=8.0.0-SNAPSHOT ======= openApiGeneratorVersion=7.5.0-SNAPSHOT >>>>>>> origin/master +======= +openApiGeneratorVersion=7.7.0-SNAPSHOT +>>>>>>> master # /RELEASE_VERSION diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties index 068cdb2dc26..3994438e229 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt index cf3552d38fb..46d6cfcc690 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt @@ -144,7 +144,6 @@ class OpenApiGeneratorPlugin : Plugin { generateModelDocumentation.set(generate.generateModelDocumentation) generateApiTests.set(generate.generateApiTests) generateApiDocumentation.set(generate.generateApiDocumentation) - withXml.set(generate.withXml) configOptions.set(generate.configOptions) logToStderr.set(generate.logToStderr) enablePostProcessFile.set(generate.enablePostProcessFile) diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt index 236453a8709..b80ffbcdd69 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt @@ -342,12 +342,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) { */ val generateApiDocumentation = project.objects.property() - /** - * A special-case setting which configures some generators with XML support. In some cases, - * this forces json OR xml, so the default here is false. - */ - val withXml = project.objects.property() - /** * To write all log messages (not just errors) to STDOUT */ @@ -408,7 +402,6 @@ open class OpenApiGeneratorGenerateExtension(project: Project) { generateModelDocumentation.set(true) generateApiTests.set(true) generateApiDocumentation.set(true) - withXml.set(false) configOptions.set(mapOf()) validateSpec.set(true) logToStderr.set(false) diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt index d9473159a87..193cdbed15d 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt @@ -506,14 +506,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac @Input val generateApiDocumentation = project.objects.property() - /** - * A special-case setting which configures some generators with XML support. In some cases, - * this forces json OR xml, so the default here is false. - */ - @Optional - @Input - val withXml = project.objects.property() - /** * To write all log messages (not just errors) to STDOUT */ @@ -680,10 +672,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.get().toString()) } - if (withXml.isPresent) { - GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.get().toString()) - } - if (inputSpec.isPresent && remoteInputSpec.isPresent) { logger.warn("Both inputSpec and remoteInputSpec is specified. The remoteInputSpec will take priority over inputSpec.") } diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt index b1636e2b0ae..b9ec75eb429 100644 --- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskConfigurationCacheTest.kt @@ -20,7 +20,7 @@ class GenerateTaskConfigurationCacheTest : TestBase() { } @DataProvider(name = "gradle_version_provider") - private fun gradleVersionProviderWithConfigurationCache(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6")) + private fun gradleVersionProviderWithConfigurationCache(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4")) @DataProvider(name = "gradle_version_provider_without_cc") private fun gradleVersionProviderWithoutConfigurationCache(): Array> = arrayOf(arrayOf("5.6.1")) diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt index 9f73e0e388a..e66f6264578 100644 --- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskFromCacheTest.kt @@ -22,7 +22,7 @@ class GenerateTaskFromCacheTest : TestBase() { } @DataProvider(name = "gradle_version_provider") - private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6")) + private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4")) // inputSpec tests diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt index 7cfe81fd276..f8932c6bcc4 100644 --- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskUpToDateTest.kt @@ -9,7 +9,7 @@ import kotlin.test.assertEquals class GenerateTaskUpToDateTest : TestBase() { @DataProvider(name = "gradle_version_provider") - private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.1.1"), arrayOf("7.6")) + private fun gradleVersionProvider(): Array> = arrayOf(arrayOf("8.7"), arrayOf("7.6.4")) // inputSpec tests diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt index aa80ed587f8..c6687bd69a0 100644 --- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt +++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt @@ -17,8 +17,8 @@ class ValidateTaskDslTest : TestBase() { @DataProvider(name = "gradle_version_provider") fun gradleVersionProvider(): Array> = arrayOf( arrayOf(null), // uses the version of Gradle used to build the plugin itself - arrayOf("8.1.1"), - arrayOf("7.6") + arrayOf("8.7"), + arrayOf("7.6.4") ) private fun getGradleRunner(gradleVersion: String?): GradleRunner { diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 1700662a76e..a3d45bd2c38 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 7.2.0 + 7.5.0 @@ -107,7 +107,6 @@ mvn clean compile | `generateModelDocumentation` | `openapi.generator.maven.plugin.generateModelDocumentation` | generate the model documentation (`true` by default. Only available if `generateModels` is `true`) | `generateApiTests` | `openapi.generator.maven.plugin.generateApiTests` | generate the api tests (`true` by default. Only available if `generateApis` is `true`) | `generateApiDocumentation` | `openapi.generator.maven.plugin.generateApiDocumentation` | generate the api documentation (`true` by default. Only available if `generateApis` is `true`) -| `withXml` | `openapi.generator.maven.plugin.withXml` | enable XML annotations inside the generated models and API (only works with Java `language` and libraries that provide support for JSON and XML) | `skip` | `codegen.skip` | skip code generation (`false` by default. Can also be set globally through the `codegen.skip` property) | `skipIfSpecIsUnchanged` | `codegen.skipIfSpecIsUnchanged` | Skip the execution if the source file is older than the output folder (`false` by default. Can also be set globally through the `codegen.skipIfSpecIsUnchanged` property) | `addCompileSourceRoot` | `openapi.generator.maven.plugin.addCompileSourceRoot` | Add the output directory to the project as a source root, so that the generated java types are compiled and included in the project artifact (`true` by default). Mutually exclusive with `addTestCompileSourceRoot`. diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index e30070b073d..8f4ef4b1dd5 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -70,6 +70,30 @@ true + + jar + + generate + + + + jar:file:${project.basedir}/../src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar!/petstore.yaml + + + java + + + + + + joda + + + + jersey2 + + diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml index fdc0d5272e0..ab59209425d 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml @@ -19,7 +19,7 @@ 0.2.1 2.7 1.0.0 - 4.13.2 + 5.10.2 1.4 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index f1f1f46f161..c965b34320b 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,11 +13,7 @@ org.openapitools openapi-generator-maven-plugin -<<<<<<< HEAD 8.0.0-SNAPSHOT -======= - 7.5.0-SNAPSHOT ->>>>>>> origin/master diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 09b4d0f4236..83773ed26bf 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -16,7 +16,7 @@ UTF-8 **/src/main/java/org/openapitools/codegen/plugin/**/* - + 3.9.6 @@ -27,25 +27,25 @@ org.apache.maven maven-core - 3.9.4 + ${maven.version} provided org.apache.maven maven-artifact - 3.9.4 + ${maven.version} provided org.apache.maven maven-compat - 3.9.4 + ${maven.version} test org.apache.maven maven-plugin-api - 3.9.4 + ${maven.version} provided @@ -59,11 +59,17 @@ ${project.version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit.version} test + + org.apache.maven + maven-resolver-provider + ${maven.version} + test + org.apache.maven.shared maven-verifier diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 6c3b717189b..372b9aeb47e 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -32,6 +32,7 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.net.URLClassLoader; import java.net.URLConnection; import java.nio.channels.Channels; import java.nio.channels.FileChannel; @@ -39,6 +40,7 @@ import java.nio.channels.ReadableByteChannel; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -50,14 +52,17 @@ import com.google.common.io.CharSource; import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.ClasspathHelper; import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; @@ -82,7 +87,7 @@ import com.google.common.io.Files; * Goal which generates client/server code from a OpenAPI json/yaml definition. */ @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) -@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) +@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) public class CodeGenMojo extends AbstractMojo { private final Logger LOGGER = LoggerFactory.getLogger(CodeGenMojo.class); @@ -443,6 +448,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "generateModels", property = "openapi.generator.maven.plugin.generateModels") private Boolean generateModels = true; + /** + * Generate the models recursively if models should generate selectively (see modelsToGenerate) and all dependent models are to generate + */ + @Parameter(name = "generateRecursiveDependentModels", property = "openapi.generator.maven.plugin.generateRecursiveDependentModels") + private Boolean generateRecursiveDependentModels = false; + /** * A comma separated list of models to generate. All models is the default. */ @@ -485,12 +496,6 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "generateApiDocumentation", property = "openapi.generator.maven.plugin.generateApiDocumentation") private Boolean generateApiDocumentation = true; - /** - * Generate the api documentation - */ - @Parameter(name = "withXml", property = "openapi.generator.maven.plugin.withXml") - private Boolean withXml = false; - /** * Skip the execution. */ @@ -656,7 +661,13 @@ public class CodeGenMojo extends AbstractMojo { } if (isNotEmpty(inputSpec)) { - configurator.setInputSpec(inputSpec); + URL url = inputSpecRemoteUrl(); + + if ((! inputSpecFile.exists()) && url != null) { + configurator.setInputSpec(url.toString()); + } else { + configurator.setInputSpec(inputSpec); + } } if (isNotEmpty(gitHost)) { @@ -794,7 +805,7 @@ public class CodeGenMojo extends AbstractMojo { GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString()); GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString()); GlobalSettings.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString()); - GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString()); + GlobalSettings.setProperty(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, generateRecursiveDependentModels.toString()); if (configOptions != null) { // Retained for backwards-compatibility with configOptions -> instantiation-types @@ -1068,15 +1079,35 @@ public class CodeGenMojo extends AbstractMojo { } /** - * Try to parse inputSpec setting string into URL + * Try to parse inputSpec setting string into URL (truly remote or resource) * @return A valid URL or null if inputSpec is not a valid URL */ - private URL inputSpecRemoteUrl(){ - try { - return new URI(inputSpec).toURL(); - } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) { - return null; + private URL inputSpecRemoteUrl() { + URL url = dependencyClassLoader().getResource(inputSpec); + + if (url == null) { + try { + url = new URI(FilenameUtils.separatorsToUnix(inputSpec)).toURL(); + } catch (URISyntaxException | MalformedURLException | IllegalArgumentException e) { + } } + + return url; + } + + private ClassLoader dependencyClassLoader() { + List list = new ArrayList<>(); + + for (Artifact artifact : project.getArtifacts()) { + try { + if (artifact.isResolved() && artifact.getType().equals("jar")) { + list.add(new URL("jar:" + artifact.getFile().toURI() + "!/")); + } + } catch (Exception e) { + } + } + + return new URLClassLoader(list.toArray(new URL[] { }), getClass().getClassLoader()); } /** @@ -1089,7 +1120,7 @@ public class CodeGenMojo extends AbstractMojo { String name = inputSpecFile.getName(); URL url = inputSpecRemoteUrl(); - if (url != null) { + if (inputSpecFile.exists() && url != null) { String[] segments = url.getPath().split("/"); name = Files.getNameWithoutExtension(segments[segments.length - 1]); } diff --git a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java index 4881db21921..d39da0d8a62 100644 --- a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java +++ b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java @@ -16,7 +16,7 @@ package org.openapitools.codegen.plugin; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.File; import java.nio.file.Files; @@ -37,7 +37,12 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.repository.internal.MavenRepositorySystemUtils; import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.impl.DefaultServiceLocator; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; +import org.eclipse.aether.RepositorySystem; public class CodeGenMojoTest extends BaseTestCase { @Override @@ -45,10 +50,22 @@ public class CodeGenMojoTest extends BaseTestCase { super.setUp(); } + public void testCommonConfigurationWithFileInputSpec() throws Exception { + testCommonConfiguration("file"); + } + + public void testCommonConfigurationWithResourceInputSpec() throws Exception { + testCommonConfiguration("resource"); + } + + public void testCommonConfigurationWithURLInputSpec() throws Exception { + testCommonConfiguration("url"); + } + @SuppressWarnings("unchecked") - public void testCommonConfiguration() throws Exception { + private void testCommonConfiguration(String profile) throws Exception { File folder = Files.createTempDirectory("test").toFile(); - CodeGenMojo mojo = loadMojo(folder, "src/test/resources/default"); + CodeGenMojo mojo = loadMojo(folder, "src/test/resources/default", profile); mojo.execute(); assertEquals("java", getVariableValueFromObject(mojo, "generatorName")); assertEquals("jersey2", getVariableValueFromObject(mojo, "library")); @@ -65,7 +82,7 @@ public class CodeGenMojoTest extends BaseTestCase { public void testHashGenerationFileContainsExecutionId() throws Exception { // GIVEN Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId"); + CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); @@ -86,7 +103,7 @@ public class CodeGenMojoTest extends BaseTestCase { //GIVEN /* Setup the mojo */ final Path folder = Files.createTempDirectory("test-classpath"); - final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId"); + final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId"); /* Perform an initial generation */ mojo.execute(); @@ -124,7 +141,7 @@ public class CodeGenMojoTest extends BaseTestCase { //GIVEN /* Setup the mojo */ final Path folder = Files.createTempDirectory("test-classpath"); - final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId"); + final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", null, "executionId"); /* Perform an initial generation */ mojo.execute(); @@ -159,7 +176,7 @@ public class CodeGenMojoTest extends BaseTestCase { public void testCollapsedSpecProduced() throws Exception { // GIVEN Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId"); + CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); @@ -172,7 +189,7 @@ public class CodeGenMojoTest extends BaseTestCase { public void testCollapsedSpecAddedToArtifacts() throws Exception { // GIVEN Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId"); + CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); // WHEN mojo.execute(); @@ -187,7 +204,7 @@ public class CodeGenMojoTest extends BaseTestCase { public void testAnyInputSpecMustBeProvided() throws Exception { // GIVEN Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId"); + CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); mojo.inputSpec = null; mojo.inputSpecRootDirectory = null; @@ -201,7 +218,7 @@ public class CodeGenMojoTest extends BaseTestCase { public void testInputSpecRootDirectoryDoesNotRequireInputSpec() throws Exception { // GIVEN Path folder = Files.createTempDirectory("test"); - CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "executionId"); + CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/default", "file", "executionId"); mojo.inputSpec = null; mojo.inputSpecRootDirectory = "src/test/resources/default"; @@ -214,14 +231,14 @@ public class CodeGenMojoTest extends BaseTestCase { assertTrue(hashFolder.resolve("_merged_spec.yaml-executionId.sha256").toFile().exists()); } - protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot) throws Exception { - return loadMojo(temporaryFolder, projectRoot, "default"); + protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile) throws Exception { + return loadMojo(temporaryFolder, projectRoot, profile, "default"); } - protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String executionId) throws Exception { + protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot, String profile, String executionId) throws Exception { File file = new File(projectRoot); FileUtils.copyDirectory(file, temporaryFolder); - MavenProject project = readMavenProject(temporaryFolder); + MavenProject project = readMavenProject(temporaryFolder, profile); MavenSession session = newMavenSession(project); MojoExecution execution = newMojoExecution("generate"); MojoExecution executionWithId = copyWithExecutionId(executionId, execution); @@ -234,15 +251,22 @@ public class CodeGenMojoTest extends BaseTestCase { return executionWithId; } - protected MavenProject readMavenProject(File basedir) + protected MavenProject readMavenProject(File basedir, String profile) throws Exception { File pom = new File(basedir, "pom.xml"); + LocalRepository localRepo = new LocalRepository(new File(basedir, "local-repo")); + DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); + session.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory().newInstance(session, localRepo)); MavenExecutionRequest request = new DefaultMavenExecutionRequest(); request.setBaseDirectory(basedir); + if (profile != null) { + request.addActiveProfile(profile); + } ProjectBuildingRequest configuration = request.getProjectBuildingRequest(); - configuration.setRepositorySession(new DefaultRepositorySystemSession()); + configuration.setRepositorySession(session); + configuration.setResolveDependencies(true); MavenProject project = lookup(ProjectBuilder.class).build(pom, configuration).getProject(); assertNotNull(project); return project; } -} \ No newline at end of file +} diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar new file mode 100644 index 00000000000..5b4d1c0860f Binary files /dev/null and b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.jar differ diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom new file mode 100644 index 00000000000..bd1c51309d9 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/1/schema-1.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + petstore + schema + 1 + POM was created from install:install-file + diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml new file mode 100644 index 00000000000..d66c798366f --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/local-repo/petstore/schema/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + petstore + schema + + 1 + + 1 + + 20210724220722 + + diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml b/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml index a2b3a7b26f6..67a74ce3745 100644 --- a/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml +++ b/modules/openapi-generator-maven-plugin/src/test/resources/default/pom.xml @@ -1,5 +1,5 @@ - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{#useBeanValidation}} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + {{/useBeanValidation}} {{#performBeanValidation}} - - - org.hibernate - hibernate-validator - 5.4.3.Final - + + + org.hibernate + hibernate-validator + 5.4.3.Final + {{/performBeanValidation}} {{#parcelableModel}} - - - com.google.android - android - 4.1.1.4 - provided - + + + com.google.android + android + 4.1.1.4 + provided + {{/parcelableModel}} {{#openApiNullable}} @@ -337,8 +336,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -366,6 +365,6 @@ {{#useBeanValidation}} 3.0.2 {{/useBeanValidation}} - 4.13.2 + 5.10.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache index dbd86f35b4e..af05d6595fb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache @@ -14,6 +14,11 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import feign.*; {{>generatedAnnotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache index de27c161011..1db841158dc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache @@ -13,6 +13,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache index 108748f607e..5fa9bca806e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model.mustache @@ -59,8 +59,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 6450f5a2718..a1d8ecc3ae5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -336,6 +336,15 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} @@ -398,6 +407,9 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} 5.10.0 1.0.0 8.3.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache index f4bac8ac543..bfb939f9552 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache @@ -4,8 +4,8 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -18,12 +18,12 @@ import java.util.Map; /** * API tests for {{classname}} */ -@Ignore public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** * {{summary}} * @@ -37,9 +37,12 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // uncomment below to test the API function + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } - {{/operation}}{{/operations}} + + {{/operation}} + {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index 8444791d7d4..0bbe3ae5143 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -63,7 +63,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -73,7 +73,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -295,8 +294,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -326,6 +325,6 @@ 1.3.5 {{/useJakartaEe}} 1.0.0 - 4.13.2 + 5.10.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index a9ba62f69eb..dd91399c573 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -12,8 +12,8 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{/imports}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} import java.util.ArrayList; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache index fc4ecf4d470..7b8214bd48a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache @@ -16,6 +16,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache index 2758278acee..1904ee40ea4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache @@ -42,8 +42,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache index a9ba62f69eb..dd91399c573 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache @@ -12,8 +12,8 @@ import {{javaxPackage}}.ws.rs.core.GenericType; {{/imports}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} import java.util.ArrayList; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache index fc4ecf4d470..7b8214bd48a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache @@ -16,6 +16,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache index 2758278acee..1904ee40ea4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache @@ -42,8 +42,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache index 58d2d5f5c18..377dfc2c910 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache @@ -1,10 +1,19 @@ -# {{appName}} - MicroProfile Rest Client +# {{appName}} - MicroProfile Rest Client & MicroProfile Server {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^microprofileServer}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. +{{/microprofileServer}} + +{{#microprofileServer}} +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +The generated server contains an interface which acts as the server, you can inject it into the controller class. +This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified. +{{/microprofileServer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache index 91eab8c6e0b..6e25c1f1012 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache @@ -38,7 +38,9 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; */ {{/appName}} -@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}} +{{^microprofileServer}} +@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}}{{#configKeyFromClassName}}{{#operations}}(configKey="{{configKey}}"){{/operations}}{{/configKeyFromClassName}} +{{/microprofileServer}} @RegisterProvider(ApiExceptionMapper.class) @Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}") public interface {{classname}} { @@ -70,7 +72,7 @@ public interface {{classname}} { @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} {{^useSingleRequestParameter}} - {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; + {{^vendorExtensions.x-java-is-response-void}}{{#microprofileServer}}{{> server_operation}}{{/microprofileServer}}{{^microprofileServer}}{{> client_operation}}{{/microprofileServer}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} {{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}}{{#vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}void{{/microprofileMutiny}}{{/vendorExtensions.x-java-is-response-void}} {{nickname}}({{#hasNonBodyParams}}@BeanParam {{operationIdCamelCase}}Request request{{/hasNonBodyParams}}{{#bodyParams}}{{#hasNonBodyParams}}, {{/hasNonBodyParams}}{{>bodyParams}}{{/bodyParams}}) throws ApiException, ProcessingException; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache index a6567c3eba0..d9af87719b4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache @@ -4,9 +4,13 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +{{#generateSpringBootApplication}} +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.test.context.junit.jupiter.SpringExtension; +{{/generateSpringBootApplication}} import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -26,7 +30,7 @@ import java.util.Set; * API tests for {{classname}} */ {{#generateSpringBootApplication}} -@RunWith(SpringJUnit4ClassRunner.class) +@ExtendWith(SpringExtension.class) @SpringApplicationConfiguration(classes = SpringBootApplication.class) @WebAppConfiguration @IntegrationTest("server.port=0") @@ -36,7 +40,7 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { {{#microprofile3}} // TODO initialize the client @@ -69,7 +73,7 @@ public class {{classname}}Test { {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} //{{^vendorExtensions.x-java-is-response-void}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - //{{#returnType}}assertNotNull(response);{{/returnType}} + //{{#returnType}}Assertions.assertNotNull(response);{{/returnType}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache new file mode 100644 index 00000000000..403918ddc70 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/client_operation.mustache @@ -0,0 +1 @@ +{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache index ac235b7edf5..195aa9d4454 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/kumuluzee.pom.mustache @@ -18,7 +18,7 @@ 1.2.3 1.4.1 3.2.6 - 4.13 + 5.10.2 2.28 @@ -70,8 +70,8 @@ ${cxf-rt-rs-extension-providers.version} - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index 5b0f260635d..870bf32c1ca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -62,7 +62,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} - {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nillable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(value = JSON_PROPERTY_{{nameInSnakeCase}}{{#required}}, required = true{{/required}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} {{/readOnlyVars}} ) { {{#readOnlyVars}} @@ -170,4 +170,4 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } return o.toString().replace("\n", "\n "); } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index c91673c896c..47aa6b9e234 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -58,9 +58,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -212,7 +212,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 {{#useBeanValidation}} 3.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache index 038b0e28a23..3cda34fa7ec 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache @@ -58,9 +58,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -205,7 +205,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 {{#useBeanValidation}} 3.0.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache new file mode 100644 index 00000000000..d6fa9054d4d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/server_operation.mustache @@ -0,0 +1 @@ +{{#vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni{{/microprofileMutiny}}{{^microprofileMutiny}}Response{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}}{{^vendorExtensions.x-multiple-2xx-response-operation}}{{#microprofileMutiny}}Uni<{{{returnType}}}>{{/microprofileMutiny}}{{^microprofileMutiny}}{{{returnType}}}{{/microprofileMutiny}}{{/vendorExtensions.x-multiple-2xx-response-operation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 7255bd4cf5f..a80dcbac8d6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -14,8 +14,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + {{/useBeanValidation}} {{#hasFormParamsInSpec}} import org.apache.http.HttpEntity; @@ -371,7 +372,10 @@ public class {{classname}} { } {{/isArray}} {{^isArray}} - localVarQueryStringJoiner.add({{paramName}}.toUrlQueryString("{{baseName}}")); + String queryString = {{paramName}}.toUrlQueryString("{{baseName}}"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } {{/isArray}} } {{/isDeepObject}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache index dc56ce78474..497bd5308d4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_test.mustache @@ -5,8 +5,8 @@ package {{package}}; import {{invokerPackage}}.ApiException; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -18,10 +18,15 @@ import java.util.Set; import java.util.concurrent.CompletableFuture; {{/asyncNative}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index f0a051ee90c..b706f454f4a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -74,7 +74,7 @@ ext { {{/swagger2AnnotationLibrary}} jackson_version = "2.14.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" + junit_version = "5.10.2" {{#hasFormParamsInSpec}} httpmime_version = "4.5.13" {{/hasFormParamsInSpec}} @@ -97,7 +97,7 @@ dependencies { {{#hasFormParamsInSpec}} implementation "org.apache.httpcomponents:httpmime:$httpmime_version" {{/hasFormParamsInSpec}} - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache index b3beca8d327..cd2a85a2226 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache @@ -47,8 +47,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index c440057eb76..15bd2f96d24 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -593,4 +593,8 @@ static { JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings); } {{/discriminator}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index a8be8d1ed99..4f8cebb65a7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -64,7 +64,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.2.5 conf/log4j.properties @@ -255,6 +255,15 @@ ${jakarta-annotation-version} provided + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} {{#hasFormParamsInSpec}} org.apache.httpcomponents @@ -265,8 +274,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -290,10 +299,13 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} {{#hasFormParamsInSpec}} 4.5.14 {{/hasFormParamsInSpec}} - 4.13.2 + 5.10.2 2.27.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache index 33d93192d4c..18447fc12d0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/anyof_model.mustache @@ -54,8 +54,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isArray}} {{#isArray}} - final Type typeInstance = new TypeToken<{{{dataType}}}>(){}.getType(); - final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance)); + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); {{/isArray}} {{/anyOf}} {{/composedSchemas}} @@ -210,13 +210,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); } - {{#anyOf}} - public {{classname}}({{{.}}} o) { + public {{classname}}(Object o) { super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } - {{/anyOf}} static { {{#composedSchemas}} {{#anyOf}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index fe08469b577..8549641079c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -26,8 +26,8 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.io.IOException; {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import {{javaxPackage}}.validation.ConstraintViolation; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache index bf1ac11aa48..29f682678b5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache @@ -16,6 +16,11 @@ import java.util.Map; import java.io.InputStream; {{/supportStreaming}} +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 71dbcc85300..859d322d08e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -135,9 +135,9 @@ dependencies { implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' {{/dynamicOperations}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 05ec20bff2c..68d9e7fc8ef 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -35,7 +35,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache index 3a1cca8d7d4..c82b0fbe2ac 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/model.mustache @@ -21,8 +21,8 @@ import android.os.Parcelable; import android.os.Parcel; {{/parcelableModel}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} {{#performBeanValidation}} import org.hibernate.validator.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache index 4a34934dce7..31c63263e1c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/oneof_model.mustache @@ -48,15 +48,21 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#composedSchemas}} {{#oneOf}} {{^isArray}} + {{^isMap}} {{^vendorExtensions.x-duplicated-data-type}} final TypeAdapter<{{{dataType}}}> adapter{{{dataType}}} = gson.getDelegateAdapter(this, TypeToken.get({{{dataType}}}.class)); {{/vendorExtensions.x-duplicated-data-type}} + {{/isMap}} {{/isArray}} {{#isArray}} - final Type typeInstance = new TypeToken<{{{dataType}}}>(){}.getType(); - final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance)); + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); {{/isArray}} + {{#isMap}} + final Type typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = new TypeToken<{{{dataType}}}>(){}.getType(); + final TypeAdapter<{{{dataType}}}> adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}} = (TypeAdapter<{{{dataType}}}>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}})); + {{/isMap}} {{/oneOf}} {{/composedSchemas}} @@ -72,11 +78,18 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} // check if the actual instance is of the type `{{{dataType}}}` - if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + if (value.getActualInstance() instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { {{#isPrimitiveType}} + {{^isMap}} JsonPrimitive primitive = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonPrimitive(); elementAdapter.write(out, primitive); return; + {{/isMap}} + {{#isMap}} + JsonObject object = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}.toJsonTree(({{{dataType}}})value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, object); + return; + {{/isMap}} {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isArray}} @@ -88,6 +101,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/isArray}} {{/isPrimitiveType}} + {{^isMap}} {{^isArray}} {{^isPrimitiveType}} JsonElement element = adapter{{{dataType}}}.toJsonTree(({{{dataType}}})value.getActualInstance()); @@ -95,6 +109,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return; {{/isPrimitiveType}} {{/isArray}} + {{/isMap}} } {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} @@ -143,6 +158,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im try { // validate the JSON object to see if any exception is thrown {{^isArray}} + {{^isMap}} {{#isNumber}} if (!jsonElement.getAsJsonPrimitive().isNumber()) { throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); @@ -163,6 +179,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; {{/isPrimitiveType}} {{/isNumber}} + {{/isMap}} {{/isArray}} {{#isArray}} if (!jsonElement.isJsonArray()) { @@ -194,6 +211,38 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + actualAdapter = adapter{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}; + {{/isMap}} match++; log.log(Level.FINER, "Input data matches schema '{{{dataType}}}'"); } catch (Exception e) { @@ -239,13 +288,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); } - {{#oneOf}} - public {{classname}}({{{.}}} o) { + public {{classname}}(Object o) { super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); setActualInstance(o); } - {{/oneOf}} static { {{#composedSchemas}} {{#oneOf}} @@ -280,7 +327,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#composedSchemas}} {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if (instance instanceof {{#isArray}}List{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}) { + if (instance instanceof {{#isArray}}List{{/isArray}}{{#isMap}}Map{{/isMap}}{{^isMap}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isMap}}) { {{#isArray}} List list = (List) instance; if (list.get(0) instanceof {{{items.dataType}}}) { @@ -322,7 +369,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im * @return The actual instance of `{{{dataType}}}` * @throws ClassCastException if the instance is not `{{{dataType}}}` */ - public {{{dataType}}} get{{#isArray}}{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}{{/isArray}}{{^isArray}}{{{dataType}}}{{/isArray}}() throws ClassCastException { + public {{{dataType}}} get{{#sanitizeGeneric}}{{{dataType}}}{{/sanitizeGeneric}}() throws ClassCastException { return ({{{dataType}}})super.getActualInstance(); } {{/vendorExtensions.x-duplicated-data-type}} @@ -345,6 +392,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im // validate the json string with {{{dataType}}} try { {{^hasVars}} + {{^isMap}} {{^isArray}} {{#isNumber}} if (!jsonElement.getAsJsonPrimitive().isNumber()) { @@ -364,6 +412,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/isPrimitiveType}} {{/isNumber}} {{/isArray}} + {{/isMap}} {{#isArray}} if (!jsonElement.isJsonArray()) { throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); @@ -392,6 +441,37 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/items}} } {{/isArray}} + {{#isMap}} + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + {{^isFreeFormObject}} + Map map = jsonElement.getAsJsonObject().asMap(); + // validate map items + for(JsonElement element : map.values()) { + {{#items}} + {{#isNumber}} + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isNumber}} + {{^isNumber}} + {{#isPrimitiveType}} + if (!element.getAsJsonPrimitive().is{{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}}()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type {{#isBoolean}}Boolean{{/isBoolean}}{{#isString}}String{{/isString}}{{^isString}}{{^isBoolean}}Number{{/isBoolean}}{{/isString}} in the JSON string but got `%s`", jsonElement.toString())); + } + {{/isPrimitiveType}} + {{/isNumber}} + {{^isNumber}} + {{^isPrimitiveType}} + {{{dataType}}}.validateJsonElement(element); + {{/isPrimitiveType}} + {{/isNumber}} + {{/items}} + } + {{/isFreeFormObject}} + {{/isMap}} {{/hasVars}} {{#hasVars}} {{{.}}}.validateJsonElement(jsonElement); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 7d2d6337336..eb30fa5a18b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -432,13 +432,13 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} -{{#performBeanValidation}} + {{#performBeanValidation}} 3.0.3 -{{/performBeanValidation}} -{{#useBeanValidation}} + {{/performBeanValidation}} + {{#useBeanValidation}} 3.0.2 -{{/useBeanValidation}} - 5.10.0 + {{/useBeanValidation}} + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index 8ccff676f1a..5ae6e5057b0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -33,8 +33,8 @@ import io.swagger.v3.oas.annotations.security.*; {{/swagger2AnnotationLibrary}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} import java.lang.reflect.Type; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache index aa1c47a2684..d63c511a90c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_test.mustache @@ -18,6 +18,12 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jackson}}JacksonObjectMapper.jackson{{/jackson}}; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index f618e9b3d3a..a892488a245 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -363,9 +363,9 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} -{{#useBeanValidation}} + {{#useBeanValidation}} 3.0.2 -{{/useBeanValidation}} + {{/useBeanValidation}} 3.6.0 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache new file mode 100644 index 00000000000..d6e0baeaee0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache @@ -0,0 +1,750 @@ +package {{invokerPackage}}; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +{{#withXml}} + import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; +{{/withXml}} +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import {{javaxPackage}}.annotation.Nullable; + +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +{{>generatedAnnotation}} +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "{{basePath}}"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + {{#openApiNullable}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + {{/openApiNullable}} + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + {{#withXml}} + XmlMapper xmlMapper = new XmlMapper(); + xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); + {{#openApiNullable}} + xmlMapper.registerModule(new JsonNullableModule()); + {{/openApiNullable}} + + {{/withXml}} + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + {{#withXml}} + converters.add(new MappingJackson2XmlHttpMessageConverter(xmlMapper)); + {{/withXml}} + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache new file mode 100644 index 00000000000..247b48b0e19 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/README.mustache @@ -0,0 +1,248 @@ +# {{artifactId}} + +{{appName}} + +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +- Generator version: {{generatorVersion}} + +{{{appDescriptionWithNewLines}}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +{{#jersey2}} +2. Maven (3.8.3+)/Gradle (7.2+) +{{/jersey2}} +{{^jersey2}} +2. Maven/Gradle +{{/jersey2}} + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central. + mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo. + } + + dependencies { + implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +- `target/lib/*.jar` + +{{#jersey2}} +## Usage + +To add a HTTP proxy for the API client, use `ClientConfig`: +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import {{{invokerPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +... + +ApiClient defaultClient = Configuration.getDefaultApiClient(); +ClientConfig clientConfig = defaultClient.getClientConfig(); +clientConfig.connectorProvider(new ApacheConnectorProvider()); +clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here"); +clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username"); +clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password"); +defaultClient.setClientConfig(clientConfig); + +{{{classname}}} apiInstance = new {{{classname}}}(defaultClient); +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +{{/jersey2}} +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + + +## Documentation for Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} + +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache new file mode 100644 index 00000000000..1475fc0f4ec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache @@ -0,0 +1,185 @@ +package {{package}}; + +import {{invokerPackage}}.ApiClient; + +{{#imports}}import {{import}}; +{{/imports}} + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(new ApiClient()); + } + + @Autowired + public {{classname}}(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + {{#operation}} + /** + * {{summary}} + * {{notes}} +{{#responses}} *

    {{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + private ResponseSpec {{operationId}}RequestCreation({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new RestClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + {{/required}} + {{/allParams}} + // create path and map variables + final Map pathParams = new HashMap<>(); + {{#hasPathParams}} + + {{#pathParams}} + pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}}); + {{/pathParams}} + {{/hasPathParams}} + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + {{#hasQueryParams}} + + {{#queryParams}}{{#isExplode}}{{#hasVars}}{{#vars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}}{{/hasVars}}{{^hasVars}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/hasVars}}{{/isExplode}}{{^isExplode}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/isExplode}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} + + {{#headerParams}} + if ({{paramName}} != null) + headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}} + {{/-last}} + {{/headerParams}} + {{/hasHeaderParams}} + {{#hasCookieParams}} + + {{#cookieParams}} + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + {{/cookieParams}} + {{/hasCookieParams}} + {{#hasFormParams}} + + {{#formParams}} + if ({{paramName}} != null) + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); + {{/formParams}} + {{/hasFormParams}} + + final String[] localVarAccepts = { {{#hasProduces}} + {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} + {{/hasProduces}}}; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { {{#hasConsumes}} + {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} + {{/hasConsumes}}}; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} }; + + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

    {{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return {{.}} +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + {{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).body(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

    {{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public {{#returnType}}ResponseEntity<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + {{#returnType}}ParameterizedTypeReference<{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{returnType}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}> localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};{{/returnType}} + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).toEntity(localVarReturnType); + } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

    {{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } + {{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api_test.mustache new file mode 100644 index 00000000000..dc34083413e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/api_test.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + */ + @Test + public void {{operationId}}Test() { + {{#allParams}} + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{/allParams}} + {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + // TODO: test validations + } + {{/operation}}{{/operations}} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/ApiKeyAuth.mustache new file mode 100644 index 00000000000..857403b27cf --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/ApiKeyAuth.mustache @@ -0,0 +1,62 @@ +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/Authentication.mustache new file mode 100644 index 00000000000..8e53c2ba08e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/Authentication.mustache @@ -0,0 +1,14 @@ +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBasicAuth.mustache new file mode 100644 index 00000000000..0194ccf07d5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBasicAuth.mustache @@ -0,0 +1,38 @@ +package {{invokerPackage}}.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBearerAuth.mustache new file mode 100644 index 00000000000..e67e76fbf4a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/HttpBearerAuth.mustache @@ -0,0 +1,56 @@ +package {{invokerPackage}}.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuth.mustache new file mode 100644 index 00000000000..7889f1582de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuth.mustache @@ -0,0 +1,24 @@ +package {{invokerPackage}}.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuthFlow.mustache new file mode 100644 index 00000000000..7ab35f6d890 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/auth/OAuthFlow.mustache @@ -0,0 +1,5 @@ +package {{invokerPackage}}.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache new file mode 100644 index 00000000000..4af2faaa3c0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/build.gradle.mustache @@ -0,0 +1,159 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = '{{artifactId}}' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + {{#swagger1AnnotationLibrary}} + swagger_annotations_version = "1.6.9" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + swagger_annotations_version = "2.2.9" + {{/swagger2AnnotationLibrary}} + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + {{#openApiNullable}} + jackson_databind_nullable_version = "0.2.6" + {{/openApiNullable}} + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + {{#swagger1AnnotationLibrary}} + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + {{/swagger2AnnotationLibrary}} + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + {{#openApiNullable}} + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{/openApiNullable}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{#joda}} + implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + implementation "joda-time:joda-time:$jodatime_version" + {{/joda}} + {{#withXml}} + implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" + {{/withXml}} + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pom.mustache new file mode 100644 index 00000000000..ee672099e93 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pom.mustache @@ -0,0 +1,374 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + {{#swagger1AnnotationLibrary}} + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + {{/swagger2AnnotationLibrary}} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} + {{#withXml}} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + io.github.threeten-jaxb + threeten-jaxb-core + 1.2 + + {{/withXml}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + + {{/joda}} + {{#useBeanValidation}} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + {{/useBeanValidation}} + {{#performBeanValidation}} + + + org.hibernate + hibernate-validator + ${hibernate-validator-version} + + {{/performBeanValidation}} + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + {{#swagger1AnnotationLibrary}} + 1.6.9 + {{/swagger1AnnotationLibrary}} + {{#swagger2AnnotationLibrary}} + 2.2.15 + {{/swagger2AnnotationLibrary}} + 6.1.6 + 2.15.2 + 2.15.2 + {{#openApiNullable}} + 0.2.6 + {{/openApiNullable}} + 2.1.1 + {{#joda}} + 2.9.9 + {{/joda}} + {{#useBeanValidation}} + 3.0.2 + {{/useBeanValidation}} + {{#performBeanValidation}} + 5.4.3.Final + {{/performBeanValidation}} + 5.10.2 + 1.10.0 + + diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 76c43913474..483cf84422a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -106,7 +106,8 @@ ext { jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -124,5 +125,6 @@ dependencies { {{/openApiNullable}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache index 3e1de7399e1..aa656c54f08 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache @@ -19,7 +19,8 @@ lazy val root = (project in file(".")). "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 80e6bc49d4d..3674b48b990 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -61,7 +61,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -71,7 +71,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -278,8 +277,14 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -306,6 +311,7 @@ {{/useJakartaEe}} 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 7108e921003..aa1a98fd3d8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -13,6 +13,11 @@ import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 1f1c5d517fa..04a19f1f173 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -15,6 +15,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index 48be247a797..7c1337eba0b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -333,9 +333,9 @@ {{#performBeanValidation}} - org.hibernate - hibernate-validator - ${hibernate-validator-version} + org.hibernate + hibernate-validator + ${hibernate-validator-version} {{/performBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache index 8698cdcb84d..771b84de223 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache @@ -3,8 +3,8 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache index 001b3170086..dd521a5fc87 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -34,6 +34,11 @@ import java.util.List; import java.util.Map; import java.util.Set; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} {{#operations}} public interface {{classname}} { {{#operation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache index 8ca8724b4ce..9227bbb78b0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache @@ -13,6 +13,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache index 7f7b9e2b0f2..e78bd985abf 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache @@ -18,8 +18,8 @@ import okhttp3.MultipartBody; {{/imports}} {{#useBeanValidation}} -import {{javaxPackage}}.validation.constraints.*; -import {{javaxPackage}}.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; {{/useBeanValidation}} import java.util.ArrayList; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 7054f463bfb..20b5c80c7c2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -404,9 +404,9 @@ {{^useJakartaEe}} 1.3.5 {{/useJakartaEe}} -{{#useBeanValidation}} + {{#useBeanValidation}} 3.0.2 -{{/useBeanValidation}} + {{/useBeanValidation}} 1.0.1 4.13.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index c745392012f..f0df804e264 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -680,54 +680,54 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { private final Map authentications = new LinkedHashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String username, String password) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("{{name}}", auth); }{{/isBasicBasic}}{{#isBasicBearer}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("{{scheme}}"); auth.setBearerToken(bearerToken); authentications.put("{{name}}", auth); }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}},"{{keyParamName}}"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("{{name}}", auth); }{{/isApiKey}}{{#isOAuth}} - public void add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public void add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("{{name}}", auth); }{{/isOAuth}}{{/authMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}(String username, String password) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(username, password); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(username, password); return authInfo; }{{/isBasicBasic}}{{#isBasicBearer}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String bearerToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(bearerToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(bearerToken); return authInfo; }{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String apikey, String apiKeyPrefix) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(apikey, apiKeyPrefix); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(apikey, apiKeyPrefix); return authInfo; }{{/isApiKey}}{{#isOAuth}} - public static AuthInfo for{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(String accessToken) { + public static AuthInfo for{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.add{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Authentication(accessToken); + authInfo.add{{#lambda.pascalcase}}{{name}}{{/lambda.pascalcase}}Authentication(accessToken); return authInfo; }{{/isOAuth}}{{/authMethods}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index a7ea64a15f7..65600dbfcd0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -11,6 +11,11 @@ import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache index afe5337ac00..c5d568617fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache @@ -4,8 +4,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -13,10 +14,15 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +{{#useBeanValidation}} +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +{{/useBeanValidation}} /** * API tests for {{classname}} */ -@Ignore +@Disabled public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); @@ -29,10 +35,11 @@ public class {{classname}}Test { */ @Test public void {{operationId}}Test() { + // uncomment below to test the function {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + //{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}; + //{{#returnType}}{{#isResponseFile}}{{#useAbstractionForFiles}}org.springframework.core.io.Resource{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{.}}}{{/useAbstractionForFiles}}{{/isResponseFile}}{{^isResponseFile}}{{{.}}}{{/isResponseFile}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{^vendorExtensions.x-webclient-blocking}}{{#vendorExtensions.x-webclient-return-except-list-of-string}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{^vendorExtensions.x-webclient-return-except-list-of-string}}.block(){{/vendorExtensions.x-webclient-return-except-list-of-string}}{{/vendorExtensions.x-webclient-blocking}}; // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 53c528209a2..3ccc98e214d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -150,7 +150,7 @@ ext { {{#joda}} jodatime_version = "2.9.9" {{/joda}} - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -176,5 +176,5 @@ dependencies { {{/joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 84ad1047c61..8547b9dc5a5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -43,7 +43,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 {{#useJakartaEe}} 17 @@ -58,7 +58,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -153,8 +153,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -184,7 +184,7 @@ 3.4.34 1.0.39 {{/useJakartaEe}} - 4.13.2 + 5.10.2 {{#joda}} 2.9.9 {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache b/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache index d33c2ce5276..69ad41543b8 100644 --- a/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache +++ b/modules/openapi-generator/src/main/resources/Java/maven.yml.mustache @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index ebf0883d4f3..d4c6ec8d154 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -83,18 +83,18 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vendorExtensions.x-field-extra-annotation}} {{#vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); {{/isContainer}} {{^isContainer}} - private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}} {{#isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{^isContainer}} - {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -114,7 +114,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#vendorExtensions.x-has-readonly-properties}} {{^withXml}} - + /** + * Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} + */ {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} public {{classname}}( {{#readOnlyVars}} @@ -128,8 +130,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{/withXml}} {{/vendorExtensions.x-has-readonly-properties}} - {{#vars}} +{{#vendorExtensions.x-java-all-args-constructor}} + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { +{{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); +{{/parent}} + {{#vars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; +{{/vars}} + } +{{/vendorExtensions.x-java-all-args-constructor}} + +{{#vars}} {{^isReadOnly}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -279,7 +295,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/vars}} {{#parent}} - {{#allVars}} + {{#readWriteVars}} {{#isOverridden}} @Override public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -293,7 +309,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{/isOverridden}} - {{/allVars}} + {{/readWriteVars}} {{/parent}} @Override public boolean equals(Object o) { @@ -613,5 +629,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 5d5c9ee90f1..d22874dd390 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -47,7 +47,7 @@ public class {{classname}} { String implClass = servletContext.getInitParameter("{{classname}}.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = ({{classname}}Service) Class.forName(implClass).newInstance(); + delegate = ({{classname}}Service) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidation.mustache index 29d193fe337..a7f26465482 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidation.mustache @@ -1 +1 @@ -{{#required}}@NotNull {{/required}}{{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}@Valid {{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}{{>beanValidationCore}} \ No newline at end of file +{{#required}}{{^isReadOnly}}@NotNull {{/isReadOnly}}{{/required}}{{#isContainer}}{{^items.isPrimitiveType}}{{^items.isDate}}{{^items.isDateTime}}{{^items.isString}}{{^items.isFile}}{{^items.isEnumOrRef}}@Valid {{/items.isEnumOrRef}}{{/items.isFile}}{{/items.isString}}{{/items.isDateTime}}{{/items.isDate}}{{/items.isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{^isEnumOrRef}}@Valid {{/isEnumOrRef}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache index 85c4dd5b695..a4477b5a0aa 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache @@ -23,8 +23,14 @@ import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor; import org.apache.cxf.interceptor.LoggingOutInterceptor; {{/useLoggingFeature}} +{{#useJakartaEe}} +import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; +import com.fasterxml.jackson.jakarta.rs.xml.JacksonXMLProvider; +{{/useJakartaEe}} +{{^useJakartaEe}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.jaxrs.xml.JacksonXMLProvider; +{{/useJakartaEe}} import org.apache.cxf.jaxrs.provider.MultipartProvider; import java.util.Arrays; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index bc5c66425f8..98269df93e8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -138,8 +138,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -150,8 +150,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -198,7 +198,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.0.11.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 {{#useBeanValidation}} 2.0.2 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache index 5d41db46781..ab482a0590a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -160,8 +160,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -172,8 +172,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -216,7 +216,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.13.0.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 {{#useJakartaEe}} 2.1.1 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache index e427a43a0ac..efd11d223ff 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidation.mustache @@ -1 +1 @@ -{{#required}}{{^isReadOnly}}@NotNull {{/isReadOnly}}{{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}@Valid {{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}@Valid {{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} \ No newline at end of file +{{#required}}@NotNull {{/required}}{{#isContainer}}{{^items.isPrimitiveType}}{{^items.isDate}}{{^items.isDateTime}}{{^items.isString}}{{^items.isFile}}{{^items.isEnumOrRef}}@Valid {{/items.isEnumOrRef}}{{/items.isFile}}{{/items.isString}}{{/items.isDateTime}}{{/items.isDate}}{{/items.isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{^isEnumOrRef}}@Valid {{/isEnumOrRef}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache index d45774cacc2..8f40dc3a9e7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache @@ -15,8 +15,13 @@ import io.swagger.annotations.*; {{/useSwaggerAnnotations}} {{#supportAsync}} +{{#useMutiny}} +import io.smallrye.mutiny.Uni; +{{/useMutiny}} +{{^useMutiny}} import java.util.concurrent.CompletionStage; import java.util.concurrent.CompletableFuture; +{{/useMutiny}} {{/supportAsync}} import java.io.InputStream; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index 96c81be3263..5bd7a3e4e60 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}CompletionStage<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { - return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache index d8fffd4846f..ef91cc3dfb2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache @@ -44,6 +44,9 @@ {{#useSwaggerAnnotations}} 1.6.10 {{/useSwaggerAnnotations}} +{{#useMutiny}} + 1.2.1 +{{/useMutiny}} @@ -109,6 +112,14 @@ provided {{/useSwaggerAnnotations}} +{{#useMutiny}} + + io.smallrye + smallrye-rest-client + ${smallrye.rest.client.version} + test + +{{/useMutiny}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache new file mode 100644 index 00000000000..93f1098e48d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache @@ -0,0 +1 @@ +{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 5bcfd364fee..a8f437f5f23 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -110,9 +110,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens return this; } - public {{classname}} remove{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - if ({{name}}Item != null && this.{{name}} != null) { - this.{{name}}.remove({{name}}Item); + public {{classname}} remove{{nameInPascalCase}}Item(String key) { + if (this.{{name}} != null) { + this.{{name}}.remove(key); } return this; @@ -166,7 +166,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens return new {{classname}}BuilderImpl(); } - private static final class {{classname}}BuilderImpl extends {{classname}}Builder<{{classname}}, {{classname}}BuilderImpl> { + private static class {{classname}}BuilderImpl extends {{classname}}Builder<{{classname}}, {{classname}}BuilderImpl> { @Override protected {{classname}}BuilderImpl self() { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache index 65a46053d53..f44c6083fdd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -162,7 +162,14 @@ ${beanvalidation-version} provided -{{/useBeanValidation}} + {{/useBeanValidation}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} 1.8 @@ -192,5 +199,8 @@ {{^useJakartaEe}} 2.1.6 {{/useJakartaEe}} +{{#openApiNullable}} + 0.2.6 +{{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache new file mode 100644 index 00000000000..9f369e65cfc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache @@ -0,0 +1,96 @@ + + public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{ + + private {{classname}} instance; + + public Builder() { + this(new {{classname}}()); + } + + protected Builder({{classname}} instance) { + {{#parentModel}} + super(instance); // the parent builder shares the same instance + {{/parentModel}} + this.instance = instance; + } + + protected Builder copyOf({{classname}} value) { {{#parentModel}} + super.copyOf(instance);{{/parentModel}}{{#vars}} + this.instance.{{setter}}(value.{{name}});{{/vars}} + return this; + } + +{{#vars}} + {{#deprecated}} + @Deprecated + {{/deprecated}} + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.instance.{{name}}({{name}}); + return this; + } + {{#deprecated}} + @Deprecated + {{/deprecated}} + {{#openApiNullable}}{{#isNullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{name}} = {{name}}; + return this; + } + {{/isNullable}}{{/openApiNullable}} +{{/vars}} +{{#parentVars}} + @Override + public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.instance.{{name}}({{name}}); + return this; + } + {{#openApiNullable}}{{#isNullable}} + public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + this.instance.{{setter}}({{name}}); + return this; + } + {{/isNullable}}{{/openApiNullable}} +{{/parentVars}} +{{#additionalPropertiesType}} + public {{classname}}.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + +{{/additionalPropertiesType}} + /** + * returns a built {{classname}} instance. + * + * The builder is not reusable (NullPointerException) + */ + public {{classname}} build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused{{#parentModel}} + super.build();{{/parentModel}} + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static {{classname}}.Builder builder() { + return new {{classname}}.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public {{classname}}.Builder toBuilder() { + {{! using the instance setter ensure compatibility with Optional and JsonNullable}} + {{classname}}.Builder builder = new {{classname}}.Builder(); + return builder.copyOf(this); + } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index bb230120be8..44be9a40898 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -93,19 +93,19 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/openApiNullable}} {{/isContainer}} {{/vars}} + {{#vendorExtensions.x-java-no-args-constructor}} + + public {{classname}}() { + super(); + } + {{/vendorExtensions.x-java-no-args-constructor}} {{^lombok.Data}} {{^lombok.RequiredArgsConstructor}} {{#generatedConstructorWithRequiredArgs}} {{#hasRequired}} - {{^lombok.NoArgsConstructor}} - public {{classname}}() { - super(); - } - - {{/lombok.NoArgsConstructor}} /** - * Constructor with only required parameters + * Constructor with only required parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} */ public {{classname}}({{#requiredVars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) { {{#parent}} @@ -125,6 +125,25 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/hasRequired}} {{/generatedConstructorWithRequiredArgs}} {{/lombok.RequiredArgsConstructor}} + {{#vendorExtensions.x-java-all-args-constructor}} + + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { + {{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); + {{/parent}} + {{#vars}} + {{#openApiNullable}} + this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.ofNullable({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}; + {{/openApiNullable}} + {{^openApiNullable}} + this.{{name}} = {{name}}; + {{/openApiNullable}} + {{/vars}} + } + {{/vendorExtensions.x-java-all-args-constructor}} {{/lombok.Data}} {{#vars}} {{^lombok.Data}} @@ -332,5 +351,8 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} return o.toString().replace("\n", "\n "); } {{/lombok.ToString}} + {{#generateBuilders}} + {{>javaBuilder}} + {{/generateBuilders}} {{/lombok.Data}} } diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 9849aa702f3..ba2d139af98 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -43,6 +43,7 @@ org.openapitools.codegen.languages.KotlinClientCodegen org.openapitools.codegen.languages.KotlinServerCodegen org.openapitools.codegen.languages.KotlinSpringServerCodegen org.openapitools.codegen.languages.KotlinVertxServerCodegen +org.openapitools.codegen.languages.KotlinWiremockServerCodegen org.openapitools.codegen.languages.KtormSchemaCodegen org.openapitools.codegen.languages.HaskellHttpClientCodegen org.openapitools.codegen.languages.HaskellServantCodegen @@ -80,6 +81,7 @@ org.openapitools.codegen.languages.JuliaServerCodegen org.openapitools.codegen.languages.K6ClientCodegen org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.MarkdownDocumentationCodegen +org.openapitools.codegen.languages.JavaMicroprofileServerCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen org.openapitools.codegen.languages.N4jsClientCodegen org.openapitools.codegen.languages.NimClientCodegen @@ -91,6 +93,7 @@ org.openapitools.codegen.languages.OpenAPIYamlGenerator org.openapitools.codegen.languages.PlantumlDocumentationCodegen org.openapitools.codegen.languages.PerlClientCodegen org.openapitools.codegen.languages.PhpClientCodegen +org.openapitools.codegen.languages.PhpFlightServerCodegen org.openapitools.codegen.languages.PhpNextgenClientCodegen org.openapitools.codegen.languages.PhpLaravelServerCodegen org.openapitools.codegen.languages.PhpLumenServerCodegen diff --git a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache index d4773b14f81..adc71b7f0bd 100644 --- a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache @@ -1,6 +1,6 @@ package {{generatorPackage}}; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.config.CodegenConfigurator; diff --git a/modules/openapi-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-generator/src/main/resources/codegen/pom.mustache index 144e81a08eb..81a80f9df17 100644 --- a/modules/openapi-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/pom.mustache @@ -31,7 +31,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -41,7 +41,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -114,15 +113,16 @@ provided - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} + test UTF-8 {{openapiGeneratorVersion}} 1.0.0 - 4.13.2 + 5.10.2 diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-header.mustache index d3489fad402..ca7d7c684dd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-header.mustache @@ -13,6 +13,7 @@ #include #include #include +#include namespace {{helpersNamespace}} { @@ -82,6 +83,15 @@ namespace {{helpersNamespace}} return true; } + ///

    + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::set& set) + { + return true; + } + std::string toStringValue(const std::string &value); std::string toStringValue(const int32_t value); std::string toStringValue(const int64_t value); diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache index ac016229aee..ae6f06a4cf4 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache @@ -61,7 +61,7 @@ bool {{classname}}::validate(std::stringstream& msg, const std::string& pathPref {{> model-validation-body }} } {{/hasValidation}}{{#required}}{{#isModel}} - if (!m_{{name}}.validate()) { + if (!m_{{name}}.validate(msg, _pathPrefix + ".{{nameInCamelCase}}")) { msg << _pathPrefix << ": {{name}} is invalid;"; success = false; }{{/isModel}}{{/required}}{{/isArray}}{{/vars}}{{/isEnum}}{{#vendorExtensions.x-is-string-enum-container}}{{#anyOf}}{{#-first}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-header.mustache new file mode 100644 index 00000000000..16206ff3bcc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-header.mustache @@ -0,0 +1,46 @@ +{{>licenseInfo}} +/* + * AnyType.h + * + * This is the implementation of an any JSON type. + */ + +#ifndef {{modelHeaderGuardPrefix}}_AnyType_H_ +#define {{modelHeaderGuardPrefix}}_AnyType_H_ + +{{{defaultInclude}}} +#include "{{packageName}}/Object.h" + +#include +#include + +{{#modelNamespaceDeclarations}} +namespace {{this}} { +{{/modelNamespaceDeclarations}} + +class {{declspec}} AnyType : public Object { +public: + AnyType(); + virtual ~AnyType(); + + ///////////////////////////////////////////// + /// ModelBase overrides + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value &json) override; + + void toMultipart(std::shared_ptr multipart, + const utility::string_t &namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, + const utility::string_t &namePrefix) override; + +private: + web::json::value m_value; +}; + +{{#modelNamespaceDeclarations}} +} +{{/modelNamespaceDeclarations}} + +#endif /* {{modelHeaderGuardPrefix}}_AnyType_H_ */ diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-source.mustache new file mode 100644 index 00000000000..8f9421ab3fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/anytype-source.mustache @@ -0,0 +1,40 @@ +{{>licenseInfo}} +#include "{{packageName}}/AnyType.h" + +{{#modelNamespaceDeclarations}} +namespace {{this}} { +{{/modelNamespaceDeclarations}} + +AnyType::AnyType() { m_value = web::json::value::null(); } + +AnyType::~AnyType() {} + +void AnyType::validate() {} + +web::json::value AnyType::toJson() const { return m_value; } + +bool AnyType::fromJson(const web::json::value &val) { + m_value = val; + m_IsSet = true; + return isSet(); +} + +void AnyType::toMultipart(std::shared_ptr multipart, + const utility::string_t &prefix) const { + if (m_value.is_object()) { + return Object::toMultipart(multipart, prefix); + } + throw std::runtime_error("AnyType::toMultipart: unsupported type"); +} + +bool AnyType::fromMultiPart(std::shared_ptr multipart, + const utility::string_t &prefix) { + if (m_value.is_object()) { + return Object::fromMultiPart(multipart, prefix); + } + return false; +} + +{{#modelNamespaceDeclarations}} +} +{{/modelNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache index a108b96f5d9..665c9e7e8a3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache @@ -17,6 +17,7 @@ #include #include +#include #include {{#modelNamespaceDeclarations}} @@ -52,6 +53,8 @@ public: static utility::string_t toString( const std::shared_ptr& val ); template static utility::string_t toString( const std::vector & val ); + template + static utility::string_t toString( const std::set & val ); static web::json::value toJson( bool val ); static web::json::value toJson( float val ); @@ -68,6 +71,8 @@ public: template static web::json::value toJson( const std::vector& val ); template + static web::json::value toJson( const std::set& val ); + template static web::json::value toJson( const std::map& val ); static bool fromString( const utility::string_t& val, bool & ); @@ -85,6 +90,8 @@ public: template static bool fromString( const utility::string_t& val, std::vector & ); template + static bool fromString( const utility::string_t& val, std::set & ); + template static bool fromString( const utility::string_t& val, std::map & ); static bool fromJson( const web::json::value& val, bool & ); @@ -102,6 +109,8 @@ public: template static bool fromJson( const web::json::value& val, std::vector & ); template + static bool fromJson( const web::json::value& val, std::set & ); + template static bool fromJson( const web::json::value& val, std::map & ); @@ -120,6 +129,8 @@ public: template static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::set& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template static std::shared_ptr toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static bool fromHttpContent( std::shared_ptr val, bool & ); @@ -136,6 +147,8 @@ public: template static bool fromHttpContent( std::shared_ptr val, std::vector & ); template + static bool fromHttpContent( std::shared_ptr val, std::set & ); + template static bool fromHttpContent( std::shared_ptr val, std::map & ); static utility::string_t toBase64( utility::string_t value ); @@ -155,6 +168,8 @@ utility::string_t ModelBase::toString( const std::shared_ptr& val ) } return utility::string_t(ss.str()); } + +// std::vector to string template utility::string_t ModelBase::toString( const std::vector & val ) { @@ -169,6 +184,24 @@ utility::string_t ModelBase::toString( const std::vector & val ) } return strArray; } + +// std::set to string +template +utility::string_t ModelBase::toString( const std::set & val ) +{ + utility::string_t strArray; + for ( const auto &item : val ) + { + strArray.append( toString(item) + "," ); + } + if (val.count() > 0) + { + strArray.pop_back(); + } + return strArray; +} + + template web::json::value ModelBase::toJson( const std::shared_ptr& val ) { @@ -179,6 +212,8 @@ web::json::value ModelBase::toJson( const std::shared_ptr& val ) } return retVal; } + +// std::vector to json template web::json::value ModelBase::toJson( const std::vector& value ) { @@ -189,6 +224,21 @@ web::json::value ModelBase::toJson( const std::vector& value ) } return web::json::value::array(ret); } + +// std::set to json +template +web::json::value ModelBase::toJson( const std::set& value ) +{ + // There's no protoype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array. + std::vector ret; + for ( const auto& x : value ) + { + ret.push_back( toJson(x) ); + } + return web::json::value::array(ret); +} + + template web::json::value ModelBase::toJson( const std::map& val ) { @@ -279,6 +329,7 @@ std::shared_ptr ModelBase::toHttpContent(const utility::string_t& n } return content; } + template std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) { @@ -290,6 +341,7 @@ std::shared_ptr ModelBase::toHttpContent( const utility::string_t& content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) ); return content; } + template std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType ) { diff --git a/modules/openapi-generator/src/main/resources/crystal/api_error.mustache b/modules/openapi-generator/src/main/resources/crystal/api_error.mustache index 3e4dc166855..52678bd8782 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_error.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_error.mustache @@ -21,7 +21,7 @@ module {{moduleName}} msg = "" msg = msg + "\nHTTP status code: #{code}" if @code msg = msg + "\nResponse headers: #{response_headers}" if @response_headers - if @message.nil? || @message.empty? + if @message.try &.empty? msg = msg + "\nError message: the server returns an error but the HTTP response body is empty." else msg = msg + "\nResponse body: #{@message}" diff --git a/modules/openapi-generator/src/main/resources/crystal/shard.mustache b/modules/openapi-generator/src/main/resources/crystal/shard.mustache index 11b01286538..f194083ac7b 100644 --- a/modules/openapi-generator/src/main/resources/crystal/shard.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/shard.mustache @@ -8,12 +8,12 @@ crystal: ">= 0.35.1" dependencies: crest: github: mamantoha/crest - version: ~> 0.26.0 + version: ~> 1.3.13 development_dependencies: kemal: github: kemalcr/kemal - version: ~>0.27.0 + version: ~>1.5.0 ameba: github: crystal-ameba/ameba diff --git a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache index 33791a90857..9566e1f1aed 100644 --- a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache @@ -82,7 +82,7 @@ namespace {{packageName}}.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ClientUtils.mustache index ae83297b1d5..d2917e45195 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ClientUtils.mustache @@ -336,6 +336,43 @@ using System.Runtime.CompilerServices; return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string{{nrt?}} GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index 9d1dd4b7ba6..2b8fe63b201 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -44,6 +44,17 @@ {{/-last}} {{/allVars}} + {{#discriminator}} + {{#children}} + {{#-first}} + string{{nrt?}} discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "{{discriminator.propertyBaseName}}"); + + {{/-first}} + if (discriminator != null && discriminator.Equals("{{name}}")) + return JsonSerializer.Deserialize<{{{name}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + {{/children}} + {{/discriminator}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} {{#mappedModels}} @@ -281,7 +292,7 @@ {{#model.hasDiscriminatorWithNonEmptyMapping}} {{#mappedModels}} if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{#-last}} throw new JsonException(); @@ -300,14 +311,14 @@ {{/-last}} {{/required}} - return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{^isNullable}}{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{/composedSchemas.oneOf}} {{^model.discriminator}} {{#composedSchemas}} {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{/vendorExtensions.x-duplicated-data-type}} {{#-last}} @@ -331,6 +342,18 @@ public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { {{#lambda.trimLineBreaks}} + {{#lambda.copy}} + {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copy}} + {{#discriminator}} + {{#children}} + if ({{#lambda.pasteLine}}{{/lambda.pasteLine}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ + JsonSerializer.Serialize<{{{name}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + return; + } + + {{/children}} + {{/discriminator}} writer.WriteStartObject(); {{#model.discriminator}} @@ -339,7 +362,7 @@ {{^vendorExtensions.x-duplicated-data-type}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) { {{baseType}}JsonConverter {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}} = ({{baseType}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.GetType())); - {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}}.WriteProperties(ref writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}}.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); } {{/vendorExtensions.x-duplicated-data-type}} @@ -352,13 +375,13 @@ if ({{#lambda.joinWithAmpersand}}{{^required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet {{/required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null{{/lambda.joinWithAmpersand}}) { {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.WriteProperties(ref writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); } {{/anyOf}} {{/composedSchemas}} {{/model.discriminator}} - WriteProperties(ref writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); writer.WriteEndObject(); {{/lambda.trimLineBreaks}} } @@ -370,11 +393,12 @@ /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { {{#lambda.trimTrailingWithNewLine}} {{#lambda.trimLineBreaks}} {{#allVars}} + {{^isDiscriminator}} {{^isNullable}} {{#vendorExtensions.x-is-reference-type}} if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) @@ -382,8 +406,18 @@ {{/vendorExtensions.x-is-reference-type}} {{/isNullable}} + {{/isDiscriminator}} {{/allVars}} {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}{{/isNew}}); + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} {{#isString}} {{^isMap}} {{^isEnum}} @@ -579,6 +613,7 @@ {{/isString}} {{/isEnum}} {{/isUuid}} + {{/isDiscriminator}} {{/allVars}} {{/lambda.trimLineBreaks}} {{/lambda.trimTrailingWithNewLine}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelBaseSignature.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelBaseSignature.mustache index 94a34cf51f8..909a68e354f 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelBaseSignature.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelBaseSignature.mustache @@ -1 +1 @@ -{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{parent}}{{/lambda.camelcase_sanitize_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^required}}.Value{{/required}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/allVars}} \ No newline at end of file +{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{parent}}{{/lambda.camelcase_sanitize_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^required}}.Value{{/required}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/isDiscriminator}}{{/allVars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelSignature.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelSignature.mustache index d16e13065f1..39aa11f82ab 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelSignature.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/ModelSignature.mustache @@ -1 +1 @@ -{{#model.allVars}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/model.allVars}} +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache index 896235fe70a..371b9daa921 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/README.client.mustache @@ -200,7 +200,6 @@ Class | Method | HTTP request | Description - modelDocs: {{generateModelDocs}} - apiTests: {{generateApiTests}} - modelTests: {{generateModelTests}} -- withXml: {{withXml}} ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache index d5fe88663bb..556d6f0e9d4 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache @@ -13,7 +13,9 @@ /// {{/composedSchemas.anyOf}} {{#allVars}} + {{^isDiscriminator}} /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} {{#model.vendorExtensions.x-model-is-mutatable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutatable}}{{^model.vendorExtensions.x-model-is-mutatable}}internal{{/model.vendorExtensions.x-model-is-mutatable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { @@ -22,6 +24,7 @@ {{/composedSchemas.anyOf}} {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} @@ -30,6 +33,7 @@ {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isNew}} {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} OnCreated(); } @@ -44,7 +48,9 @@ /// {{/composedSchemas.anyOf}} {{#allVars}} + {{^isDiscriminator}} /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} {{^composedSchemas.anyOf}} [JsonConstructor] @@ -55,6 +61,7 @@ {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} @@ -63,6 +70,7 @@ {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isNew}} {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} OnCreated(); } @@ -83,6 +91,7 @@ {{>modelInnerEnum}} {{/complexType}} {{/isEnum}} + {{^isDiscriminator}} {{#isEnum}} {{^required}} /// @@ -109,6 +118,7 @@ public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isEnum}} + {{/isDiscriminator}} {{/vars}} {{#composedSchemas.anyOf}} {{^vendorExtensions.x-duplicated-data-type}} @@ -152,6 +162,20 @@ {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } = {{^isNew}}"{{classname}}"{{/isNew}}{{#isNew}}{{^isEnum}}"{{classname}}"{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), "{{classname}}"){{/isEnum}}{{/isNew}}; + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} {{^isEnum}} {{#isInherited}} {{#isNew}} @@ -204,6 +228,7 @@ {{/isInherited}} {{/isEnum}} + {{/isDiscriminator}} {{/allVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -227,7 +252,9 @@ sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); {{/parent}} {{#vars}} + {{^isDiscriminator}} sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/isDiscriminator}} {{/vars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} diff --git a/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache index 010d2d72e92..a7113a6cb80 100644 --- a/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/netcore_project.mustache @@ -21,6 +21,7 @@ {{.}}{{/releaseNote}}{{#packageTags}} {{{.}}}{{/packageTags}}{{#nrt}} {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + false diff --git a/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt index 5e51f8cceff..8fe6b534ab7 100644 --- a/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt +++ b/modules/openapi-generator/src/main/resources/dart/dart-keywords.txt @@ -2,7 +2,9 @@ abstract as assert async +augment await +base break case catch @@ -50,6 +52,7 @@ patch required rethrow return +sealed set show source @@ -64,6 +67,7 @@ try typedef var void +when while with yield \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache index 03255f3eee8..5a93026402d 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -10,7 +10,7 @@ publish_to: {{.}} {{/pubPublishTo}} environment: - sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <3.0.0' + sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.15.0{{/useJsonSerializable}} <4.0.0' dependencies: dio: '^5.2.0' @@ -20,6 +20,9 @@ dependencies: built_value: '>=8.4.0 <9.0.0' built_collection: '>=5.1.1 <6.0.0' {{/useBuiltValue}} +{{#useEquatable}} + equatable: '^2.0.5' +{{/useEquatable}} {{#useJsonSerializable}} json_annotation: '^4.4.0' {{/useJsonSerializable}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache index 506bb7f4518..a670c63e880 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/class.mustache @@ -1,4 +1,7 @@ import 'package:json_annotation/json_annotation.dart'; +{{#useEquatable}} +import 'package:equatable/src/equatable_utils.dart'; +{{/useEquatable}} part '{{classFilename}}.g.dart'; @@ -61,17 +64,50 @@ class {{{classname}}} { {{/vars}} - @override - bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && - {{#vars}} - other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} - {{/vars}} - @override - int get hashCode => - {{#vars}} - {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} - {{/vars}} + {{#useEquatable}} + bool operator ==(Object other) { + return identical(this, other) || + other is {{{classname}}} && + runtimeType == other.runtimeType && + equals( + [ + {{#vars}} + {{{name}}}, + {{/vars}} + ], + [ + {{#vars}} + other.{{{name}}}, + {{/vars}} + ] + ); + } + {{/useEquatable}} + + {{^useEquatable}} + @override + bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} && + {{#vars}} + other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + {{/useEquatable}} + + {{#useEquatable}} + @override + int get hashCode => runtimeType.hashCode ^ mapPropsToHashCode([ + {{#vars}} + {{{name}}}, + {{/vars}} + ],); + {{/useEquatable}} + {{^useEquatable}} + @override + int get hashCode => + {{#vars}} + {{#isNullable}}({{{name}}} == null ? 0 : {{{name}}}.hashCode){{/isNullable}}{{^isNullable}}{{{name}}}.hashCode{{/isNullable}}{{^-last}} +{{/-last}}{{#-last}};{{/-last}} + {{/vars}} + {{/useEquatable}} factory {{{classname}}}.fromJson(Map json) => _${{{classname}}}FromJson(json); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache index 118fb8fc573..6446c73972f 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/json_serializable/enum.mustache @@ -7,11 +7,13 @@ import 'package:json_annotation/json_annotation.dart'; enum {{{classname}}} { {{#allowableValues}} {{#enumVars}} - {{#description}} - /// {{{.}}} - {{/description}} - @JsonValue({{#isString}}r{{/isString}}{{{value}}}) - {{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{^isNull}} + {{#description}} + /// {{{.}}} + {{/description}} + @JsonValue({{#isString}}r{{/isString}}{{{value}}}) + {{{name}}}({{^isString}}'{{/isString}}{{#isString}}r{{/isString}}{{{value}}}{{^isString}}'{{/isString}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/isNull}} {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index af522867b03..eeeb79b5929 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -13,7 +13,7 @@ repository: {{.}} publish_to: {{.}} {{/pubPublishTo}} environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0' diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/go.mod.mustache index 1b225bbafef..640f93d7448 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/go.mod.mustache @@ -24,7 +24,7 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache index 583de2dca7c..5dc6fd9aebd 100644 --- a/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache @@ -3,7 +3,9 @@ package {{packageName}} {{#operations}} import ( + {{#hasBodyParams}} "encoding/json" + {{/hasBodyParams}} {{#isBodyParam}} {{^required}} "errors" @@ -14,6 +16,7 @@ import ( "strings" {{#imports}} "{{import}}" {{/imports}} +{{#hasPathParams}} {{#routers}} {{#mux}} @@ -23,6 +26,7 @@ import ( "github.com/go-chi/chi/v5" {{/chi}} {{/routers}} +{{/hasPathParams}} ) {{/operations}} @@ -43,7 +47,7 @@ func With{{classname}}ErrorHandler(h ErrorHandler) {{classname}}Option { } // New{{classname}}Controller creates a default api controller -func New{{classname}}Controller(s {{classname}}Servicer, opts ...{{classname}}Option) Router { +func New{{classname}}Controller(s {{classname}}Servicer, opts ...{{classname}}Option) *{{classname}}Controller { controller := &{{classname}}Controller{ service: s, errorHandler: DefaultErrorHandler, @@ -116,7 +120,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isNumber}} @@ -130,7 +134,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isFloat}} @@ -144,7 +148,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isDouble}} @@ -158,7 +162,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isLong}} @@ -172,14 +176,14 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isInteger}} {{#isDateTime}} {{paramName}}Param, err := parseTime({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isDateTime}} @@ -199,7 +203,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re {{#isEnumRef}} {{paramName}}Param, err := New{{dataType}}FromValue({{#routers}}{{#mux}}params["{{baseName}}"]{{/mux}}{{#chi}}chi.URLParam(r, "{{baseName}}"){{/chi}}{{/routers}}) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isEnumRef}} @@ -216,7 +220,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re if query.Has("{{baseName}}"){ param, err := parseTime(query.Get("{{baseName}}")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -238,7 +242,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -266,7 +270,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -294,7 +298,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -322,7 +326,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -350,7 +354,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -378,7 +382,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[bool]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -405,7 +409,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isNumber}} @@ -417,7 +421,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isFloat}} @@ -429,7 +433,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[float64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isDouble}} @@ -441,7 +445,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isLong}} @@ -453,14 +457,14 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isInteger}} {{#items.isDateTime}} {{paramName}}Param, err := parseTimes(query.Get("{{baseName"}})) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/items.isDateTime}} @@ -483,7 +487,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re for _, param := range paramSplits { paramEnum, err := New{{items.dataType}}FromValue(param) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{paramName}}Param = append({{paramName}}Param, paramEnum) @@ -516,7 +520,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re {{/required}} {{^required}} {{#defaultValue}} - param := {{^isString}}{{dataType}}({{/isString}}{{defaultValue}}{{^isString}}){{/isString}} + param := {{^isString}}{{dataType}}({{/isString}}"{{defaultValue}}"{{^isString}}){{/isString}} {{paramName}}Param = {{#isNullable}}&{{/isNullable}}param {{/defaultValue}} {{/required}} @@ -541,7 +545,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re param, err := ReadFormFileToTempFile(r, "{{baseName}}") {{/isArray}} if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } @@ -556,7 +560,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int64]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isArray}}{{/isLong}} @@ -568,7 +572,7 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re WithMaximum[int32]({{maximum}}),{{/maximum}} ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "{{baseName}}", Err: err}, nil) return } {{/isArray}}{{/isInteger}} @@ -627,5 +631,5 @@ func (c *{{classname}}Controller) {{nickname}}(w http.ResponseWriter, r *http.Re return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code,{{#addResponseHeaders}} result.Headers,{{/addResponseHeaders}} w) + _ = EncodeJSONResponse(result.Body, &result.Code,{{#addResponseHeaders}} result.Headers,{{/addResponseHeaders}} w) }{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-server/error.mustache b/modules/openapi-generator/src/main/resources/go-server/error.mustache index a4ffa03f53f..4c90a3b9f25 100644 --- a/modules/openapi-generator/src/main/resources/go-server/error.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/error.mustache @@ -14,7 +14,8 @@ var ( // ParsingError indicates that an error has occurred when parsing request parameters type ParsingError struct { - Err error + Param string + Err error } func (e *ParsingError) Unwrap() error { @@ -22,7 +23,11 @@ func (e *ParsingError) Unwrap() error { } func (e *ParsingError) Error() string { - return e.Err.Error() + if e.Param == "" { + return e.Err.Error() + } + + return e.Param + ": " + e.Err.Error() } // RequiredError indicates that an error has occurred when parsing request parameters @@ -40,15 +45,21 @@ type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result // DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing // request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. -func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) { - if _, ok := err.(*ParsingError); ok { +func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *ImplResponse) { + var parsingErr *ParsingError + if ok := errors.As(err, &parsingErr); ok { // Handle parsing errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest),{{#addResponseHeaders}} map[string][]string{},{{/addResponseHeaders}} w) - } else if _, ok := err.(*RequiredError); ok { - // Handle missing required errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity),{{#addResponseHeaders}} map[string][]string{},{{/addResponseHeaders}} w) - } else { - // Handle all other errors - EncodeJSONResponse(err.Error(), &result.Code,{{#addResponseHeaders}} result.Headers,{{/addResponseHeaders}} w) + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest),{{#addResponseHeaders}} map[string][]string{},{{/addResponseHeaders}} w) + return } + + var requiredErr *RequiredError + if ok := errors.As(err, &requiredErr); ok { + // Handle missing required errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity),{{#addResponseHeaders}} map[string][]string{},{{/addResponseHeaders}} w) + return + } + + // Handle all other errors + _ = EncodeJSONResponse(err.Error(), &result.Code,{{#addResponseHeaders}} result.Headers,{{/addResponseHeaders}} w) } diff --git a/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache index bb85cc224ae..3096fb82bd4 100644 --- a/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/go.mod.mustache @@ -2,6 +2,7 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}} go 1.18 +{{#hasPathParams}} {{#routers}} {{#mux}} require github.com/gorilla/mux v1.8.0 @@ -16,3 +17,4 @@ require github.com/go-chi/cors v1.2.1 {{/featureCORS}} {{/chi}} {{/routers}} +{{/hasPathParams}} diff --git a/modules/openapi-generator/src/main/resources/go-server/helpers.mustache b/modules/openapi-generator/src/main/resources/go-server/helpers.mustache index ba5954ff46b..de8a203d84b 100644 --- a/modules/openapi-generator/src/main/resources/go-server/helpers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/helpers.mustache @@ -56,7 +56,7 @@ func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) err // If it is a slice we continue recursion case reflect.Slice: - for i := 0; i < value.Len(); i += 1 { + for i := 0; i < value.Len(); i++ { if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { return err } diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index ce00067fc0b..e94a8b9a2dd 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -49,9 +49,9 @@ func New{{{classname}}}FromValue(v {{{format}}}{{^format}}{{dataType}}{{/format} ev := {{{classname}}}(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for {{{classname}}}: valid values are %v", v, Allowed{{{classname}}}EnumValues) } + + return "", fmt.Errorf("invalid value '%v' for {{{classname}}}: valid values are %v", v, Allowed{{{classname}}}EnumValues) } {{/isEnum}}{{^isEnum}}{{#description}} @@ -166,14 +166,69 @@ func Assert{{classname}}Constraints(obj {{classname}}) error { {{#Vars}} {{#minimum}} if {{#isNullable}}obj.{{name}} != nil && *{{/isNullable}}obj.{{name}} < {{minimum}} { - return &ParsingError{Err: errors.New(errMsgMinValueConstraint)} + return &ParsingError{Param: "{{name}}", Err: errors.New(errMsgMinValueConstraint)} } {{/minimum}} {{#maximum}} if {{#isNullable}}obj.{{name}} != nil && *{{/isNullable}}obj.{{name}} > {{maximum}} { - return &ParsingError{Err: errors.New(errMsgMaxValueConstraint)} + return &ParsingError{Param: "{{name}}", Err: errors.New(errMsgMaxValueConstraint)} } {{/maximum}} +{{#isNullable}} +{{#isModel}} + if obj.{{name}} != nil { +{{/isModel}} +{{#isArray}} +{{#items.isModel}} + if obj.{{name}} != nil { +{{/items.isModel}} +{{/isArray}} +{{/isNullable}} +{{#isModel}} +{{#isNullable}} {{/isNullable}} if err := Assert{{baseType}}Constraints({{#isNullable}}*{{/isNullable}}obj.{{name}}); err != nil { +{{#isNullable}} {{/isNullable}} return err +{{#isNullable}} {{/isNullable}} } +{{/isModel}} +{{#isArray}} +{{#items.isModel}} +{{#isNullable}} {{/isNullable}} for _, el := range {{#isNullable}}*{{/isNullable}}obj.{{name}} { +{{#isNullable}} {{/isNullable}} if err := Assert{{items.baseType}}Constraints(el); err != nil { +{{#isNullable}} {{/isNullable}} return err +{{#isNullable}} {{/isNullable}} } +{{#isNullable}} {{/isNullable}} } +{{/items.isModel}} +{{^items.isModel}} +{{#mostInnerItems.isModel}} +{{^mostInnerItems.isPrimitiveType}} +{{#isNullable}} + if obj.{{name}} != nil { +{{/isNullable}} +{{#isNullable}} {{/isNullable}} if err := AssertRecurseInterfaceRequired({{#isNullable}}*{{/isNullable}}obj.{{name}}, Assert{{mostInnerItems.dataType}}Constraints); err != nil { +{{#isNullable}} {{/isNullable}} return err +{{#isNullable}} {{/isNullable}} } +{{/mostInnerItems.isPrimitiveType}} +{{/mostInnerItems.isModel}} +{{/items.isModel}} +{{/isArray}} +{{#isNullable}} +{{#isModel}} + } +{{/isModel}} +{{#isArray}} +{{#items.isModel}} + } +{{/items.isModel}} +{{^items.isModel}} +{{#mostInnerItems.isModel}} +{{^mostInnerItems.isPrimitiveType}} +{{#isNullable}} + } +{{/isNullable}} +{{/mostInnerItems.isPrimitiveType}} +{{/mostInnerItems.isModel}} +{{/items.isModel}} +{{/isArray}} +{{/isNullable}} {{/Vars}} return nil }{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go-server/routers.mustache b/modules/openapi-generator/src/main/resources/go-server/routers.mustache index fb2d043076a..207df91d9aa 100644 --- a/modules/openapi-generator/src/main/resources/go-server/routers.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/routers.mustache @@ -64,8 +64,7 @@ func NewRouter(routers ...Router) {{#routers}}{{#mux}}*mux.Router{{/mux}}{{#chi} {{/routers}} for _, api := range routers { for {{#routers}}{{#mux}}name{{/mux}}{{#chi}}_{{/chi}}{{/routers}}, route := range api.Routes() { - var handler http.Handler - handler = route.HandlerFunc + var handler http.Handler = route.HandlerFunc {{#routers}} {{#mux}} handler = Logger(handler, name) @@ -373,7 +372,7 @@ func parseNumericArrayParameter[T Number](param, delim string, required bool, fn } -// parseQuery parses query paramaters and returns an error if any malformed value pairs are encountered. +// parseQuery parses query parameters and returns an error if any malformed value pairs are encountered. func parseQuery(rawQuery string) (url.Values, error) { return url.ParseQuery(rawQuery) } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-server/service.mustache b/modules/openapi-generator/src/main/resources/go-server/service.mustache index 799c6823739..52ddb6ac23b 100644 --- a/modules/openapi-generator/src/main/resources/go-server/service.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/service.mustache @@ -15,7 +15,7 @@ type {{classname}}Service struct { } // New{{classname}}Service creates a default api service -func New{{classname}}Service() {{classname}}Servicer { +func New{{classname}}Service() *{{classname}}Service { return &{{classname}}Service{} }{{#operations}}{{#operation}} diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index f1270b3c692..2b43d4d1b31 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -172,7 +172,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index f5a6b6c53ef..9299b9e5b94 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -3,16 +3,14 @@ var _ MappedNullable = &{{classname}}{} // {{classname}} {{{description}}}{{^description}}struct for {{{classname}}}{{/description}} type {{classname}} struct { -{{#parent}} -{{^isMap}} +{{#parentModel.name}} {{^isArray}} - {{{parent}}} + {{{parentModel.classname}}} {{/isArray}} -{{/isMap}} {{#isArray}} - Items {{{parent}}} + Items {{{parentModel.classname}}} {{/isArray}} -{{/parent}} +{{/parentModel.name}} {{#vars}} {{^-first}} {{/-first}} @@ -339,6 +337,7 @@ func (o {{classname}}) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +{{#vendorExtensions.x-go-generate-unmarshal-json}} {{#isAdditionalPropertiesTrue}} func (o *{{{classname}}}) UnmarshalJSON(data []byte) (err error) { {{/isAdditionalPropertiesTrue}} @@ -516,4 +515,5 @@ func (o *{{{classname}}}) UnmarshalJSON(data []byte) (err error) { } {{/isArray}} +{{/vendorExtensions.x-go-generate-unmarshal-json}} {{>nullable_model}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 65c210b7929..ec5d8c742f6 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -151,6 +151,12 @@ {{/model}} {{/models}} + {{#aliasModels}} + {{#model}} + defs["{{name}}"] = {{{modelJson}}}; + {{/model}} + {{/aliasModels}} + var errs = {}; {{#swagger.vendorExtensions.x-shared-errors}} { @@ -445,48 +451,51 @@
    - {{#schema}} -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-{{baseName}}-{{nickname}}-{{code}}-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-{{baseName}}-{{nickname}}-schema-{{code}}'); + result.empty(); + result.append(view.render()); + }); +
    - {{#examples}} -
    -
    {{example}}
    -
    - {{/examples}} - {{/schema}} + +
    + {{#examples}} +
    +
    {{example}}
    +
    + {{/examples}} {{#hasHeaders}}
    @@ -498,7 +507,7 @@ {{#headers}} - + diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonschemaview.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonschemaview.mustache index 0bf2ddd5e61..20f0746201e 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonschemaview.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonschemaview.mustache @@ -133,7 +133,7 @@ var JSONSchemaView = (function () { // Determine if a schema is an array this.isArray = !this.isAny && this.schema && this.schema.type === 'array'; - this.isObject = this.schema && (this.schema.type === 'object' || this.schema.properties || this.schema.anyOf || this.schema.oneof || this.schema.allOf); + this.isObject = this.schema && (this.schema.type === 'object' || this.schema.properties || this.schema.anyOf || this.schema.oneOf || this.schema.allOf); // Determine if a schema is a primitive this.isPrimitive = !this.isAny && !this.isArray && !this.isObject; diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/paramB.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/paramB.mustache index cd0dda30ea3..3ac8ed33fbb 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/paramB.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/paramB.mustache @@ -11,6 +11,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache index 653dbbdf484..212b544b855 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache @@ -85,8 +85,14 @@ +{{^x-helidon-useSmallRyeJandexPlugin}} org.jboss.jandex jandex-maven-plugin +{{/x-helidon-useSmallRyeJandexPlugin}} +{{#x-helidon-useSmallRyeJandexPlugin}} + io.smallrye + jandex-maven-plugin +{{/x-helidon-useSmallRyeJandexPlugin}} make-index diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache index 8a0ef05f222..e8222336a11 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache @@ -68,11 +68,20 @@ junit-jupiter-api test +{{^x-helidon-useMpTesting}} io.helidon.microprofile.tests helidon-microprofile-tests-junit5 test +{{/x-helidon-useMpTesting}} +{{#x-helidon-useMpTesting}} + + io.helidon.microprofile.testing + helidon-microprofile-testing-junit5 + test + +{{/x-helidon-useMpTesting}} @@ -87,8 +96,14 @@ +{{^x-helidon-useSmallRyeJandexPlugin}} org.jboss.jandex jandex-maven-plugin +{{/x-helidon-useSmallRyeJandexPlugin}} +{{#x-helidon-useSmallRyeJandexPlugin}} + io.smallrye + jandex-maven-plugin +{{/x-helidon-useSmallRyeJandexPlugin}} make-index diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index c0cfd07749b..77db3bd6efa 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -29,7 +29,7 @@ 1.4.13 4.13.2 2.1.0-beta.124 - 2.3.5.Final + 2.3.12.Final 2.2.0 4.5.13 4.1.2 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache index dfa555886b2..8d6b5c9733f 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache @@ -3,13 +3,13 @@ version '{{artifactVersion}}' {{^omitGradleWrapper}} wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } {{/omitGradleWrapper}} buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' {{#jvm-ktor}} ext.ktor_version = '2.3.9' {{/jvm-ktor}} @@ -24,17 +24,13 @@ buildscript { {{/jvm-vertx}} {{#jvm-spring}} {{#useSpringBoot3}} - ext.spring_boot_version = "3.2.4" + ext.spring_boot_version = "3.2.5" {{/useSpringBoot3}} {{^useSpringBoot3}} ext.spring_boot_version = "2.7.18" {{/useSpringBoot3}} - {{#jvm-spring-webclient}} - ext.reactor_version = "3.6.4" - {{/jvm-spring-webclient}} {{/jvm-spring}} - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } @@ -167,7 +163,7 @@ dependencies { {{/jvm-okhttp4}} {{#jvm-spring-webclient}} implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" - implementation "io.projectreactor:reactor-core:$reactor_version" + implementation "io.projectreactor:reactor-core:3.6.5" {{/jvm-spring-webclient}} {{#jvm-spring-restclient}} implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" @@ -195,7 +191,7 @@ dependencies { implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion" {{/moshi}} {{#kotlinx_serialization}} - implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" + implementation "com.squareup.retrofit2:converter-kotlinx-serialization:$retrofitVersion" {{/kotlinx_serialization}} {{#jackson}} implementation "com.squareup.retrofit2:converter-jackson:$retrofitVersion" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.jar and b/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.jar differ diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.properties.mustache index 8707e8b5067..6eb2a6bb7b2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.properties.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.properties.mustache @@ -1,6 +1,12 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +{{#jvm-volley}} +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip +{{/jvm-volley}} +{{^jvm-volley}} +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +{{/jvm-volley}} networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.bat.mustache index 93e3f59f135..9d0ce634cb1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.bat.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.bat.mustache @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.mustache index aeb74cbb43e..9d0ce634cb1 100755 --- a/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/gradlew.mustache @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache index 8576bee5b43..d99122333d6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache @@ -59,10 +59,10 @@ import kotlinx.serialization.* {{/imports}} {{#operations}} -{{#x-koltin-import-models}} -import {{{packageName}}}.models.* +{{#x-kotlin-import-models}} +import {{{modelPackage}}}.* -{{/x-koltin-import-models}} +{{/x-kotlin-import-models}} {{#x-kotlin-multipart-import}} {{^isMultipart}} import okhttp3.MultipartBody diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index a2a4a20ae73..1683b45e2ea 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -55,7 +55,7 @@ import retrofit2.converter.jackson.JacksonConverterFactory {{/jackson}} {{#kotlinx_serialization}} -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory +import retrofit2.converter.kotlinx.serialization.asConverterFactory import {{packageName}}.infrastructure.Serializer.kotlinxSerializationJson import okhttp3.MediaType.Companion.toMediaType {{/kotlinx_serialization}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache index 35b33e9d029..7af6f39c4eb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache @@ -67,7 +67,7 @@ import {{packageName}}.infrastructure.* @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { - val result = {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}}val result = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}} return result.body!! {{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache index a34e97f3872..62f0d98e6e3 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache @@ -5,7 +5,7 @@ project.version = '{{artifactVersion}}' buildscript { - ext.kotlin_version = '1.5.10' + ext.kotlin_version = '1.5.20' ext.swagger_annotations_version = "1.6.2" ext.gson_version = "2.8.6" ext.volley_version = "1.2.0" @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:4.0.2' + classpath 'com.android.tools.build:gradle:7.4.2' {{#useAndroidMavenGradlePlugin}} classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' {{/useAndroidMavenGradlePlugin}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index 0badd27d0c1..249f8edbb63 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -99,13 +99,13 @@ import kotlinx.serialization.encoding.* {{/hasBodyParam}} val localVariableQuery = mutableMapOf>(){{#queryParams}} - {{{paramName}}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{{paramName}}}"){{/isContainer}} }{{/queryParams}} + {{{paramName}}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{^isEnum}}"${{{paramName}}}"{{/isEnum}}{{#isEnum}}"${ {{paramName}}.value }"{{/isEnum}}){{/isContainer}} }{{/queryParams}} val localVariableHeaders = mutableMapOf(){{#headerParams}} {{{paramName}}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} }{{/headerParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, - "{{path}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}"${{{paramName}}}"{{/isContainer}}){{/pathParams}}, + "{{path}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{^isEnum}}"${{{paramName}}}"{{/isEnum}}{{#isEnum}}"${ {{paramName}}.value }"{{/isEnum}}{{/isContainer}}){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache index 32cef71d95a..cc08101c2a2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/settings.gradle.mustache @@ -1,2 +1 @@ -{{#multiplatform}}enableFeaturePreview('GRADLE_METADATA'){{/multiplatform}} rootProject.name = '{{artifactId}}' diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/.gitignore.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/.gitignore.mustache new file mode 100644 index 00000000000..2983e3c1db3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/.gitignore.mustache @@ -0,0 +1,106 @@ +./bin/ +# Created by https://www.gitignore.io/api/java,intellij,gradle + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +# End of https://www.gitignore.io/api/java,intellij,gradle diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub-builder.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub-builder.mustache new file mode 100644 index 00000000000..ef98a549fe3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub-builder.mustache @@ -0,0 +1,78 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package {{apiPackage}} + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import {{modelPackage}}.* + +{{#operations}} +{{#operation}} +/** + * Builder for WireMock stubs of operation {{operationId}}. + */ +class {{operationIdCamelCase}}StubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + {{#responses}} + {{^wildcard}} + + /** + * Let the stub for {{operationId}} respond with HTTP status code {{code}}. + * + {{#returnType}} + * @param body response body for the [MappingBuilder]. + {{/returnType}} + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith{{code}}( + {{#returnType}} + body: {{{.}}}, + {{/returnType}} + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus({{code}}) + {{#returnType}} + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + {{/returnType}} + .configurer() + ) + {{/wildcard}} + {{/responses}} + + /** + * Let the stub for {{operationId}} respond with HTTP status code [code]. + * + {{#returnType}} + * @param body response body for the [MappingBuilder]. + {{/returnType}} + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +{{/operation}} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache new file mode 100644 index 00000000000..804e2313496 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache @@ -0,0 +1,47 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package {{apiPackage}} + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import {{modelPackage}}.* + +{{#operations}} +/** + * WireMock stub request builder. + */ +open class {{classname}}Stubs(private val objectMapper: ObjectMapper) { +{{#operation}} + + /** + * Construct a stub for the operation {{operationId}}. + * + {{#pathParams}} + * @param {{paramName}} path parameter {{paramName}} pattern. + {{/pathParams}} + {{#queryParams}} + * @param {{paramName}} query parameter {{paramName}} pattern. + {{/queryParams}} + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [{{operationIdCamelCase}}StubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun {{operationId}}({{#pathParams}}{{paramName}}: StringValuePattern, {{/pathParams}}{{#queryParams}}{{paramName}}: StringValuePattern? = null, {{/queryParams}}configurer: MappingBuilder.() -> MappingBuilder = { this }): {{operationIdCamelCase}}StubBuilder = + {{operationIdCamelCase}}StubBuilder(objectMapper, {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(urlPathTemplate("{{path}}")) + {{#pathParams}} + .withPathParam("{{paramName}}", {{paramName}}) + {{/pathParams}} + {{#queryParams}} + .apply { {{paramName}}?.let { withQueryParam("{{paramName}}", it) } } + {{/queryParams}} + .configurer() + ) +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/build.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/build.gradle.kts.mustache new file mode 100644 index 00000000000..776d58d1be9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/build.gradle.kts.mustache @@ -0,0 +1,21 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "{{groupId}}" +version = "{{artifactVersion}}" + +tasks.wrapper { + gradleVersion = "8.7" +} + +plugins { + alias(libs.plugins.kotlin.jvm) +} + +tasks.withType { + kotlinOptions.jvmTarget = "11" +} + +dependencies { + implementation(libs.wiremock) + implementation(libs.jackson.databind) +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.jar b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.jar new file mode 100644 index 00000000000..d64cd491770 Binary files /dev/null and b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.jar differ diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.properties.mustache new file mode 100644 index 00000000000..e7646dead06 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradle-wrapper.properties.mustache @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.bat.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.bat.mustache new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.bat.mustache @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.mustache new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/gradlew.mustache @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/libs.versions.toml.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/libs.versions.toml.mustache new file mode 100644 index 00000000000..23fdd0ddbc1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/libs.versions.toml.mustache @@ -0,0 +1,10 @@ +[versions] +kotlin = "1.9.23" +wiremock = "3.5.4" + +[libraries] +wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version = "2.17.1" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache new file mode 100644 index 00000000000..c060ec50935 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache @@ -0,0 +1,33 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package {{modelPackage}} + +import com.fasterxml.jackson.annotation.JsonProperty + +{{#models}} +{{#model}} +{{#isEnum}} +enum class {{classname}} { + {{#allowableValues}} + {{#enumVars}} + @JsonProperty(value = {{#lambda.doublequote}}{{{value}}}{{/lambda.doublequote}}) {{&name}}, + {{/enumVars}} + {{/allowableValues}} +} +{{/isEnum}} +{{^isEnum}} +data class {{classname}}( + {{#allVars}} + @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + val {{{name}}}: {{{dataType}}}{{^required}}?{{/required}}{{! + !}}{{^required}} = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{{.}}}{{/defaultValue}}{{/required}}{{! + }}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}, + + {{/allVars}} +) +{{/isEnum}} +{{/model}} +{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/settings.gradle.kts.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/settings.gradle.kts.mustache new file mode 100644 index 00000000000..25e0c476492 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/settings.gradle.kts.mustache @@ -0,0 +1,7 @@ +rootProject.name = "{{artifactId}}" + +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-flight/README.mustache b/modules/openapi-generator/src/main/resources/php-flight/README.mustache new file mode 100644 index 00000000000..d510c3a5535 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/README.mustache @@ -0,0 +1,10 @@ +## Requirements + +PHP 8.1 and later + +## Installation & Usage + +1. Set up flight as usual - see [Flight documentation](https://docs.flightphp.com/install) +2. Generate using the OpenAPI generator +3. Subclass some/all generated `Abstract*Api` and overwrite the methods you'd like handled. When implementing the `*Stream` methods, make sure to stream the response and not implement the non-stream method. +4. Register routes for your subclassed apis: `RegisterRoutes::registerRoutes(new MyApiHandler());` diff --git a/modules/openapi-generator/src/main/resources/php-flight/api.mustache b/modules/openapi-generator/src/main/resources/php-flight/api.mustache new file mode 100644 index 00000000000..9824f8f8697 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/api.mustache @@ -0,0 +1,58 @@ +licenseInfo}} + +namespace {{apiPackage}}; + + +{{#operations}}abstract class {{classname}} +{ + + {{#operation}} + /** + * Operation {{{operationId}}} + * + * Path: `{{{path}}}` + * + {{#summary}} + * {{{summary}}} + * + {{/summary}} + {{#vendorExtensions.x-nonFormParams}} + * @param {{vendorExtensions.x-parameter-type}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/vendorExtensions.x-nonFormParams}} + * + * @return {{vendorExtensions.x-return-type-comment}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}({{#vendorExtensions.x-nonFormParams}}{{vendorExtensions.x-parameter-type}} ${{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-nonFormParams}}): {{vendorExtensions.x-return-type}} + { + throw new \Exception('Not implemented'); + } + + /** + * Operation {{{operationId}}} (stream) + * + * Path: `{{{path}}}` + * + {{#summary}} + * {{{summary}}} + * + {{/summary}} + {{#vendorExtensions.x-nonFormParams}} + * @param {{vendorExtensions.x-parameter-type}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/vendorExtensions.x-nonFormParams}} + * + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}Stream({{#vendorExtensions.x-nonFormParams}}{{vendorExtensions.x-parameter-type}} ${{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-nonFormParams}}): void + { + throw new \Exception('Not implemented'); + } +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/php-flight/composer.mustache b/modules/openapi-generator/src/main/resources/php-flight/composer.mustache new file mode 100644 index 00000000000..d922daab923 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/composer.mustache @@ -0,0 +1,39 @@ +{ + {{#composerPackageName}} + "name": "{{{.}}}", + {{/composerPackageName}} + "description": "{{appDescription}}.", + "keywords": ["openapi", "php", "framework", "flightphp"], + {{#artifactVersion}} + "version": "{{.}}", + {{/artifactVersion}} + "homepage": "{{{artifactUrl}}}", + "license": "{{{licenseName}}}", + "authors": [ + { + "name": "{{{developerOrganization}}}", + "homepage": "{{{developerOrganizationUrl}}}" + } + ], + "type": "library", + "require": { + "php": "^8.1.0", + "flightphp/core": "^3.5.1", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "autoload": { + "psr-4": { + "{{escapedInvokerPackage}}\\": "" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/openapi-generator/src/main/resources/php-flight/gitignore b/modules/openapi-generator/src/main/resources/php-flight/gitignore new file mode 100644 index 00000000000..931a98c71bd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/gitignore @@ -0,0 +1,28 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# phplint tool creates cache file which is not necessary in a codebase +/.phplint-cache + +# Do not commit local PHPUnit config +/phpunit.xml +/.phpunit.result.cache + +# Do not commit local PHP_CodeSniffer config +/phpcs.xml + +# Application config may contain sensitive data +/config/**/*.* +!/config/.htaccess +!/config/dev/default.inc.php +!/config/prod/default.inc.php + +# Logs folder +/logs/**/*.* +!/logs/.htaccess diff --git a/modules/openapi-generator/src/main/resources/php-flight/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/php-flight/licenseInfo.mustache new file mode 100644 index 00000000000..c10b59eaab8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/licenseInfo.mustache @@ -0,0 +1,23 @@ +/** + {{#appName}} + * {{{.}}} + {{/appName}} + * PHP version 8.x + * + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://github.com/openapitools/openapi-generator + */ + +/** + {{#appDescription}} + * {{{.}}} + {{/appDescription}} + {{#version}} + * The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{.}}} + {{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + */ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-flight/model.mustache b/modules/openapi-generator/src/main/resources/php-flight/model.mustache new file mode 100644 index 00000000000..c0fd08c25c5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/model.mustache @@ -0,0 +1,31 @@ +partial_header}} + +namespace {{modelPackage}}; + +/** + * Class representing the {{classname}} model. + * +{{#description}} + * {{.}} + * +{{/description}} + * @package {{modelPackage}} + * @author OpenAPI Generator team + */ +{{#isEnum}}{{>model_enum}}{{/isEnum}} +{{^isEnum}}{{>model_generic}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/php-flight/model_enum.mustache b/modules/openapi-generator/src/main/resources/php-flight/model_enum.mustache new file mode 100644 index 00000000000..b12428b10e2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/model_enum.mustache @@ -0,0 +1,8 @@ +enum {{classname}}: {{dataType}} +{ +{{#allowableValues}} + {{#enumVars}} + case {{{name}}} = {{{value}}}; + {{/enumVars}} +{{/allowableValues}} +} diff --git a/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache new file mode 100644 index 00000000000..9748119501d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache @@ -0,0 +1,90 @@ +class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} implements \JsonSerializable +{ + {{#vars}}{{>model_variables}} + {{/vars}} + /** + * Constructor + * +{{#vars}} + * @param {{vendorExtensions.x-comment-type}} ${{name}} +{{/vars}} + */ + public function __construct({{#vars}}{{vendorExtensions.x-parameter-type}} ${{name}}{{^-last}}, {{/-last}}{{/vars}}) + { + {{#vars}} + $this->{{name}} = ${{name}}; + {{/vars}} + } + + public static function fromArray(array $data): self + { + return new self( + {{#vars}} + {{#isDateTime}} + isset($data['{{baseName}}']) ? new \DateTime($data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/isDateTime}} + {{#isEnum}} + isset($data['{{baseName}}']) ? {{enumName}}::tryFrom($data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/isEnum}} + {{#isEnumRef}} + isset($data['{{baseName}}']) ? {{complexType}}::tryFrom($data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/isEnumRef}} + {{#isModel}} + isset($data['{{baseName}}']) ? {{complexType}}::fromArray($data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/isModel}} + {{#isArray}} + {{#items.isEnumRef}} + isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::tryFrom($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/items.isEnumRef}} + {{#items.isModel}} + isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::fromArray($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/items.isModel}} + {{#items.isDateTime}} + isset($data['{{baseName}}']) ? array_map(fn($item) => new \DateTime($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + {{/items.isDateTime}} + {{^items.isEnumRef}} + {{^items.isModel}} + {{^items.isDateTime}} + $data['{{baseName}}'] ?? null{{^last}}, {{/last}} + {{/items.isDateTime}} + {{/items.isModel}} + {{/items.isEnumRef}} + {{/isArray}} + {{^isEnumRef}} + {{^isEnum}} + {{^isModel}} + {{^isArray}} + {{^isDateTime}} + $data['{{baseName}}'] ?? null{{^last}}, {{/last}} + {{/isDateTime}} + {{/isArray}} + {{/isModel}} + {{/isEnum}} + {{/isEnumRef}} + {{/vars}} + ); + } + + public function jsonSerialize(): mixed { + return [ + {{#vars}} + {{#isDateTime}} + '{{baseName}}' => $this->{{name}}?->format('c'){{^last}}, {{/last}} + {{/isDateTime}} + {{#isArray}} + {{#items.isDateTime}} + '{{baseName}}' => $this->{{name}} ? array_map(fn($item) => $item->format('c'), $this->{{name}}) : null{{^last}}, {{/last}} + {{/items.isDateTime}} + {{^items.isDateTime}} + '{{baseName}}' => $this->{{name}}{{^last}}, {{/last}} + {{/items.isDateTime}} + {{/isArray}} + {{^isDateTime}} + {{^isArray}} + '{{baseName}}' => $this->{{name}}{{^last}}, {{/last}} + {{/isArray}} + {{/isDateTime}} + {{/vars}} + ]; + } +} diff --git a/modules/openapi-generator/src/main/resources/php-flight/model_variables.mustache b/modules/openapi-generator/src/main/resources/php-flight/model_variables.mustache new file mode 100644 index 00000000000..259ce295ea7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/model_variables.mustache @@ -0,0 +1,113 @@ + /** + {{#description}} + * {{.}} + * + {{/description}} + * @var {{{vendorExtensions.x-comment-type}}} + * @SerializedName("{{baseName}}") +{{#required}} + * @Assert\NotNull() + {{^isPrimitiveType}} + * @Assert\Valid() + {{/isPrimitiveType}} +{{/required}} +{{#isEnum}} + {{#isContainer}} + * @Assert\All({ + {{#items}} + * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }) + {{/items}} + * }) + {{/isContainer}} + {{^isContainer}} + * @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }) + {{/isContainer}} +{{/isEnum}} +{{#isContainer}} + * @Assert\All({ + {{#items}} + * @Assert\Type("{{dataType}}") + {{/items}} + * }) + {{#isMap}} + {{#items}} + * @Type("array") + {{/items}} + {{/isMap}} + {{^isMap}} + {{#items}} + {{#isEnumRef}} + * @Accessor(getter="getSerialized{{nameInPascalCase}}") + * @Type("array") + {{/isEnumRef}} + {{^isEnumRef}} + * @Type("array<{{dataType}}>") + {{/isEnumRef}} + {{/items}} + {{/isMap}} +{{/isContainer}} +{{^isContainer}} + {{#isDate}} + * @Assert\Type("\Date") + * @Type("DateTime<'Y-m-d'>") + {{/isDate}} + {{#isDateTime}} + * @Assert\Type("\DateTime")) + * @Type("DateTime") + {{/isDateTime}} + {{#isEnumRef}} + * @Accessor(getter="getSerialized{{nameInPascalCase}}") + * @Type("string") + {{/isEnumRef}} + {{^isDate}} + {{^isDateTime}} + {{^isEnumRef}} + * @Assert\Type("{{dataType}}") + * @Type("{{dataType}}") + {{/isEnumRef}} + {{/isDateTime}} + {{/isDate}} +{{/isContainer}} +{{#hasValidation}} + {{#maxLength}} + * @Assert\Length( + * max = {{.}} + * ) + {{/maxLength}} + {{#minLength}} + * @Assert\Length( + * min = {{.}} + * ) + {{/minLength}} + {{#minimum}} + {{#exclusiveMinimum}} + * @Assert\GreaterThan({{minimum}}) + {{/exclusiveMinimum}} + {{^exclusiveMinimum}} + * @Assert\GreaterThanOrEqual({{minimum}}) + {{/exclusiveMinimum}} + {{/minimum}} + {{#maximum}} + {{#exclusiveMaximum}} + * @Assert\LessThan({{maximum}}) + {{/exclusiveMaximum}} + {{^exclusiveMaximum}} + * @Assert\LessThanOrEqual({{maximum}}) + {{/exclusiveMaximum}} + {{/maximum}} + {{#pattern}} + * @Assert\Regex("/{{.}}/") + {{/pattern}} + {{#maxItems}} + * @Assert\Count( + * max = {{.}} + * ) + {{/maxItems}} + {{#minItems}} + * @Assert\Count( + * min = {{.}} + * ) + {{/minItems}} +{{/hasValidation}} + */ + public {{{vendorExtensions.x-parameter-type}}} ${{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; diff --git a/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache b/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache new file mode 100644 index 00000000000..01bb4a845c9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache @@ -0,0 +1,14 @@ +/** + {{#appName}} + * {{{.}}} + * + {{/appName}} + {{#appDescription}} + * {{{.}}} + * + {{/appDescription}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * Generated by: https://github.com/openapitools/openapi-generator.git + * + */ diff --git a/modules/openapi-generator/src/main/resources/php-flight/phpunit.mustache b/modules/openapi-generator/src/main/resources/php-flight/phpunit.mustache new file mode 100644 index 00000000000..f7df0c08377 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/phpunit.mustache @@ -0,0 +1,28 @@ + + + + + {{#lambda.forwardslash}}{{apiSrcPath}}{{/lambda.forwardslash}} + {{#lambda.forwardslash}}{{modelSrcPath}}{{/lambda.forwardslash}} + . + + + {{#lambda.forwardslash}}{{testSrcPath}}{{/lambda.forwardslash}} + + + + + {{#lambda.forwardslash}}{{testSrcPath}}{{/lambda.forwardslash}} + + + + + + diff --git a/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache new file mode 100644 index 00000000000..1056f6be4c8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache @@ -0,0 +1,86 @@ +licenseInfo}} + +namespace {{invokerPackage}}; +{{#apiInfo}} + +class RegisterRoutes { + + static public function registerRoutes({{#apis}}\{{apiPackage}}\{{classname}}{{^-last}}|{{/-last}}{{/apis}} $handler): void + { + $reflectionClass = new \ReflectionClass($handler); + + {{#apis}} + {{#operations}} + {{#operation}} + if (declaresMethod($reflectionClass, '{{operationId}}') && declaresMethod($reflectionClass, '{{operationId}}Stream')) { + throw new \Exception('Operation {{operationId}} cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, '{{operationId}}')) { + \Flight::route('{{httpMethod}} {{vendorExtensions.x-path}}', function ({{#pathParams}}string ${{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) use ($handler) { + $r = \Flight::request(); + {{^vendorExtensions.x-return-type-is-void}}$result = {{/vendorExtensions.x-return-type-is-void}}$handler->{{operationId}}( + {{#vendorExtensions.x-nonFormParams}} + parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}}, {{/-last}} + {{/vendorExtensions.x-nonFormParams}} + ); + {{^vendorExtensions.x-return-type-is-void}} + if ($result === null) { + \Flight::halt({{{vendorExtensions.x-default-status-code}}}); + } else { + \Flight::json($result, {{{vendorExtensions.x-default-status-code}}}); + } + {{/vendorExtensions.x-return-type-is-void}} + {{#vendorExtensions.x-return-type-is-void}} + \Flight::halt({{{vendorExtensions.x-default-status-code}}}); + {{/vendorExtensions.x-return-type-is-void}} + }); + } + if (declaresMethod($reflectionClass, '{{operationId}}Stream')) { + \Flight::route('{{httpMethod}} {{vendorExtensions.x-path}}', function ({{#pathParams}}string ${{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) use ($handler) { + $r = \Flight::request(); + $handler->{{operationId}}Stream( + {{#vendorExtensions.x-nonFormParams}} + parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}}, {{/-last}} + {{/vendorExtensions.x-nonFormParams}} + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => {{{vendorExtensions.x-default-status-code}}}{{#vendorExtensions.x-default-media-type}}, 'Content-Type' => '{{{vendorExtensions.x-default-media-type}}}'{{/vendorExtensions.x-default-media-type}}]); + } + + {{/operation}} + {{/operations}} + {{/apis}} + } +} + +{{/apiInfo}} + +function parseParam(mixed $param, string $type) +{ + $nonNullType = str_replace('?', '', $type); + if ($param === null) { + return null; + } elseif ($nonNullType === 'int') { + return intval($param); + } elseif ($nonNullType === 'float') { + return floatval($param); + } elseif ($nonNullType === 'bool') { + return filter_var($param, FILTER_VALIDATE_BOOLEAN); + } elseif (str_ends_with($type, '[]')) { + return array_map(fn($el) => parseParam($el, substr($type, 0, -2)), $param); + } elseif (str_starts_with($nonNullType, '\\{{escapedModelPackage}}')) { + if (enum_exists($nonNullType)) { + return $nonNullType::tryFrom($param); + } + return $nonNullType::fromArray($param); + } else { + return $param; + } +} + +function declaresMethod(\ReflectionClass $reflectionClass, string $methodName): bool +{ + return $reflectionClass->hasMethod($methodName) && $reflectionClass->getMethod($methodName)->getDeclaringClass()->getName() === $reflectionClass->getName(); +} diff --git a/modules/openapi-generator/src/main/resources/php-flight/register_routes_test.mustache b/modules/openapi-generator/src/main/resources/php-flight/register_routes_test.mustache new file mode 100644 index 00000000000..ad45d9fcca6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-flight/register_routes_test.mustache @@ -0,0 +1,53 @@ +licenseInfo}} + +{{#apiInfo}} +namespace {{testPackage}}; + +use function {{invokerPackage}}\parseParam; + +class RegisterRoutesTest extends \PHPUnit\Framework\TestCase { +{{#apis}} + public function testRegisterRoutes{{classname}}(): void + { + $handler = new class extends \{{apiPackage}}\{{classname}} { + {{#operations}} + {{#operation}} + {{#-first}} + public function {{operationId}}({{#vendorExtensions.x-nonFormParams}}{{^isFormParam}}{{vendorExtensions.x-parameter-type}} ${{paramName}}{{^-last}}, {{/-last}}{{/isFormParam}}{{/vendorExtensions.x-nonFormParams}}): {{vendorExtensions.x-return-type}} + { + {{^vendorExtensions.x-return-type-is-void}} + return null; + {{/vendorExtensions.x-return-type-is-void}} + } + {{/-first}} + {{/operation}} + {{/operations}} + }; + \{{invokerPackage}}\RegisterRoutes::registerRoutes($handler); + $this->assertTrue(true); + } +{{/apis}} +{{#models}} +{{#model}} +{{#isEnum}} + public function testParseParamsEnum{{classname}}(): void + { + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + $value = {{{value}}}; + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + $this->assertEquals( + parseParam($value, '\\{{escapedModelPackage}}\\{{classname}}'), + \{{modelPackage}}\{{classname}}::{{#allowableValues}}{{#enumVars}}{{#-first}}{{{name}}}{{/-first}}{{/enumVars}}{{/allowableValues}} + ); + } +{{/isEnum}} +{{/model}} +{{/models}} +} +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache index b48c1b911ec..5970d93dc95 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/ObjectSerializer.mustache @@ -529,22 +529,61 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - array|object $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache index b74fa68699c..455b5586ef7 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/Controller.mustache @@ -92,7 +92,7 @@ class Controller extends AbstractController $json = $this->exceptionToArray($exception); $json['statusCode'] = $statusCode; - return new Response(json_encode($json, 15, 512), $statusCode, $headers); + return new Response(json_encode($json, 15), $statusCode, $headers); } /** @@ -219,7 +219,7 @@ class Controller extends AbstractController public static function isContentTypeAllowed(Request $request, array $consumes = []): bool { if (!empty($consumes) && $consumes[0] !== '*/*') { - $currentFormat = $request->getContentType(); + $currentFormat = $request->getContentTypeFormat(); foreach ($consumes as $mimeType) { // canonize mime type if (is_string($mimeType) && false !== $pos = strpos($mimeType, ';')) { @@ -230,7 +230,7 @@ class Controller extends AbstractController // add custom format to request $format = $mimeType; $request->setFormat($format, $format); - $currentFormat = $request->getContentType(); + $currentFormat = $request->getContentTypeFormat(); } if ($format === $currentFormat) { diff --git a/modules/openapi-generator/src/main/resources/php-symfony/api_controller.mustache b/modules/openapi-generator/src/main/resources/php-symfony/api_controller.mustache index 71537426771..9dd5c4ef18a 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/api_controller.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/api_controller.mustache @@ -101,6 +101,10 @@ class {{controllerName}} extends Controller // HTTP basic authentication required $security{{name}} = $request->headers->get('authorization'); {{/isBasicBasic}} + {{#isBasicBearer}} + // HTTP bearer authentication required + $security{{name}} = $request->headers->get('authorization'); + {{/isBasicBearer}} {{#isOAuth}} // Oauth required $security{{name}} = $request->headers->get('authorization'); @@ -148,7 +152,7 @@ class {{controllerName}} extends Controller {{#allParams}} {{^isFile}} {{#isBodyParam}} - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); ${{paramName}} = $this->deserialize(${{paramName}}, '{{#isContainer}}{{#items}}array<{{dataType}}>{{/items}}{{/isContainer}}{{^isContainer}}{{#isEnumRef}}\{{modelPackage}}\{{dataType}}{{/isEnumRef}}{{^isEnumRef}}{{dataType}}{{/isEnumRef}}{{/isContainer}}', $inputFormat); {{/isBodyParam}} {{^isBodyParam}} @@ -178,17 +182,12 @@ class {{controllerName}} extends Controller {{#returnType}}$result = {{/returnType}}$handler->{{operationId}}({{#allParams}}${{paramName}}, {{/allParams}}$responseCode, $responseHeaders); - // Find default response message - $message = '{{#responses}}{{#isDefault}}{{message}}{{/isDefault}}{{/responses}}'; - - // Find a more specific message, if available - switch ($responseCode) { + $message = match($responseCode) { {{#responses}} - case {{code}}: - $message = '{{message}}'; - break; + {{code}} => '{{message}}', {{/responses}} - } + default => '{{#responses}}{{#isDefault}}{{message}}{{/isDefault}}{{/responses}}', + }; return new Response( {{#returnType}}$result !== null ?$this->serialize($result, $responseFormat):''{{/returnType}}{{^returnType}}''{{/returnType}}, diff --git a/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache b/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache index 2e66acfed8d..026bd4fb3ac 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/composer.mustache @@ -24,19 +24,19 @@ } ], "require": { - "php": ">=7.4.0|>=8.0.2", + "php": ">=8.1", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "symfony/validator": "^5.0|^6.0", - "jms/serializer-bundle": "^4.0", - "symfony/framework-bundle": "^5.0|^6.0" + "symfony/validator": "^6.4|^7.0", + "jms/serializer-bundle": "^5.4", + "symfony/framework-bundle": "^6.4|^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", - "friendsofphp/php-cs-fixer": "^2.16.3", - "symfony/browser-kit": "^5.0|^6.0", - "symfony/yaml": "^5.0|^6.0", + "phpunit/phpunit": "^10.5|^11.0", + "friendsofphp/php-cs-fixer": "*", + "symfony/browser-kit": "^6.4|7.0", + "symfony/yaml": "^6.4|^7.0", "hoa/regex": "~1.0" }, "autoload": { diff --git a/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache b/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache index 62f167951e1..e5ff50c3f7f 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/serialization/JmsSerializer.mustache @@ -47,14 +47,11 @@ class JmsSerializer implements SerializerInterface private function convertFormat(string $format): ?string { - switch ($format) { - case 'application/json': - return 'json'; - case 'application/xml': - return 'xml'; - } - - return null; + return match($format) { + 'application/json' => 'json', + 'application/xml' => 'xml', + default => null, + }; } private function deserializeString($data, string $type) @@ -132,22 +129,13 @@ class JmsSerializer implements SerializerInterface } // Parse the string using the correct separator - switch ($format) { - case 'csv': - $data = explode(',', $data); - break; - case 'ssv': - $data = explode(' ', $data); - break; - case 'tsv': - $data = explode("\t", $data); - break; - case 'pipes': - $data = explode('|', $data); - break; - default; - $data = []; - } + $data = match($format) { + 'csv' => explode(',', $data), + 'ssv' => explode(' ', $data), + 'tsv' => explode("\t", $data), + 'pipes' => explode('|', $data), + default => [], + }; // Deserialize each of the array elements foreach ($data as $key => $item) { diff --git a/modules/openapi-generator/src/main/resources/php-symfony/testing/ControllerTest.mustache b/modules/openapi-generator/src/main/resources/php-symfony/testing/ControllerTest.mustache index e4d5039db84..ac285dd0fca 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/testing/ControllerTest.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/testing/ControllerTest.mustache @@ -55,7 +55,7 @@ class ControllerTest extends TestCase ); } - public function dataProviderIsContentTypeAllowed(): array + public static function dataProviderIsContentTypeAllowed(): array { return [ 'usual JSON content type' => [ diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 6fe5101c306..a5f75dddcba 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -536,22 +536,64 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache index 16c6a900bb5..6138ab17660 100644 --- a/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/libraries/psr-18/api.mustache @@ -19,7 +19,6 @@ namespace {{apiPackage}}; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -643,7 +642,7 @@ use function sprintf; } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -762,7 +761,7 @@ use function sprintf; ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/model_doc.mustache index deb49f24884..1a745348960 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/model_doc.mustache @@ -26,7 +26,7 @@ print {{classname}}.to_json() # convert the object into a dict {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict() # create an instance of {{classname}} from a dict -{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_form_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache b/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache index d8e19d7ac0f..b54bc7478ed 100644 --- a/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-fastapi/requirements.mustache @@ -5,7 +5,7 @@ async-generator==1.10 certifi==2023.7.22 chardet==4.0.0 click==7.1.2 -dnspython==2.1.0 +dnspython==2.6.1 email-validator==2.0.0 fastapi==0.109.2 graphene==2.1.8 @@ -14,9 +14,9 @@ graphql-relay==2.0.1 h11==0.12.0 httptools==0.1.2 httpx==0.24.1 -idna==2.10 +idna==3.7 itsdangerous==1.1.0 -Jinja2==2.11.3 +Jinja2==3.1.4 MarkupSafe==2.0.1 orjson==3.9.15 promise==2.3 @@ -24,7 +24,7 @@ pydantic>=2 python-dotenv==0.17.1 python-multipart==0.0.7 PyYAML==5.4.1 -requests==2.31.0 +requests==2.32.0 Rx==1.6.1 starlette==0.36.3 typing-extensions==4.8.0 diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_doc.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_doc.mustache index dd54470b3be..1f8d55555f7 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_doc.mustache @@ -25,7 +25,7 @@ print {{classname}}.to_json() # convert the object into a dict {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict() # create an instance of {{classname}} from a dict -{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_form_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache index 87b793dc8f7..9a24a9b6553 100644 --- a/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python-pydantic-v1/model_generic.mustache @@ -237,7 +237,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) {{#mappedModels}} - if object_type == '{{{mappingName}}}': + if object_type == '{{{modelName}}}': return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) {{/mappedModels}} raise ValueError("{{{classname}}} failed to lookup discriminator value from " + diff --git a/modules/openapi-generator/src/main/resources/python/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/model_doc.mustache index eff8f21e3e0..6099ddf1954 100644 --- a/modules/openapi-generator/src/main/resources/python/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_doc.mustache @@ -26,7 +26,7 @@ print({{classname}}.to_json()) # convert the object into a dict {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict() # create an instance of {{classname}} from a dict -{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_form_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) ``` {{/isEnum}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/python/model_generic.mustache b/modules/openapi-generator/src/main/resources/python/model_generic.mustache index 1612beeddcf..fb9ece0f463 100644 --- a/modules/openapi-generator/src/main/resources/python/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_generic.mustache @@ -253,7 +253,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) {{#mappedModels}} - if object_type == '{{{mappingName}}}': + if object_type == '{{{modelName}}}': return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) {{/mappedModels}} diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache index cb9205691b6..89fbba0e086 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache @@ -64,7 +64,7 @@ module {{moduleName}} # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -143,7 +143,7 @@ module {{moduleName}} # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache b/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache new file mode 100644 index 00000000000..c8d342c2528 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-axum/apis-mod.mustache @@ -0,0 +1,6 @@ +{{#apiInfo}} +{{#apis}} +pub mod {{classFilename}}; +{{/apis}} +{{/apiInfo}} + diff --git a/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache new file mode 100644 index 00000000000..5f3253ac5c4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-axum/apis.mustache @@ -0,0 +1,74 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +{{#operations}} +{{#operation}} +{{>response}} +{{/operation}} +{{/operations}} + +{{#operations}} +/// {{classnamePascalCase}} +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait {{classnamePascalCase}} { +{{#operation}} + {{#summary}} + /// {{{.}}}. + /// + {{/summary}} + {{#vendorExtensions}} + /// {{{operationId}}} - {{{httpMethod}}} {{{basePathWithoutHost}}}{{{path}}} + async fn {{{x-operation-id}}}( + &self, + method: Method, + host: Host, + cookies: CookieJar, + {{#headerParams.size}} + header_params: models::{{{operationIdCamelCase}}}HeaderParams, + {{/headerParams.size}} + {{#pathParams.size}} + path_params: models::{{{operationIdCamelCase}}}PathParams, + {{/pathParams.size}} + {{#queryParams.size}} + query_params: models::{{{operationIdCamelCase}}}QueryParams, + {{/queryParams.size}} + {{^x-consumes-multipart-related}} + {{^x-consumes-multipart}} + {{#bodyParam}} + {{#vendorExtensions}} + {{^x-consumes-plain-text}} + body: {{^required}}Option<{{/required}}{{{dataType}}}{{^required}}>{{/required}}, + {{/x-consumes-plain-text}} + {{#x-consumes-plain-text}} + {{#isString}} + body: String, + {{/isString}} + {{^isString}} + body: Bytes, + {{/isString}} + {{/x-consumes-plain-text}} + {{/vendorExtensions}} + {{/bodyParam}} + {{/x-consumes-multipart}} + {{/x-consumes-multipart-related}} + {{#x-consumes-multipart}} + body: Multipart, + {{/x-consumes-multipart}} + {{#x-consumes-multipart-related}} + body: axum::body::Body, + {{/x-consumes-multipart-related}} + ) -> Result<{{{operationId}}}Response, String>; + {{/vendorExtensions}} + {{^-last}} + + {{/-last}} +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/rust-axum/header.mustache b/modules/openapi-generator/src/main/resources/rust-axum/header.mustache index 4d1cc4c6dcc..36bfcf45f7b 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/header.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/header.mustache @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, fmt, ops::Deref}; +use std::{convert::TryFrom, fmt, ops::Deref{{#renderUuidConversionImpl}}, str::FromStr{{/renderUuidConversionImpl}}}; use chrono::{DateTime, Utc}; use http::HeaderValue; @@ -178,3 +178,39 @@ impl TryFrom>> for HeaderValue { } } } + +{{#renderUuidConversionImpl}} +// uuid::Uuid + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match uuid::Uuid::from_str(hdr_value) { + Ok(uuid) => Ok(IntoHeaderValue(uuid)), + Err(e) => Err(format!("Unable to parse: {} as uuid - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert header {:?} to string {}", + hdr_value, e + )), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_bytes(hdr_value.0.as_bytes()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} to a header: {}", + hdr_value, e + )), + } + } +} + +{{/renderUuidConversionImpl}} diff --git a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache index d96088f86a4..7f197ef5f0f 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/lib.mustache @@ -6,102 +6,25 @@ unused_extern_crates, non_camel_case_types, unused_imports, - unused_attributes + unused_attributes, +)] +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; pub const BASE_PATH: &str = "{{{basePathWithoutHost}}}"; {{#appVersion}} pub const API_VERSION: &str = "{{{.}}}"; {{/appVersion}} -{{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} - {{>response}} - {{/operation}} - {{/operations}} - {{/apis}} -{{/apiInfo}} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { -{{#apiInfo}} - {{#apis}} - {{#operations}} - {{#operation}} - - {{#summary}} - /// {{{.}}}. - /// - {{/summary}} - {{#vendorExtensions}} - /// {{{operationId}}} - {{{httpMethod}}} {{{basePathWithoutHost}}}{{{path}}} - async fn {{{x-operation-id}}}( - &self, - method: Method, - host: Host, - cookies: CookieJar, - {{#headerParams.size}} - header_params: models::{{{operationIdCamelCase}}}HeaderParams, - {{/headerParams.size}} - {{#pathParams.size}} - path_params: models::{{{operationIdCamelCase}}}PathParams, - {{/pathParams.size}} - {{#queryParams.size}} - query_params: models::{{{operationIdCamelCase}}}QueryParams, - {{/queryParams.size}} - {{^x-consumes-multipart-related}} - {{^x-consumes-multipart}} - {{#bodyParam}} - {{#vendorExtensions}} - {{^x-consumes-plain-text}} - body: {{^required}}Option<{{/required}}{{{dataType}}}{{^required}}>{{/required}}, - {{/x-consumes-plain-text}} - {{#x-consumes-plain-text}} - {{#isString}} - body: String, - {{/isString}} - {{^isString}} - body: Bytes, - {{/isString}} - {{/x-consumes-plain-text}} - {{/vendorExtensions}} - {{/bodyParam}} - {{/x-consumes-multipart}} - {{/x-consumes-multipart-related}} - {{#x-consumes-multipart}} - body: Multipart, - {{/x-consumes-multipart}} - {{#x-consumes-multipart-related}} - body: axum::body::Body, - {{/x-consumes-multipart-related}} - ) -> Result<{{{operationId}}}Response, String>; - {{/vendorExtensions}} - - {{/operation}} - {{/operations}} - {{/apis}} -{{/apiInfo}} -} - #[cfg(feature = "server")] pub mod server; pub mod models; pub mod types; +pub mod apis; #[cfg(feature = "server")] pub(crate) mod header; diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache index a460237f55d..28e323564d5 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-imports.mustache @@ -10,4 +10,4 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; +use crate::{apis, models}; diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-mod.mustache index 69a703ca070..90662711827 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-mod.mustache @@ -1,14 +1,13 @@ {{>server-imports}} -use crate::{Api{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, - {{{operationId}}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} -}; {{>server-route}} {{#apiInfo}} {{#apis}} {{#operations}} {{#operation}} +{{^disableValidator}} {{>server-operation-validate}} +{{/disableValidator}} {{>server-operation}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache index 5ed29495424..c33a490b163 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-operation.mustache @@ -47,7 +47,7 @@ async fn {{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::{{classFilename}}::{{classnamePascalCase}}, { {{#headerParams}} {{#-first}} @@ -187,7 +187,7 @@ where let resp = match result { Ok(rsp) => match rsp { {{#responses}} - {{{operationId}}}Response::{{#vendorExtensions}}{{x-response-id}}{{/vendorExtensions}} + apis::{{classFilename}}::{{{operationId}}}Response::{{#vendorExtensions}}{{x-response-id}}{{/vendorExtensions}} {{#dataType}} {{^headers}} (body) diff --git a/modules/openapi-generator/src/main/resources/rust-axum/server-route.mustache b/modules/openapi-generator/src/main/resources/rust-axum/server-route.mustache index 2a17022c2c0..ab5204cc4ff 100644 --- a/modules/openapi-generator/src/main/resources/rust-axum/server-route.mustache +++ b/modules/openapi-generator/src/main/resources/rust-axum/server-route.mustache @@ -2,7 +2,7 @@ pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: {{#apiInfo}}{{#apis}}{{#operations}}apis::{{classFilename}}::{{classnamePascalCase}} + {{/operations}}{{/apis}}{{/apiInfo}}'static, { // build our application with a route Router::new() diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index 794a5f8be6b..1cd664417e0 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -133,6 +133,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/modules/openapi-generator/src/main/resources/rust-server/auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-server/auth.mustache @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/modules/openapi-generator/src/main/resources/rust-server/context.mustache b/modules/openapi-generator/src/main/resources/rust-server/context.mustache index 4ec03e0d2e4..061bd4fbf2d 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/context.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/context.mustache @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; @@ -111,9 +112,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.basic_authorization(&basic); let auth_data = AuthData::Basic(basic); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -124,9 +133,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.bearer_authorization(&bearer); let auth_data = AuthData::Bearer(bearer); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -138,9 +155,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.bearer_authorization(&bearer); let auth_data = AuthData::Bearer(bearer); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -152,9 +177,17 @@ impl Service> for AddContext); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -167,9 +200,17 @@ impl Service> for AddContext); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-client-auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-client-auth.mustache new file mode 100644 index 00000000000..07b7713d820 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-server/example-client-auth.mustache @@ -0,0 +1,17 @@ +use {{{externCrateName}}}::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache index b29b387b1e4..f452904d845 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-client-main.mustache @@ -7,7 +7,7 @@ mod server; #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use {{{externCrateName}}}::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use {{{externCrateName}}}::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, {{#apiInfo}} {{#apis}} {{#operations}} @@ -20,6 +20,9 @@ use {{{externCrateName}}}::{Api, ApiNoContext, Client, ContextWrapperExt, models }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -29,6 +32,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -44,7 +51,7 @@ fn main() { {{#operation}} {{#vendorExtensions}} {{^x-no-client-example}} - "{{{operationId}}}", + "{{{operationId}}}", {{/x-no-client-example}} {{/vendorExtensions}} {{/operation}} @@ -69,14 +76,45 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + {{#authMethods}} + {{#scopes}} + "{{{scope}}}", + {{/scopes}} + {{/authMethods}} + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-auth.mustache new file mode 100644 index 00000000000..148012048dd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-auth.mustache @@ -0,0 +1,132 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use {{{externCrateName}}}::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + {{#authMethods}} + {{#scopes}} + "{{{scope}}}", + {{/scopes}} + {{/authMethods}} + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-common.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-common.mustache index 924abea8549..b3a823d6eaa 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server-common.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-common.mustache @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-main.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-main.mustache index c0d39f682e5..58d6f9e2a65 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server-main.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-main.mustache @@ -1,10 +1,13 @@ //! Main binary entry point for {{{externCrateName}}} implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache index 43b66ae59e3..aea5b654376 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-operation.mustache @@ -14,5 +14,5 @@ context: &C) -> Result<{{{operationId}}}Response, ApiError> { info!("{{#vendorExtensions}}{{{x-operation-id}}}{{/vendorExtensions}}({{#allParams}}{{#vendorExtensions}}{{{x-format-string}}}{{/vendorExtensions}}{{^-last}}, {{/-last}}{{/allParams}}) - X-Span-ID: {:?}"{{#allParams}}, {{{paramName}}}{{/allParams}}, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } diff --git a/modules/openapi-generator/src/main/resources/rust-server/example-server-server.mustache b/modules/openapi-generator/src/main/resources/rust-server/example-server-server.mustache index d04e09aad88..bfa094f523c 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/example-server-server.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/example-server-server.mustache @@ -1,5 +1,11 @@ {{>example-server-common}} +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use {{{externCrateName}}}::{ Api, {{#apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index f82fe6f424e..17d2f3cbaaa 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -5,9 +5,12 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; @@ -16,6 +19,10 @@ pub const BASE_PATH: &str = "{{{basePathWithoutHost}}}"; pub const API_VERSION: &str = "{{{.}}}"; {{/appVersion}} +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + {{#apiInfo}} {{#apis}} {{#operations}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-imports.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-imports.mustache index 9aa79b47ea4..be6effa720c 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-imports.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-imports.mustache @@ -23,8 +23,7 @@ use multipart::server::save::SaveResult; {{/apiUsesMultipartFormData}} #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-make-service.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-make-service.mustache index b2c7afd5fdf..5f5359de68a 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-make-service.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-make-service.mustache @@ -1,3 +1,4 @@ + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has {{#hasAuthMethods}}+ Has>{{/hasAuthMethods}} + Send + Sync + 'static @@ -18,6 +19,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has {{#hasAuthMethods}}+ Has>{{/hasAuthMethods}} + Send + Sync + 'static @@ -31,7 +33,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index 08e63ca087e..4111630d6e3 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -3,6 +3,8 @@ use crate::{Api{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}, {{{operationId}}}Response{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} }; +mod server_auth; + {{#hasCallbacks}} pub mod callbacks; diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-server_auth.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-server_auth.mustache new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/rust-server/server-server_auth.mustache @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache index 8c2510345b3..7b4e15d2505 100644 --- a/modules/openapi-generator/src/main/resources/rust/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust/Cargo.mustache @@ -17,7 +17,7 @@ license = "{{.}}" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" {{/licenseInfo}} -edition = "2018" +edition = "2021" {{#publishRustRegistry}} publish = ["{{.}}"] {{/publishRustRegistry}} @@ -32,14 +32,13 @@ homepage = "{{.}} {{/homePageUrl}} [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } {{#serdeWith}} -serde_with = "^2.0" +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } {{/serdeWith}} serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } {{#hyper}} hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" @@ -54,16 +53,15 @@ secrecy = "0.8.0" {{/withAWSV4Signature}} {{#reqwest}} {{^supportAsync}} -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } +{{#supportMiddleware}} +reqwest-middleware = { version = "^0.3", features = ["json", "blocking", "multipart"] } +{{/supportMiddleware}} {{/supportAsync}} {{#supportAsync}} +reqwest = { version = "^0.12", features = ["json", "multipart"] } {{#supportMiddleware}} -reqwest-middleware = "0.2.0" +reqwest-middleware = { version = "^0.3", features = ["json", "multipart"] } {{/supportMiddleware}} -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] {{/supportAsync}} {{/reqwest}} diff --git a/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache b/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache index 8314cb60b07..51a42ef361a 100644 --- a/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust/hyper/api_mod.mustache @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/modules/openapi-generator/src/main/resources/rust/lib.mustache b/modules/openapi-generator/src/main/resources/rust/lib.mustache index 03ee005ea4c..276ad12cfbb 100644 --- a/modules/openapi-generator/src/main/resources/rust/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust/lib.mustache @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index d3dfc630047..dd7ac5a1cdf 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -1,8 +1,11 @@ {{>partial_header}} use crate::models; +use serde::{Deserialize, Serialize}; {{#models}} {{#model}} - +{{^isEnum}}{{#vendorExtensions.x-rust-has-byte-array}} +use serde_with::serde_as; +{{/vendorExtensions.x-rust-has-byte-array}}{{/isEnum}} {{#description}} /// {{{classname}}} : {{{description}}} {{/description}} @@ -18,12 +21,12 @@ pub enum {{{classname}}} { {{/enumVars}}{{/allowableValues}} } -impl ToString for {{{classname}}} { - fn to_string(&self) -> String { +impl std::fmt::Display for {{{classname}}} { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { {{#allowableValues}} {{#enumVars}} - Self::{{{name}}} => String::from("{{{value}}}"), + Self::{{{name}}} => write!(f, "{{{value}}}"), {{/enumVars}} {{/allowableValues}} } @@ -85,15 +88,18 @@ impl Default for {{classname}} { {{!-- for non-enum schemas --}} {{^isEnum}} {{^discriminator}} -{{#oneOf.isEmpty}} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +{{#vendorExtensions.x-rust-has-byte-array}}#[serde_as] +{{/vendorExtensions.x-rust-has-byte-array}}{{#oneOf.isEmpty}}#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct {{{classname}}} { {{#vars}} {{#description}} /// {{{.}}} {{/description}} + {{#isByteArray}} + {{#required}}#[serde_as(as = "serde_with::base64::Base64")]{{/required}}{{^required}}#[serde_as(as = "Option")]{{/required}} + {{/isByteArray}} #[serde(rename = "{{{baseName}}}"{{^required}}{{#isNullable}}, default, with = "::serde_with::rust::double_option"{{/isNullable}}{{/required}}{{^required}}, skip_serializing_if = "Option::is_none"{{/required}}{{#required}}{{#isNullable}}, deserialize_with = "Option::deserialize"{{/isNullable}}{{/required}})] - pub {{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{^required}}Option<{{/required}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{{dataType}}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}{{^isModel}}{{{dataType}}}{{/isModel}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^required}}>{{/required}}, + pub {{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{^required}}Option<{{/required}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isModel}}{{^avoidBoxedModels}}Box<{{/avoidBoxedModels}}{{{dataType}}}{{^avoidBoxedModels}}>{{/avoidBoxedModels}}{{/isModel}}{{^isModel}}{{#isByteArray}}Vec{{/isByteArray}}{{^isByteArray}}{{{dataType}}}{{/isByteArray}}{{/isModel}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^required}}>{{/required}}, {{/vars}} } @@ -101,7 +107,7 @@ impl {{{classname}}} { {{#description}} /// {{{.}}} {{/description}} - pub fn new({{#requiredVars}}{{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^-last}}, {{/-last}}{{/requiredVars}}) -> {{{classname}}} { + pub fn new({{#requiredVars}}{{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isByteArray}}Vec{{/isByteArray}}{{^isByteArray}}{{{dataType}}}{{/isByteArray}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^-last}}, {{/-last}}{{/requiredVars}}) -> {{{classname}}} { {{{classname}}} { {{#vars}} {{{name}}}{{^required}}: None{{/required}}{{#required}}{{#isModel}}{{^avoidBoxedModels}}: {{^isNullable}}Box::new({{{name}}}){{/isNullable}}{{#isNullable}}if let Some(x) = {{{name}}} {Some(Box::new(x))} else {None}{{/isNullable}}{{/avoidBoxedModels}}{{/isModel}}{{/required}}, diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 23c6300f99b..f9e6e9db599 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -1,7 +1,7 @@ {{>partial_header}} use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; @@ -174,7 +174,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{/bodyParams}} {{/hasBodyParam}} {{^hasBodyParam}} - &"", + "", {{/hasBodyParam}} ) { Ok(new_headers) => new_headers, diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/configuration.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/configuration.mustache index 0de2884a8bb..fd6f7d052d9 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/configuration.mustache @@ -64,7 +64,7 @@ impl AWSv4Key { value.to_str().expect("header value should be a string").to_string())); } } - return Ok(additional_headers); + Ok(additional_headers) } } {{/withAWSV4Signature}} diff --git a/modules/openapi-generator/src/main/resources/scala-cask/apiRoutes.mustache b/modules/openapi-generator/src/main/resources/scala-cask/apiRoutes.mustache index 0d1ca45d0d5..db3cdd65cb4 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/apiRoutes.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/apiRoutes.mustache @@ -46,16 +46,12 @@ class {{classname}}Routes(service : {{classname}}Service) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - {{#vendorExtensions.x-has-response-types}} - {{#responses}} - {{#dataType}} - case Right(value : {{dataType}}) => cask.Response(data = write(value), {{code}}, headers = Seq("Content-Type" -> "application/json")) - {{/dataType}} - {{/responses}} - {{/vendorExtensions.x-has-response-types}} - {{^vendorExtensions.x-has-response-types}} - case Right(_) => cask.Response("", 200) - {{/vendorExtensions.x-has-response-types}} + {{#responses}} + {{#dataType}} + case Right(value : {{dataType}}) => cask.Response(data = write(value), {{code}}, headers = Seq("Content-Type" -> "application/json")) + {{/dataType}} + {{/responses}} + case Right(other) => cask.Response(s"$other", 200) } } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache b/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache index ae0a5ae12e5..ea6b9ffbd95 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/build.sbt.mustache @@ -1,23 +1,47 @@ -name := "{{artifactId}}" -organization:="{{groupId}}" -version := "0.0.1-SNAPSHOT" -scalaVersion := "3.3.1" -scalafmtOnCompile := true -libraryDependencies ++= Seq( - "com.lihaoyi" %% "cask" % "0.9.2" , - "com.lihaoyi" %% "upickle" % "3.2.0", - "org.scalatest" %% "scalatest" % "3.2.18" % Test +ThisBuild / name := "{{artifactId}}" +ThisBuild / organization := "{{groupId}}" +ThisBuild / version := "{{artifactVersion}}" +ThisBuild / scalaVersion := "3.4.1" +ThisBuild / scalafmtOnCompile := true +ThisBuild / versionScheme := Some("early-semver") + +// Common settings +lazy val commonSettings = Seq( + libraryDependencies ++= Seq( + "com.lihaoyi" %%% "upickle" % "3.2.0", + "org.scalatest" %%% "scalatest" % "3.2.18" % Test + ), + name := "{{artifactId}}" ) -publishMavenStyle := true + +lazy val app = crossProject(JSPlatform, JVMPlatform).in(file(".")). + settings(commonSettings). + jvmSettings( + libraryDependencies += "com.lihaoyi" %% "cask" % "0.9.2" + ). + jsSettings( + scalaJSUseMainModuleInitializer := true + ) + + +lazy val root = project.in(file(".")). + aggregate(app.js, app.jvm). + settings( + publish := {}, + publishLocal := {}, + ) + + +ThisBuild / publishMavenStyle := true val githubUser = "{{{gitUserId}}}" val githubRepo = "{{{gitRepoId}}}" -publishTo := Some("GitHub Package Registry" at s"https://maven.pkg.github.com/$githubUser/$githubRepo") +ThisBuild / publishTo := Some("GitHub Package Registry" at s"https://maven.pkg.github.com/$githubUser/$githubRepo") sys.env.get("GITHUB_TOKEN") match { case Some(token) if !token.isEmpty => - credentials += Credentials( + ThisBuild / credentials += Credentials( "GitHub Package Registry", "maven.pkg.github.com", githubUser, diff --git a/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache b/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache index a31414db150..5107dce11a5 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/build.sc.mustache @@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._ // mill _.publishLocal // mill _.test.test object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule { - def scalaVersion = "3.3.1" + def scalaVersion = "3.4.1" def pomSettings = PomSettings( description = "{{artifactId}}", @@ -21,15 +21,15 @@ object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule { ) ) - def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") + def publishVersion: mill.T[String] = T("{{artifactVersion}}") def ivyDeps = Agg( ivy"com.lihaoyi::cask:0.9.2" , ivy"com.lihaoyi::upickle:3.2.0" ) - override def sources = T.sources(millSourcePath / os.up / "src" / "main" / "scala") - override def resources = T.sources(millSourcePath / os.up / "src" / "main" / "resources") + override def sources = T.sources(millSourcePath / os.up / "shared" / "src" / "main" / "scala") + override def resources = T.sources(millSourcePath / os.up / "shared" / "src" / "main" / "resources") object test extends SbtModuleTests { def ivyDeps = Agg( diff --git a/modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache b/modules/openapi-generator/src/main/resources/scala-cask/buildAndPublish.yml.mustache similarity index 91% rename from modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache rename to modules/openapi-generator/src/main/resources/scala-cask/buildAndPublish.yml.mustache index ead5b4c0dcb..1df721e7365 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/bulidAndPublish.yml.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/buildAndPublish.yml.mustache @@ -30,10 +30,7 @@ jobs: ${{{openbrackets}}} runner.os {{{closebrackets}}}-sbt- - name: Build with sbt - run: sbt clean compile - - - name: Test with sbt - run: sbt test + run: sbt clean compile test - name: Publish to GitHub Packages run: sbt publish diff --git a/modules/openapi-generator/src/main/resources/scala-cask/example.mustache b/modules/openapi-generator/src/main/resources/scala-cask/example.mustache index 3d6b5cca779..c06bb16d163 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/example.mustache +++ b/modules/openapi-generator/src/main/resources/scala-cask/example.mustache @@ -1,5 +1,5 @@ -//> using scala "3.3.1" -//> using lib "{{groupId}}::{{artifactId}}:0.0.1-SNAPSHOT" +//> using scala "3.4.1" +//> using lib "{{groupId}}::{{artifactId}}:{{artifactVersion}}" //> using repositories https://maven.pkg.github.com/{{{gitUserId}}}/{{{gitRepoId}}} diff --git a/modules/openapi-generator/src/main/resources/scala-cask/project/plugins.sbt b/modules/openapi-generator/src/main/resources/scala-cask/project/plugins.sbt index 4f3f02c2de4..ece317dfad9 100644 --- a/modules/openapi-generator/src/main/resources/scala-cask/project/plugins.sbt +++ b/modules/openapi-generator/src/main/resources/scala-cask/project/plugins.sbt @@ -1,3 +1,4 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") - -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") \ No newline at end of file +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache b/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache index 29ef3ce991b..cb72041f6a4 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp/api.mustache @@ -10,8 +10,7 @@ import sttp.model.Method {{#operations}} object {{classname}} { - -def apply(baseUrl: String = "{{{basePath}}}") = new {{classname}}(baseUrl) + def apply(baseUrl: String = "{{{basePath}}}") = new {{classname}}(baseUrl) } class {{classname}}(baseUrl: String) { @@ -20,7 +19,7 @@ class {{classname}}(baseUrl: String) { {{#javadocRenderer}} {{>javadoc}} {{/javadocRenderer}} - def {{operationId}}({{>methodParameters}}): Request[{{#defaultReturnType}}Either[Either[String, String], Unit]{{/defaultReturnType}}{{^defaultReturnType}}{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}{{/defaultReturnType}}, Any] = + def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}, Any] = basicRequest .method(Method.{{httpMethod.toUpperCase}}, uri"$baseUrl{{{path}}}{{#queryParams.0}}?{{#queryParams}}{{baseName}}=${ {{{paramName}}} }{{^-last}}&{{/-last}}{{/queryParams}}{{/queryParams.0}}{{#isApiKey}}{{#isKeyInQuery}}{{^queryParams.0}}?{{/queryParams.0}}{{#queryParams.0}}&{{/queryParams.0}}{{keyParamName}}=${apiKey.value}&{{/isKeyInQuery}}{{/isApiKey}}") .contentType({{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}){{#headerParams}} @@ -36,7 +35,7 @@ class {{classname}}(baseUrl: String) { {{>paramMultipartCreation}}{{^-last}}, {{/-last}}{{/formParams}} ).flatten){{/isMultipart}}{{/formParams.0}}{{#bodyParam}} .body({{paramName}}){{/bodyParam}} - .response({{#defaultReturnType}}asEither(asString, ignore){{/defaultReturnType}}{{^defaultReturnType}}{{#separateErrorChannel}}asJson{{/separateErrorChannel}}{{^separateErrorChannel}}asJsonAlwaysUnsafe{{/separateErrorChannel}}[{{>operationReturnType}}]{{/defaultReturnType}}) + .response({{#separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))){{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}]{{/returnType}}{{/separateErrorChannel}}{{^separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))).getRight{{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}].getRight{{/returnType}}{{/separateErrorChannel}}) {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache b/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache index 732eedb2989..1635d5bd1c1 100644 --- a/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache +++ b/modules/openapi-generator/src/main/resources/scala-sttp4/api.mustache @@ -19,7 +19,7 @@ class {{classname}}(baseUrl: String) { {{#javadocRenderer}} {{>javadoc}} {{/javadocRenderer}} - def {{operationId}}({{>methodParameters}}): Request[{{#defaultReturnType}}Either[Either[String, String], Unit]{{/defaultReturnType}}{{^defaultReturnType}}{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}{{/defaultReturnType}}] = + def {{operationId}}({{>methodParameters}}): Request[{{#separateErrorChannel}}Either[ResponseException[String, Exception], {{>operationReturnType}}]{{/separateErrorChannel}}{{^separateErrorChannel}}{{>operationReturnType}}{{/separateErrorChannel}}] = basicRequest .method(Method.{{httpMethod.toUpperCase}}, uri"$baseUrl{{{path}}}{{#queryParams.0}}?{{#queryParams}}{{baseName}}=${ {{{paramName}}} }{{^-last}}&{{/-last}}{{/queryParams}}{{/queryParams.0}}{{#isApiKey}}{{#isKeyInQuery}}{{^queryParams.0}}?{{/queryParams.0}}{{#queryParams.0}}&{{/queryParams.0}}{{keyParamName}}=${apiKey.value}&{{/isKeyInQuery}}{{/isApiKey}}") .contentType({{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{^consumes}}"application/json"{{/consumes}}){{#headerParams}} @@ -35,7 +35,7 @@ class {{classname}}(baseUrl: String) { {{>paramMultipartCreation}}{{^-last}}, {{/-last}}{{/formParams}} ).flatten){{/isMultipart}}{{/formParams.0}}{{#bodyParam}} .body({{paramName}}){{/bodyParam}} - .response({{#defaultReturnType}}asEither(asString, ignore){{/defaultReturnType}}{{^defaultReturnType}}{{#separateErrorChannel}}asJson{{/separateErrorChannel}}{{^separateErrorChannel}}asJsonAlwaysUnsafe{{/separateErrorChannel}}[{{>operationReturnType}}]{{/defaultReturnType}}) + .response({{#separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))){{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}]{{/returnType}}{{/separateErrorChannel}}{{^separateErrorChannel}}{{^returnType}}asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(()))).getRight{{/returnType}}{{#returnType}}asJson[{{>operationReturnType}}].getRight{{/returnType}}{{/separateErrorChannel}}) {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 9a8af56a8af..3bd5e1c4f6c 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -130,9 +130,9 @@ extension NullEncodable: Codable where Wrapped: Codable { } {{/useAlamofire}} {{^useAlamofire}} - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 36b4e80c06c..9ef5937ccc3 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -96,7 +96,7 @@ private var managerStore = SynchronizedDictionary() case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = nil diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 0c8cc2863cd..eda23b2f65b 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ private var credentialStore = SynchronizedDictionary() case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ private var credentialStore = SynchronizedDictionary() } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 1c52f7f245b..f45e74d2339 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -71,8 +71,9 @@ export class {{classname}} { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { @@ -173,13 +174,13 @@ export class {{classname}} { * @deprecated {{/isDeprecated}} */ - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable>; - public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable { + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters{{^hasRequiredVars}}?{{/hasRequiredVars}}: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters{{^hasRequiredVars}}?{{/hasRequiredVars}}: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters{{^hasRequiredVars}}?{{/hasRequiredVars}}: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable>; + public {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters{{^hasRequiredVars}}?{{/hasRequiredVars}}: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: {{#produces}}'{{{mediaType}}}'{{^-last}} | {{/-last}}{{/produces}}{{^produces}}undefined{{/produces}},{{#httpContextInOptions}} context?: HttpContext{{/httpContextInOptions}}{{#httpTransferCacheInOptions}}, transferCache?: boolean{{/httpTransferCacheInOptions}}}): Observable { {{#allParams}} {{#useSingleRequestParameter}} - const {{paramName}} = requestParameters.{{paramName}}; + const {{paramName}} = requestParameters{{^hasRequiredVars}}?{{/hasRequiredVars}}.{{paramName}}; {{/useSingleRequestParameter}} {{#required}} if ({{paramName}} === null || {{paramName}} === undefined) { diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelGeneric.mustache index 43207b65e30..232acaf3ea4 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelGeneric.mustache @@ -2,9 +2,17 @@ export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{. {{#vars}} {{#description}} /** - * {{{.}}} + * {{{description}}} + {{#deprecated}} + * @deprecated + {{/deprecated}} */ {{/description}} + {{^description}} + {{#deprecated}} + /** @deprecated */ + {{/deprecated}} + {{/description}} {{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; {{/vars}} }{{>modelGenericEnums}} diff --git a/modules/openapi-generator/src/main/resources/typescript-aurelia/package.json.mustache b/modules/openapi-generator/src/main/resources/typescript-aurelia/package.json.mustache index 91a55a9140c..c6c12b4bf20 100644 --- a/modules/openapi-generator/src/main/resources/typescript-aurelia/package.json.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-aurelia/package.json.mustache @@ -22,6 +22,6 @@ }, "devDependencies": { "tslint": "^3.15.1", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" } } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index e008a6d830e..47c95f0e354 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -18,10 +18,10 @@ import FormData from 'form-data' // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '{{apiRelativeToRoot}}base'; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '{{apiRelativeToRoot}}base'; {{#imports}} // @ts-ignore -import { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}'; +import type { {{classname}} } from '{{apiRelativeToRoot}}{{tsModelPackage}}'; {{/imports}} {{/withSeparateModelsAndApi}} {{^withSeparateModelsAndApi}} @@ -189,9 +189,14 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#isArray}} if ({{paramName}}) { {{#isCollectionFormatMulti}} + {{#contentType}} + localVarFormParams.append('{{baseName}}', new Blob([JSON.stringify({{paramName}})], { type: "{{contentType}}", })); + {{/contentType}} + {{^contentType}} {{paramName}}.forEach((element) => { - localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', element as any); + localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', element as any); }) + {{/contentType}} {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} localVarFormParams.{{#multipartFormData}}append{{/multipartFormData}}{{^multipartFormData}}set{{/multipartFormData}}('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}})); diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache index 004fc11fdae..aa594015c7f 100755 --- a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache @@ -118,50 +118,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache index 9e1e84422bc..4ec53a6c405 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache @@ -4,13 +4,13 @@ {{#withSeparateModelsAndApi}}{{#hasAllOf}}{{#allOf}} // May contain unused imports in some cases // @ts-ignore -import { {{class}} } from './{{filename}}';{{/allOf}}{{/hasAllOf}}{{#hasOneOf}}{{#oneOf}} +import type { {{class}} } from './{{filename}}';{{/allOf}}{{/hasAllOf}}{{#hasOneOf}}{{#oneOf}} // May contain unused imports in some cases // @ts-ignore -import { {{class}} } from './{{filename}}';{{/oneOf}}{{/hasOneOf}}{{^hasAllOf}}{{^hasOneOf}}{{#imports}} +import type { {{class}} } from './{{filename}}';{{/oneOf}}{{/hasOneOf}}{{^hasAllOf}}{{^hasOneOf}}{{#imports}} // May contain unused imports in some cases // @ts-ignore -import { {{class}} } from './{{filename}}';{{/imports}}{{/hasOneOf}}{{/hasAllOf}}{{/withSeparateModelsAndApi}} +import type { {{class}} } from './{{filename}}';{{/imports}}{{/hasOneOf}}{{/hasAllOf}}{{/withSeparateModelsAndApi}} {{#models}}{{#model}} {{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#allOf}}{{#-first}}{{>modelAllOf}}{{/-first}}{{/allOf}}{{^isEnum}}{{^oneOf}}{{^allOf}}{{>modelGeneric}}{{/allOf}}{{/oneOf}}{{/isEnum}} {{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache index da599f17787..b5ab30bba8f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache @@ -29,8 +29,8 @@ "axios": "^1.6.1" }, "devDependencies": { - "@types/node": "^12.11.5", - "typescript": "^4.0" + "@types/node": "12.11.5 - 12.20.42", + "typescript": "^4.0 || ^5.0" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache index 79c0ee1d59e..312b6320e0d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelEnum.mustache @@ -1,7 +1,14 @@ {{>modelEnumInterfaces}} export function instanceOf{{classname}}(value: any): boolean { - return Object.values({{classname}}).includes(value); + for (const key in {{classname}}) { + if (Object.prototype.hasOwnProperty.call({{classname}}, key)) { + if ({{classname}}[key] === value) { + return true; + } + } + } + return false; } export function {{classname}}FromJSON(json: any): {{classname}} { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache index b8fd70ec428..0228aa5374e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -1,32 +1,29 @@ import { mapValues } from '../runtime{{importFileExtension}}'; {{#hasImports}} -{{#imports}} -import type { {{{.}}} } from './{{.}}{{importFileExtension}}'; +{{#tsImports}} +import type { {{{classname}}} } from './{{filename}}{{importFileExtension}}'; import { - {{.}}FromJSON, - {{.}}FromJSONTyped, - {{.}}ToJSON, -} from './{{.}}{{importFileExtension}}'; -{{/imports}} + {{classname}}FromJSON, + {{classname}}FromJSONTyped, + {{classname}}ToJSON, +} from './{{filename}}{{importFileExtension}}'; +{{/tsImports}} {{/hasImports}} {{#discriminator}} -import { {{#discriminator.mappedModels}} - {{modelName}}FromJSONTyped{{^-last}},{{/-last}} +import { {{modelName}}FromJSONTyped } from './{{modelName}}{{importFileExtension}}'; {{/discriminator.mappedModels}} -} from './index{{importFileExtension}}'; - {{/discriminator}} {{>modelGenericInterfaces}} /** * Check if a given object implements the {{classname}} interface. */ -export function instanceOf{{classname}}(value: object): boolean { +export function instanceOf{{classname}}(value: object): value is {{classname}} { {{#vars}} {{#required}} - if (!('{{name}}' in value)) return false; + if (!('{{name}}' in value) || value['{{name}}'] === undefined) return false; {{/required}} {{/vars}} return true; diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache index 88d7bbbc6fc..37018c1172c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelOneOf.mustache @@ -31,7 +31,11 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole } {{/discriminator}} {{^discriminator}} - return {{#oneOf}}{{{.}}}FromJSONTyped(json, true){{^-last}} || {{/-last}}{{/oneOf}}; + {{#oneOf}} + if (instanceOf{{{.}}}(json)) { + return {{{.}}}FromJSONTyped(json, true); + } + {{/oneOf}} {{/discriminator}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache index add4643dfe3..ebb742fdb78 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache @@ -30,7 +30,7 @@ "redux-ts-simple": "^3.2.0", "reselect": "^4.0.0", {{/sagasAndRecords}} - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/main/resources/typescript-jquery/package.mustache b/modules/openapi-generator/src/main/resources/typescript-jquery/package.mustache index d9c7b690560..b9b1a8b6d58 100644 --- a/modules/openapi-generator/src/main/resources/typescript-jquery/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-jquery/package.mustache @@ -19,7 +19,7 @@ }, "devDependencies": { "@types/jquery": "^3.1", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}}, "publishConfig": { "registry": "{{npmRepository}}" diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache index 0aeeaa78255..005aabdff6c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache @@ -3,7 +3,7 @@ import { DynamicModule, Module, Global, Provider } from '@nestjs/common'; import { HttpModule, HttpService } from '@nestjs/axios'; {{/useAxiosHttpModule}} {{^useAxiosHttpModule}} -import { DynamicModule, HttpService, HttpModule, Module, Global } from '@nestjs/common'; +import { DynamicModule, HttpService, HttpModule, Module, Global, Provider } from '@nestjs/common'; {{/useAxiosHttpModule}} import { AsyncConfiguration, Configuration, ConfigurationFactory } from './configuration'; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache index 064978b9753..a3d501dd80d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -2,23 +2,49 @@ /* tslint:disable:no-unused-variable member-ordering */ {{#useAxiosHttpModule}} -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; {{/useAxiosHttpModule}} {{^useAxiosHttpModule}} -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; {{/useAxiosHttpModule}} import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; {{#imports}} import { {{classname}} } from '../{{filename}}'; {{/imports}} import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; {{#withInterfaces}} import { {{classname}}Interface } from './{{classFilename}}Interface'; {{/withInterfaces}} {{#operations}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +/** + * Request parameters for {{nickname}} operation in {{classname}}. + * @export + * @interface {{classname}}{{operationIdCamelCase}}Request + */ +export interface {{classname}}{{operationIdCamelCase}}Request { + {{#allParams}} + /** + * {{description}} + * @type {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> + * @memberof {{classname}}{{operationIdCamelCase}} + */ + readonly {{paramName}}{{^required}}?{{/required}}: {{{dataType}}} + {{^-last}} + + {{/-last}} + {{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} {{#description}} /** @@ -55,14 +81,36 @@ export class {{classname}} { /** * {{summary}} * {{notes}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters. + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. + {{/useSingleRequestParameter}} */ + {{#useSingleRequestParameter}} + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable>; + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable { + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable>; public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable { -{{#allParams}} + {{/useSingleRequestParameter}} +{{#allParams.0}} +{{#useSingleRequestParameter}} + const { + {{#allParams}} + {{paramName}}, + {{/allParams}} + } = requestParameters; +{{/useSingleRequestParameter}} +{{/allParams.0}} +{{#allParams}} {{#required}} {{#isConstEnumParam}} let {{paramName}} = {{{dataType}}}; @@ -71,10 +119,10 @@ export class {{classname}} { if ({{paramName}} === null || {{paramName}} === undefined) { throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } + {{/isConstEnumParam}} {{/required}} {{/allParams}} - {{#hasQueryParams}} let queryParameters = new URLSearchParams(); {{#queryParams}} @@ -117,6 +165,8 @@ export class {{classname}} { {{/isArray}} {{/headerParams}} + let accessTokenObservable: Observable = of(null); + {{#authMethods}} // authentication ({{name}}) required {{#isApiKey}} @@ -144,17 +194,16 @@ export class {{classname}} { {{/isBasicBasic}} {{#isBasicBearer}} if (typeof this.configuration.accessToken === 'function') { - headers['Authorization'] = `Bearer ${this.configuration.accessToken()}`; + accessTokenObservable = from(Promise.resolve(this.configuration.accessToken())); } else if (this.configuration.accessToken) { - headers['Authorization'] = `Bearer ${this.configuration.accessToken}`; + accessTokenObservable = from(Promise.resolve(this.configuration.accessToken)); } {{/isBasicBearer}} {{#isOAuth}} if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } {{/isOAuth}} @@ -224,18 +273,26 @@ export class {{classname}} { {{/formParams}} {{/hasFormParams}} - return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} - {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams!.toString() : formParams!{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} - { -{{#hasQueryParams}} - params: queryParameters, -{{/hasQueryParams}} -{{#isResponseFile}} - responseType: "blob", -{{/isResponseFile}} - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} + {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams!.toString() : formParams!{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} + { + {{#hasQueryParams}} + params: queryParameters, + {{/hasQueryParams}} + {{#isResponseFile}} + responseType: "blob", + {{/isResponseFile}} + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache index 39cf69ee612..1ee763ae549 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache index 1167ea07cd3..58209fba34d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache @@ -53,7 +53,7 @@ "ts-node": "8.3.0", "tsconfig-paths": "3.8.0", "tslint": "5.18.0", - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "wait-on": "^3.2.0" }, "jest": { diff --git a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache index b9dc19c81a7..f8d6788d5bf 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache @@ -23,7 +23,7 @@ "@types/bluebird": "^3.5.33", "@types/node": "^12", "@types/request": "^2.48.8", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}}, "publishConfig": { "registry": "{{npmRepository}}" diff --git a/modules/openapi-generator/src/main/resources/typescript-redux-query/package.mustache b/modules/openapi-generator/src/main/resources/typescript-redux-query/package.mustache index 722818d44cd..d1f90533fcb 100644 --- a/modules/openapi-generator/src/main/resources/typescript-redux-query/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-redux-query/package.mustache @@ -17,7 +17,7 @@ "redux-query": "^3.2.0" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache index 65d8b348d1a..34b64585a01 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/package.mustache @@ -17,7 +17,7 @@ "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java index 81c4978e787..0fcc7650f22 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractIntegrationTest.java @@ -17,10 +17,11 @@ package org.openapitools.codegen; +import java.nio.file.Files; +import java.util.stream.Collectors; import io.swagger.v3.oas.models.OpenAPI; import org.openapitools.codegen.testutils.IntegrationTestPathsConfig; import org.testng.annotations.Test; -import org.testng.reporters.Files; import java.io.IOException; import java.util.HashMap; @@ -51,7 +52,7 @@ public abstract class AbstractIntegrationTest { IntegrationTestPathsConfig integrationTestPathsConfig = getIntegrationTestPathsConfig(); - String specContent = Files.readFile(integrationTestPathsConfig.getSpecPath().toFile()); + String specContent = Files.lines(integrationTestPathsConfig.getSpecPath()).collect(Collectors.joining("\n")); OpenAPI openAPI = TestUtils.parseContent(specContent); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java index 1eb57d9014f..a4ca489e6b8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java @@ -4,7 +4,7 @@ import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.domain.JavaModifier; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.lang.ArchRule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.*; import static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 0b1f9f17d4a..daaea9a2637 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -29,7 +29,6 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.examples.Example; import io.swagger.v3.oas.models.headers.Header; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.QueryParameter; @@ -40,6 +39,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme; import io.swagger.v3.parser.core.models.ParseOptions; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; +import org.openapitools.codegen.languages.SpringCodegen; import org.openapitools.codegen.model.ModelMap; import org.openapitools.codegen.model.ModelsMap; import org.openapitools.codegen.templating.mustache.*; @@ -49,6 +49,8 @@ import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.Ignore; import org.testng.annotations.Test; +import org.junit.jupiter.api.Assertions; + import java.io.File; import java.io.IOException; @@ -56,7 +58,6 @@ import java.nio.file.Files; import java.util.*; import java.util.stream.Collectors; -import static junit.framework.Assert.assertEquals; import static org.assertj.core.api.Assertions.assertThat; import static org.testng.Assert.*; @@ -71,7 +72,7 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openApi); PathItem path = openApi.getPaths().get("/ping"); CodegenOperation operation = codegen.fromOperation("/ping", "post", path.getPost(), path.getServers()); - Assert.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("Person")).size(), 1); + Assertions.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("Person")).size(), 1); } @Test @@ -81,7 +82,7 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openApi); PathItem path = openApi.getPaths().get("/api/Users/{userId}"); CodegenOperation operation = codegen.fromOperation("/api/Users/{userId}", "get", path.getGet(), path.getServers()); - Assert.assertEquals(operation.isResponseOptional, true); + Assertions.assertTrue(operation.isResponseOptional); } @Test @@ -91,7 +92,7 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openApi); PathItem path = openApi.getPaths().get("/pets/petType/{type}"); CodegenOperation operation = codegen.fromOperation("/pets/petType/{type}", "get", path.getGet(), path.getServers()); - Assert.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("PetByType")).size(), 1); + Assertions.assertEquals(Sets.intersection(operation.imports, Sets.newHashSet("PetByType")).size(), 1); } @Test @@ -115,8 +116,8 @@ public class DefaultCodegenTest { final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); - Assert.assertFalse(codegen.hasBodyParameter(pingOperation)); - Assert.assertTrue(codegen.hasBodyParameter(createOperation)); + Assertions.assertFalse(codegen.hasBodyParameter(pingOperation)); + Assertions.assertTrue(codegen.hasBodyParameter(createOperation)); } @Test(expectedExceptions = RuntimeException.class) @@ -127,7 +128,7 @@ public class DefaultCodegenTest { } @Test - public void testGetConsumesInfoAndGetProducesInfo() throws Exception { + public void testGetConsumesInfoAndGetProducesInfo() { final Schema refSchema = new Schema<>().$ref("#/components/schemas/Pet"); OpenAPI openAPI = new OpenAPI(); openAPI.setComponents(new Components()); @@ -150,61 +151,61 @@ public class DefaultCodegenTest { new ApiResponses().addApiResponse("201", new ApiResponse() .description("Created response"))); Set createConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, createOperation); - Assert.assertEquals(createConsumesInfo.size(), 2); - Assert.assertTrue(createConsumesInfo.contains("application/json"), "contains 'application/json'"); - Assert.assertTrue(createConsumesInfo.contains("application/xml"), "contains 'application/xml'"); + Assertions.assertEquals(createConsumesInfo.size(), 2); + Assertions.assertTrue(createConsumesInfo.contains("application/json"), "contains 'application/json'"); + Assertions.assertTrue(createConsumesInfo.contains("application/xml"), "contains 'application/xml'"); Set createProducesInfo = DefaultCodegen.getProducesInfo(openAPI, createOperation); - Assert.assertEquals(createProducesInfo.size(), 0); + Assertions.assertEquals(createProducesInfo.size(), 0); final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); CodegenOperation coCreate = codegen.fromOperation("somepath", "post", createOperation, null); - Assert.assertTrue(coCreate.hasConsumes); - Assert.assertEquals(coCreate.consumes.size(), 2); - Assert.assertFalse(coCreate.hasProduces); + Assertions.assertTrue(coCreate.hasConsumes); + Assertions.assertEquals(coCreate.consumes.size(), 2); + Assertions.assertFalse(coCreate.hasProduces); Operation updateOperationWithRef = new Operation() .requestBody(new RequestBody().$ref("#/components/requestBodies/MyRequestBody")) .responses(new ApiResponses().addApiResponse("201", new ApiResponse().$ref("#/components/responses/MyResponse"))); Set updateConsumesInfo = DefaultCodegen.getConsumesInfo(openAPI, updateOperationWithRef); - Assert.assertEquals(updateConsumesInfo.size(), 1); - Assert.assertTrue(updateConsumesInfo.contains("application/json"), "contains 'application/json'"); + Assertions.assertEquals(updateConsumesInfo.size(), 1); + Assertions.assertTrue(updateConsumesInfo.contains("application/json"), "contains 'application/json'"); Set updateProducesInfo = DefaultCodegen.getProducesInfo(openAPI, updateOperationWithRef); - Assert.assertEquals(updateProducesInfo.size(), 1); - Assert.assertTrue(updateProducesInfo.contains("application/xml"), "contains 'application/xml'"); + Assertions.assertEquals(updateProducesInfo.size(), 1); + Assertions.assertTrue(updateProducesInfo.contains("application/xml"), "contains 'application/xml'"); CodegenOperation coUpdate = codegen.fromOperation("somepath", "post", updateOperationWithRef, null); - Assert.assertTrue(coUpdate.hasConsumes); - Assert.assertEquals(coUpdate.consumes.size(), 1); - Assert.assertEquals(coUpdate.consumes.get(0).get("mediaType"), "application/json"); - Assert.assertTrue(coUpdate.hasProduces); - Assert.assertEquals(coUpdate.produces.size(), 1); - Assert.assertEquals(coUpdate.produces.get(0).get("mediaType"), "application/xml"); + Assertions.assertTrue(coUpdate.hasConsumes); + Assertions.assertEquals(coUpdate.consumes.size(), 1); + Assertions.assertEquals(coUpdate.consumes.get(0).get("mediaType"), "application/json"); + Assertions.assertTrue(coUpdate.hasProduces); + Assertions.assertEquals(coUpdate.produces.size(), 1); + Assertions.assertEquals(coUpdate.produces.get(0).get("mediaType"), "application/xml"); } @Test - public void testGetProducesInfo() throws Exception { + public void testGetProducesInfo() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/produces.yaml"); final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); Operation textOperation = openAPI.getPaths().get("/ping/text").getGet(); CodegenOperation coText = codegen.fromOperation("/ping/text", "get", textOperation, null); - Assert.assertTrue(coText.hasProduces); - Assert.assertEquals(coText.produces.size(), 1); - Assert.assertEquals(coText.produces.get(0).get("mediaType"), "text/plain"); + Assertions.assertTrue(coText.hasProduces); + Assertions.assertEquals(coText.produces.size(), 1); + Assertions.assertEquals(coText.produces.get(0).get("mediaType"), "text/plain"); Operation jsonOperation = openAPI.getPaths().get("/ping/json").getGet(); CodegenOperation coJson = codegen.fromOperation("/ping/json", "get", jsonOperation, null); - Assert.assertTrue(coJson.hasProduces); - Assert.assertEquals(coJson.produces.size(), 1); - Assert.assertEquals(coJson.produces.get(0).get("mediaType"), "application/json"); + Assertions.assertTrue(coJson.hasProduces); + Assertions.assertEquals(coJson.produces.size(), 1); + Assertions.assertEquals(coJson.produces.get(0).get("mediaType"), "application/json"); Operation issue443Operation = openAPI.getPaths().get("/other/issue443").getGet(); CodegenOperation coIssue443 = codegen.fromOperation("/other/issue443", "get", issue443Operation, null); - Assert.assertTrue(coIssue443.hasProduces); - Assert.assertEquals(coIssue443.produces.size(), 2); - Assert.assertEquals(coIssue443.produces.get(0).get("mediaType"), "application/json"); - Assert.assertEquals(coIssue443.produces.get(1).get("mediaType"), "application/text"); + Assertions.assertTrue(coIssue443.hasProduces); + Assertions.assertEquals(coIssue443.produces.size(), 2); + Assertions.assertEquals(coIssue443.produces.get(0).get("mediaType"), "application/json"); + Assertions.assertEquals(coIssue443.produces.get(1).get("mediaType"), "application/text"); } @Test @@ -212,8 +213,8 @@ public class DefaultCodegenTest { final DefaultCodegen codegen = new DefaultCodegen(); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assertions.assertTrue(codegen.isHideGenerationTimestamp()); } @Test @@ -222,8 +223,8 @@ public class DefaultCodegenTest { codegen.setHideGenerationTimestamp(false); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assertions.assertFalse(codegen.isHideGenerationTimestamp()); } @Test @@ -232,12 +233,12 @@ public class DefaultCodegenTest { codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assertions.assertFalse(codegen.isHideGenerationTimestamp()); } @Test - public void testArraySchemaIsNotIncludedInAliases() throws Exception { + public void testArraySchemaIsNotIncludedInAliases() { final DefaultCodegen codegen = new DefaultCodegen(); Map schemas = new HashMap() { { @@ -248,7 +249,7 @@ public class DefaultCodegenTest { Map aliases = codegen.getAllAliases(schemas); - Assert.assertEquals(aliases.size(), 0); + Assertions.assertEquals(aliases.size(), 0); } @Test @@ -261,8 +262,8 @@ public class DefaultCodegenTest { ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody())); CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); - Assert.assertEquals(codegenParameter.defaultValue, "-efg"); - Assert.assertEquals(codegenParameter.getSchema(), null); + Assertions.assertEquals(codegenParameter.defaultValue, "-efg"); + Assertions.assertNull(codegenParameter.getSchema()); } @Test @@ -277,8 +278,8 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", (Schema) requestBodySchema.getProperties().get("visitDate"), new HashSet<>()); - Assert.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); - Assert.assertEquals(codegenParameter.getSchema(), null); + Assertions.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); + Assertions.assertNull(codegenParameter.getSchema()); } @Test @@ -287,13 +288,13 @@ public class DefaultCodegenTest { String location = "src/test/resources/2_0/python-prior/petstore-with-fake-endpoints-models-for-testing.yaml"; OpenAPI openAPI = TestUtils.parseFlattenSpec(location); SemVer version = ModelUtils.getOpenApiVersion(openAPI, location, null); - Assert.assertEquals(version, new SemVer("2.0.0")); + Assertions.assertEquals(version, new SemVer("2.0.0")); // Test with OAS 3.0 document. location = "src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"; openAPI = TestUtils.parseFlattenSpec(location); version = ModelUtils.getOpenApiVersion(openAPI, location, null); - Assert.assertEquals(version, new SemVer("3.0.0")); + Assertions.assertEquals(version, new SemVer("3.0.0")); } @Test @@ -305,14 +306,14 @@ public class DefaultCodegenTest { codegen.setDisallowAdditionalPropertiesIfNotPresent(true); Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); + Assertions.assertNull(schema.getAdditionalProperties()); Schema addProps = ModelUtils.getAdditionalProperties(schema); // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the // 'additionalProperties' keyword for this model, hence assert the value to be null. - Assert.assertNull(addProps); + Assertions.assertNull(addProps); CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", schema); - Assert.assertNull(cm.getAdditionalProperties()); + Assertions.assertNull(cm.getAdditionalProperties()); // When the 'additionalProperties' keyword is not present, the model // should allow undeclared properties. However, due to bug // https://github.com/swagger-api/swagger-parser/issues/1369, the swagger @@ -340,41 +341,41 @@ public class DefaultCodegenTest { // This property has the following inline schema. // additionalProperties: // type: string - Assert.assertNotNull(map_string_sc); - Assert.assertNotNull(map_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_string_cp.getAdditionalProperties()); + Assertions.assertNotNull(map_string_sc); + Assertions.assertNotNull(map_string_sc.getAdditionalProperties()); + Assertions.assertNotNull(map_string_cp.getAdditionalProperties()); // map_with_additional_properties // This property has the following inline schema. // additionalProperties: true - Assert.assertNotNull(map_with_additional_properties_sc); + Assertions.assertNotNull(map_with_additional_properties_sc); // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. // We cannot differentiate between 'additionalProperties' not present and // additionalProperties: true. // UPDATE fixed in swagger parser 2.1.14 - Assert.assertTrue((Boolean) map_with_additional_properties_sc.getAdditionalProperties()); + Assertions.assertTrue((Boolean) map_with_additional_properties_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_with_additional_properties_sc); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_additional_properties_cp.getAdditionalProperties()); + Assertions.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(map_with_additional_properties_cp.getAdditionalProperties()); // map_without_additional_properties // This property has the following inline schema. // additionalProperties: false - Assert.assertNotNull(map_without_additional_properties_sc); + Assertions.assertNotNull(map_without_additional_properties_sc); // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. // We cannot differentiate between 'additionalProperties' not present and // additionalProperties: false. // UPDATE fixed in swagger parser 2.1.14 - Assert.assertFalse((Boolean) map_without_additional_properties_sc.getAdditionalProperties()); + Assertions.assertFalse((Boolean) map_without_additional_properties_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_without_additional_properties_sc); - Assert.assertNull(addProps); - Assert.assertNull(map_without_additional_properties_cp.getAdditionalProperties()); + Assertions.assertNull(addProps); + Assertions.assertNull(map_without_additional_properties_cp.getAdditionalProperties()); // check of composed schema model String schemaName = "Parent"; schema = openAPI.getComponents().getSchemas().get(schemaName); cm = codegen.fromModel(schemaName, schema); - Assert.assertNull(cm.getAdditionalProperties()); + Assertions.assertNull(cm.getAdditionalProperties()); } @Test @@ -396,14 +397,14 @@ public class DefaultCodegenTest { */ Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); + Assertions.assertNull(schema.getAdditionalProperties()); Schema addProps = ModelUtils.getAdditionalProperties(schema); // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the // 'additionalProperties' keyword for this model, hence assert the value to be null. - Assert.assertNull(addProps); + Assertions.assertNull(addProps); CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", schema); - Assert.assertNotNull(cm.getAdditionalProperties()); + Assertions.assertNotNull(cm.getAdditionalProperties()); // When the 'additionalProperties' keyword is not present, the model // should allow undeclared properties. However, due to bug // https://github.com/swagger-api/swagger-parser/issues/1369, the swagger @@ -431,41 +432,41 @@ public class DefaultCodegenTest { // This property has the following inline schema. // additionalProperties: // type: string - Assert.assertNotNull(map_string_sc); - Assert.assertNotNull(map_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_string_cp.getAdditionalProperties()); + Assertions.assertNotNull(map_string_sc); + Assertions.assertNotNull(map_string_sc.getAdditionalProperties()); + Assertions.assertNotNull(map_string_cp.getAdditionalProperties()); // map_with_additional_properties // This property has the following inline schema. // additionalProperties: true - Assert.assertNotNull(map_with_additional_properties_sc); + Assertions.assertNotNull(map_with_additional_properties_sc); // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. // We cannot differentiate between 'additionalProperties' not present and // additionalProperties: true. // UPDATE fixed in swagger parser 2.1.14 - Assert.assertTrue((Boolean) map_with_additional_properties_sc.getAdditionalProperties()); + Assertions.assertTrue((Boolean) map_with_additional_properties_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_with_additional_properties_sc); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_additional_properties_cp.getAdditionalProperties()); + Assertions.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(map_with_additional_properties_cp.getAdditionalProperties()); // map_without_additional_properties // This property has the following inline schema. // additionalProperties: false - Assert.assertNotNull(map_without_additional_properties_sc); + Assertions.assertNotNull(map_without_additional_properties_sc); // It is unfortunate that child.getAdditionalProperties() returns null for a V2 schema. // We cannot differentiate between 'additionalProperties' not present and // additionalProperties: false. // UPDATE fixed in swagger parser 2.1.14 - Assert.assertFalse((Boolean) map_without_additional_properties_sc.getAdditionalProperties()); + Assertions.assertFalse((Boolean) map_without_additional_properties_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_without_additional_properties_sc); - Assert.assertEquals(addProps, null); - Assert.assertNull(map_without_additional_properties_cp.getAdditionalProperties()); + Assertions.assertEquals(addProps, null); + Assertions.assertNull(map_without_additional_properties_cp.getAdditionalProperties()); // check of composed schema model String schemaName = "Parent"; schema = openAPI.getComponents().getSchemas().get(schemaName); cm = codegen.fromModel(schemaName, schema); - Assert.assertNotNull(cm.getAdditionalProperties()); + Assertions.assertNotNull(cm.getAdditionalProperties()); } @Test @@ -477,15 +478,15 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); Schema componentSchema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(componentSchema.getAdditionalProperties()); + Assertions.assertNull(componentSchema.getAdditionalProperties()); // When the 'additionalProperties' keyword is not present, the schema may be // extended with any undeclared properties. Schema addProps = ModelUtils.getAdditionalProperties(componentSchema); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(addProps); + Assertions.assertEquals(addProps, new Schema()); CodegenModel cm = codegen.fromModel("AdditionalPropertiesClass", componentSchema); - Assert.assertNotNull(cm.getAdditionalProperties()); + Assertions.assertNotNull(cm.getAdditionalProperties()); Map modelPropSchemas = componentSchema.getProperties(); Schema map_with_undeclared_properties_string_sc = modelPropSchemas.get("map_with_undeclared_properties_string"); @@ -517,60 +518,60 @@ public class DefaultCodegenTest { // This property has the following inline schema. // additionalProperties: // type: string - Assert.assertNotNull(map_with_undeclared_properties_string_sc); - Assert.assertNotNull(map_with_undeclared_properties_string_sc.getAdditionalProperties()); - Assert.assertNotNull(map_with_undeclared_properties_string_cp.getAdditionalProperties()); + Assertions.assertNotNull(map_with_undeclared_properties_string_sc); + Assertions.assertNotNull(map_with_undeclared_properties_string_sc.getAdditionalProperties()); + Assertions.assertNotNull(map_with_undeclared_properties_string_cp.getAdditionalProperties()); // map_with_undeclared_properties_anytype_1 // This property does not use the additionalProperties keyword, // which means by default undeclared properties are allowed. - Assert.assertNotNull(map_with_undeclared_properties_anytype_1_sc); - Assert.assertNull(map_with_undeclared_properties_anytype_1_sc.getAdditionalProperties()); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_1_sc); + Assertions.assertNull(map_with_undeclared_properties_anytype_1_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_with_undeclared_properties_anytype_1_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_1_cp.getAdditionalProperties()); + Assertions.assertNotNull(addProps); + Assertions.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_1_cp.getAdditionalProperties()); // map_with_undeclared_properties_anytype_2 // This property does not use the additionalProperties keyword, // which means by default undeclared properties are allowed. - Assert.assertNotNull(map_with_undeclared_properties_anytype_2_sc); - Assert.assertNull(map_with_undeclared_properties_anytype_2_sc.getAdditionalProperties()); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_2_sc); + Assertions.assertNull(map_with_undeclared_properties_anytype_2_sc.getAdditionalProperties()); addProps = ModelUtils.getAdditionalProperties(map_with_undeclared_properties_anytype_2_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_2_cp.getAdditionalProperties()); + Assertions.assertNotNull(addProps); + Assertions.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_2_cp.getAdditionalProperties()); // map_with_undeclared_properties_anytype_3 // This property has the following inline schema. // additionalProperties: true - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_3_sc); // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and // additionalProperties: true. - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties()); - Assert.assertEquals(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties(), Boolean.TRUE); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties()); + Assertions.assertEquals(map_with_undeclared_properties_anytype_3_sc.getAdditionalProperties(), Boolean.TRUE); addProps = ModelUtils.getAdditionalProperties(map_with_undeclared_properties_anytype_3_sc); - Assert.assertNotNull(addProps); - Assert.assertEquals(addProps, new Schema()); - Assert.assertNotNull(map_with_undeclared_properties_anytype_3_cp.getAdditionalProperties()); + Assertions.assertNotNull(addProps); + Assertions.assertEquals(addProps, new Schema()); + Assertions.assertNotNull(map_with_undeclared_properties_anytype_3_cp.getAdditionalProperties()); // empty_map // This property has the following inline schema. // additionalProperties: false - Assert.assertNotNull(empty_map_sc); + Assertions.assertNotNull(empty_map_sc); // Unlike the V2 spec, in V3 we CAN differentiate between 'additionalProperties' not present and // additionalProperties: false. - Assert.assertNotNull(empty_map_sc.getAdditionalProperties()); - Assert.assertEquals(empty_map_sc.getAdditionalProperties(), Boolean.FALSE); + Assertions.assertNotNull(empty_map_sc.getAdditionalProperties()); + Assertions.assertEquals(empty_map_sc.getAdditionalProperties(), Boolean.FALSE); addProps = ModelUtils.getAdditionalProperties(empty_map_sc); - Assert.assertNull(addProps); - Assert.assertNull(empty_map_cp.getAdditionalProperties()); + Assertions.assertNull(addProps); + Assertions.assertNull(empty_map_cp.getAdditionalProperties()); // check of composed schema model String schemaName = "SomeObject"; Schema schema = openAPI.getComponents().getSchemas().get(schemaName); cm = codegen.fromModel(schemaName, schema); - Assert.assertNotNull(cm.getAdditionalProperties()); + Assertions.assertNotNull(cm.getAdditionalProperties()); } @Test @@ -585,10 +586,10 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); Schema schema = openAPI.getComponents().getSchemas().get("AdditionalPropertiesClass"); - Assert.assertNull(schema.getAdditionalProperties()); + Assertions.assertNull(schema.getAdditionalProperties()); Schema addProps = ModelUtils.getAdditionalProperties(schema); - Assert.assertNull(addProps); + Assertions.assertNull(addProps); } @Test @@ -600,8 +601,8 @@ public class DefaultCodegenTest { Operation operation = openAPI.getPaths().get("/test").getGet(); CodegenOperation co = codegen.fromOperation("/test", "get", operation, null); - Assert.assertEquals(co.produces.size(), 1); - Assert.assertEquals(co.produces.get(0).get("mediaType"), "application/json"); + Assertions.assertEquals(co.produces.size(), 1); + Assertions.assertEquals(co.produces.get(0).get("mediaType"), "application/json"); } @Test @@ -616,14 +617,14 @@ public class DefaultCodegenTest { DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); CodegenOperation co = codegen.fromOperation("/some/path", "get", operation, null); - Assert.assertEquals(co.path, "/some/path"); - Assert.assertEquals(co.allParams.size(), 2); + Assertions.assertEquals(co.path, "/some/path"); + Assertions.assertEquals(co.allParams.size(), 2); List allParamsNames = co.allParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(allParamsNames.contains("myparam")); - Assert.assertTrue(allParamsNames.contains("myparam2")); + Assertions.assertTrue(allParamsNames.contains("myparam")); + Assertions.assertTrue(allParamsNames.contains("myparam2")); List queryParamsNames = co.queryParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(queryParamsNames.contains("myparam")); - Assert.assertTrue(queryParamsNames.contains("myparam2")); + Assertions.assertTrue(queryParamsNames.contains("myparam")); + Assertions.assertTrue(queryParamsNames.contains("myparam2")); } @Test @@ -633,11 +634,11 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); Operation operation = openAPI.getPaths().get("/form-param-poc/{id}").getPut(); CodegenOperation co = codegen.fromOperation("/form-param-poc/{id}", "put", operation, null); - Assert.assertEquals(co.path, "/form-param-poc/{id}"); - Assert.assertEquals(co.allParams.size(), 2); + Assertions.assertEquals(co.path, "/form-param-poc/{id}"); + Assertions.assertEquals(co.allParams.size(), 2); List allParamsNames = co.allParams.stream().map(p -> p.paramName).collect(Collectors.toList()); - Assert.assertTrue(allParamsNames.contains("id")); - Assert.assertTrue(allParamsNames.contains("id2")); + Assertions.assertTrue(allParamsNames.contains("id")); + Assertions.assertTrue(allParamsNames.contains("id2")); } @Test @@ -650,8 +651,8 @@ public class DefaultCodegenTest { ModelUtils.getSchemaFromRequestBody(operation.getRequestBody())); String type = codegen.getSchemaType(schema); - Assert.assertNotNull(type); - Assert.assertEquals(type, "oneOf"); + Assertions.assertNotNull(type); + Assertions.assertEquals(type, "oneOf"); } @Test @@ -667,7 +668,7 @@ public class DefaultCodegenTest { Set oneOf = new TreeSet(); oneOf.add("Dog"); oneOf.add("Cat"); - Assert.assertEquals(petItems.oneOf, oneOf); + Assertions.assertEquals(petItems.oneOf, oneOf); // make sure that animal has the property type boolean typeSeen = false; boolean typeContainsEnums = false; @@ -680,14 +681,14 @@ public class DefaultCodegenTest { break; } } - Assert.assertTrue(typeSeen); - Assert.assertTrue(typeContainsEnums); + Assertions.assertTrue(typeSeen); + Assertions.assertTrue(typeContainsEnums); - Assert.assertEquals( + Assertions.assertEquals( ((StringSchema) openAPI.getComponents().getSchemas().get("Dog").getProperties().get("type")).getEnum().size(), 1 ); - Assert.assertEquals( + Assertions.assertEquals( ((StringSchema) openAPI.getComponents().getSchemas().get("Cat").getProperties().get("type")).getEnum().size(), 1 ); @@ -706,7 +707,7 @@ public class DefaultCodegenTest { Set oneOf = new TreeSet(); oneOf.add("Dog"); oneOf.add("Cat"); - Assert.assertEquals(pet.oneOf, oneOf); + Assertions.assertEquals(pet.oneOf, oneOf); // make sure that animal has the property type boolean typeSeen = false; for (CodegenProperty cp : pet.vars) { @@ -715,7 +716,7 @@ public class DefaultCodegenTest { break; } } - Assert.assertTrue(typeSeen); + Assertions.assertTrue(typeSeen); } @Test @@ -730,9 +731,9 @@ public class DefaultCodegenTest { Set oneOf = new TreeSet(); oneOf.add("Apple"); oneOf.add("Banana"); - Assert.assertEquals(fruit.oneOf, oneOf); - Assert.assertEquals(fruit.optionalVars.size(), 3); - Assert.assertEquals(fruit.vars.size(), 3); + Assertions.assertEquals(fruit.oneOf, oneOf); + Assertions.assertEquals(fruit.optionalVars.size(), 3); + Assertions.assertEquals(fruit.vars.size(), 3); // make sure that fruit has the property color boolean colorSeen = false; for (CodegenProperty cp : fruit.vars) { @@ -741,7 +742,7 @@ public class DefaultCodegenTest { break; } } - Assert.assertTrue(colorSeen); + Assertions.assertTrue(colorSeen); colorSeen = false; for (CodegenProperty cp : fruit.optionalVars) { if ("color".equals(cp.name)) { @@ -749,19 +750,19 @@ public class DefaultCodegenTest { break; } } - Assert.assertTrue(colorSeen); + Assertions.assertTrue(colorSeen); } @Test public void testEscapeText() { final DefaultCodegen codegen = new DefaultCodegen(); - Assert.assertEquals(codegen.escapeText("\n"), " "); - Assert.assertEquals(codegen.escapeText("\r"), " "); - Assert.assertEquals(codegen.escapeText("\t"), " "); - Assert.assertEquals(codegen.escapeText("\\"), "\\\\"); - Assert.assertEquals(codegen.escapeText("\""), "\\\""); - Assert.assertEquals(codegen.escapeText("\\/"), "/"); + Assertions.assertEquals(codegen.escapeText("\n"), " "); + Assertions.assertEquals(codegen.escapeText("\r"), " "); + Assertions.assertEquals(codegen.escapeText("\t"), " "); + Assertions.assertEquals(codegen.escapeText("\\"), "\\\\"); + Assertions.assertEquals(codegen.escapeText("\""), "\\\""); + Assertions.assertEquals(codegen.escapeText("\\/"), "/"); } @Test @@ -769,14 +770,14 @@ public class DefaultCodegenTest { final DefaultCodegen codegen = new DefaultCodegen(); // allow new lines - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\n"), "\n"); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\r"), "\r"); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\n"), "\n"); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\r"), "\r"); // escape other special characters - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\t"), " "); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\"), "\\\\"); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\""), "\\\""); - Assert.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\/"), "/"); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\t"), " "); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\"), "\\\\"); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\""), "\\\""); + Assertions.assertEquals(codegen.escapeTextWhileAllowingNewLines("\\/"), "/"); } @Test @@ -787,12 +788,12 @@ public class DefaultCodegenTest { codegen.updateCodegenPropertyEnum(array); List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars); Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "_1"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "\"1\""); - Assert.assertEquals(testedEnumVar.getOrDefault("isString", ""), false); + Assertions.assertNotNull(testedEnumVar); + Assertions.assertEquals(testedEnumVar.getOrDefault("name", ""), "_1"); + Assertions.assertEquals(testedEnumVar.getOrDefault("value", ""), "\"1\""); + Assertions.assertEquals(testedEnumVar.getOrDefault("isString", ""), false); } @Test @@ -801,39 +802,39 @@ public class DefaultCodegenTest { CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("dog", "cat"), Arrays.asList("DOGVAR", "CATVAR")); (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); } { CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("1", "2"), Arrays.asList("ONE", "TWO")); (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ONE"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"1\""); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "TWO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"2\""); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ONE"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"1\""); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "TWO"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"2\""); } { CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("a", "b", "c", "d"), Arrays.asList("FOO", "BAR")); (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); - Assert.assertEquals(enumVars.get(2).getOrDefault("name", ""), "C"); - Assert.assertEquals(enumVars.get(3).getOrDefault("name", ""), "D"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); + Assertions.assertEquals(enumVars.get(2).getOrDefault("name", ""), "C"); + Assertions.assertEquals(enumVars.get(3).getOrDefault("name", ""), "D"); } { CodegenProperty enumProperty = codegenPropertyWithXEnumVarName(Arrays.asList("a", "b"), Arrays.asList("FOO", "BAR", "BAZ")); (new DefaultCodegen()).updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getAllowableValues().get("enumVars"); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); - Assert.assertEquals(enumVars.size(), 2); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "FOO"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "BAR"); + Assertions.assertEquals(enumVars.size(), 2); } } @@ -845,13 +846,13 @@ public class DefaultCodegenTest { codegen.updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); } @Test @@ -864,13 +865,13 @@ public class DefaultCodegenTest { codegen.updateCodegenPropertyEnum(enumProperty); List> enumVars = (List>) enumProperty.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); } @Test @@ -882,13 +883,13 @@ public class DefaultCodegenTest { codegen.postProcessModelsEnum(objs); List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOG"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CAT"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); } @Test @@ -901,13 +902,13 @@ public class DefaultCodegenTest { codegen.postProcessModelsEnum(objs); List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "ANIMAL_DOG"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"animal_dog\""); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "ANIMAL_CAT"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"animal_cat\""); } @Test @@ -919,15 +920,15 @@ public class DefaultCodegenTest { codegen.postProcessModelsEnum(objs); List> enumVars = (List>) cm.getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); - Assert.assertNotNull(enumVars.get(0)); - Assert.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); - Assert.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); - Assert.assertEquals(enumVars.get(0).getOrDefault("enumDescription", ""), "This is a dog"); - Assert.assertNotNull(enumVars.get(1)); - Assert.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); - Assert.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); - Assert.assertEquals(enumVars.get(1).getOrDefault("enumDescription", ""), "This is a cat"); + Assertions.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars.get(0)); + Assertions.assertEquals(enumVars.get(0).getOrDefault("name", ""), "DOGVAR"); + Assertions.assertEquals(enumVars.get(0).getOrDefault("value", ""), "\"dog\""); + Assertions.assertEquals(enumVars.get(0).getOrDefault("enumDescription", ""), "This is a dog"); + Assertions.assertNotNull(enumVars.get(1)); + Assertions.assertEquals(enumVars.get(1).getOrDefault("name", ""), "CATVAR"); + Assertions.assertEquals(enumVars.get(1).getOrDefault("value", ""), "\"cat\""); + Assertions.assertEquals(enumVars.get(1).getOrDefault("enumDescription", ""), "This is a cat"); } @Test @@ -939,15 +940,15 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - Assert.assertEquals(codegenParameter.example, "example1 value"); + Assertions.assertEquals(codegenParameter.example, "example1 value"); Operation operation2 = openAPI.getPaths().get("/example1/plural").getGet(); CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - Assert.assertEquals(codegenParameter2.example, "An example1 value"); + Assertions.assertEquals(codegenParameter2.example, "An example1 value"); // verify examples are available codegen.setParameterExamples(codegenParameter2, operation2.getParameters().get(0)); - Assert.assertEquals(codegenParameter2.examples.size(), 1); + Assertions.assertEquals(codegenParameter2.examples.size(), 1); } @Test @@ -959,7 +960,7 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - Assert.assertEquals(codegenParameter.example, "example2 value"); + Assertions.assertEquals(codegenParameter.example, "example2 value"); } @Test @@ -971,13 +972,13 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); - Assert.assertEquals(codegenParameter.example, "example3: parameter value"); + Assertions.assertEquals(codegenParameter.example, "example3: parameter value"); Operation operation2 = openAPI.getPaths().get("/example3/plural").getGet(); CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - Assert.assertEquals(codegenParameter2.example, "An example3 value"); + Assertions.assertEquals(codegenParameter2.example, "An example3 value"); } @Test @@ -989,13 +990,13 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter, operation.getRequestBody()); - Assert.assertEquals(codegenParameter.example, "example4 value"); + Assertions.assertEquals(codegenParameter.example, "example4 value"); Operation operation2 = openAPI.getPaths().get("/example4/plural").getPost(); CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter2, operation2.getRequestBody()); - Assert.assertEquals(codegenParameter2.example, "An example4 value"); + Assertions.assertEquals(codegenParameter2.example, "An example4 value"); } @Test @@ -1009,23 +1010,23 @@ public class DefaultCodegenTest { CodegenOperation codegenOperation = codegen.fromOperation(path, "GET", operation, null); List> examples = codegenOperation.examples; - Assert.assertEquals(examples.size(), 4); + Assertions.assertEquals(examples.size(), 4); // 200 response example - Assert.assertEquals(examples.get(0).get("contentType"), "application/json"); - Assert.assertEquals(examples.get(0).get("example"), "\"a successful response example\""); - Assert.assertEquals(examples.get(0).get("statusCode"), "200"); + Assertions.assertEquals(examples.get(0).get("contentType"), "application/json"); + Assertions.assertEquals(examples.get(0).get("example"), "\"a successful response example\""); + Assertions.assertEquals(examples.get(0).get("statusCode"), "200"); // 301 response example - Assert.assertEquals(examples.get(1).get("contentType"), "application/json"); - Assert.assertEquals(examples.get(1).get("example"), "\"a redirect response example\""); - Assert.assertEquals(examples.get(1).get("statusCode"), "301"); + Assertions.assertEquals(examples.get(1).get("contentType"), "application/json"); + Assertions.assertEquals(examples.get(1).get("example"), "\"a redirect response example\""); + Assertions.assertEquals(examples.get(1).get("statusCode"), "301"); // 404 response example - Assert.assertEquals(examples.get(2).get("contentType"), "application/json"); - Assert.assertEquals(examples.get(2).get("example"), "\"a not found response example\""); - Assert.assertEquals(examples.get(2).get("statusCode"), "404"); + Assertions.assertEquals(examples.get(2).get("contentType"), "application/json"); + Assertions.assertEquals(examples.get(2).get("example"), "\"a not found response example\""); + Assertions.assertEquals(examples.get(2).get("statusCode"), "404"); // 500 response example - Assert.assertEquals(examples.get(3).get("contentType"), "application/json"); - Assert.assertEquals(examples.get(3).get("example"), "\"an internal server error response example\""); - Assert.assertEquals(examples.get(3).get("statusCode"), "500"); + Assertions.assertEquals(examples.get(3).get("contentType"), "application/json"); + Assertions.assertEquals(examples.get(3).get("example"), "\"an internal server error response example\""); + Assertions.assertEquals(examples.get(3).get("statusCode"), "500"); } @Test @@ -1043,8 +1044,8 @@ public class DefaultCodegenTest { test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Dog", "Dog")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("BigCat", "BigCat")); - Assert.assertEquals(discriminator, test); - Assert.assertEquals(animalModel.getHasDiscriminatorWithNonEmptyMapping(), true); + Assertions.assertEquals(discriminator, test); + Assertions.assertTrue(animalModel.getHasDiscriminatorWithNonEmptyMapping()); } @Test @@ -1063,7 +1064,7 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); CodegenModel personModel = codegen.fromModel("Person", person); verifyPersonDiscriminator(personModel.discriminator); - Assert.assertEquals(personModel.getHasDiscriminatorWithNonEmptyMapping(), true); + Assertions.assertTrue(personModel.getHasDiscriminatorWithNonEmptyMapping()); } @Test @@ -1074,8 +1075,8 @@ public class DefaultCodegenTest { Schema child = openAPI.getComponents().getSchemas().get("Child"); codegen.setOpenAPI(openAPI); CodegenModel childModel = codegen.fromModel("Child", child); - Assert.assertEquals(childModel.parentSchema, "Person"); - Assert.assertEquals(childModel.getHasDiscriminatorWithNonEmptyMapping(), false); + Assertions.assertEquals(childModel.parentSchema, "Person"); + Assertions.assertFalse(childModel.getHasDiscriminatorWithNonEmptyMapping()); } @Test @@ -1086,7 +1087,7 @@ public class DefaultCodegenTest { Schema child = openAPI.getComponents().getSchemas().get("clubForCreation"); codegen.setOpenAPI(openAPI); CodegenModel childModel = codegen.fromModel("clubForCreation", child); - Assert.assertEquals(getRequiredVars(childModel), Collections.singletonList("name")); + Assertions.assertEquals(getRequiredVars(childModel), Collections.singletonList("name")); } @Test @@ -1099,20 +1100,20 @@ public class DefaultCodegenTest { // to test allOf with double refs Schema supermanSchema = openAPI.getComponents().getSchemas().get("SuperMan"); CodegenModel supermanModel = codegen.fromModel("SuperMan", supermanSchema); - Assert.assertNull(supermanModel.parent); - Assert.assertEquals(supermanModel.allParents, null); + Assertions.assertNull(supermanModel.parent); + Assertions.assertNull(supermanModel.allParents); // to test allOf with single ref Schema superboySchema = openAPI.getComponents().getSchemas().get("SuperBoy"); CodegenModel superboyModel = codegen.fromModel("SuperBoy", superboySchema); - Assert.assertNull(superboyModel.parent); - Assert.assertEquals(superboyModel.allParents, null); + Assertions.assertNull(superboyModel.parent); + Assertions.assertNull(superboyModel.allParents); // to test allOf with single ref and no "type: object" in the (last) inline schema Schema superbabySchema = openAPI.getComponents().getSchemas().get("SuperBaby"); CodegenModel superbabyModel = codegen.fromModel("SuperBaby", superbabySchema); - Assert.assertNull(superbabyModel.parent); - Assert.assertEquals(superbabyModel.allParents, null); + Assertions.assertNull(superbabyModel.parent); + Assertions.assertNull(superbabyModel.allParents); } @Test @@ -1124,8 +1125,8 @@ public class DefaultCodegenTest { Schema adultSchema = openAPI.getComponents().getSchemas().get("Adult"); CodegenModel adultModel = codegen.fromModel("Adult", adultSchema); - Assert.assertEquals(adultModel.parent, "Person"); - Assert.assertEquals(adultModel.allParents, Collections.singletonList("Person")); + Assertions.assertEquals(adultModel.parent, "Person"); + Assertions.assertEquals(adultModel.allParents, Collections.singletonList("Person")); } @Test @@ -1148,8 +1149,8 @@ public class DefaultCodegenTest { for (String leafModelName : leafModelNames) { Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); - Assert.assertEquals(leafCm.discriminator, emptyMapDisc); - Assert.assertEquals(leafCm.getHasDiscriminatorWithNonEmptyMapping(), false); + Assertions.assertEquals(leafCm.discriminator, emptyMapDisc); + Assertions.assertFalse(leafCm.getHasDiscriminatorWithNonEmptyMapping()); } // the Pet discriminator map contains all animals + Reptile (children + grandchildren) @@ -1165,8 +1166,8 @@ public class DefaultCodegenTest { modelName = "Pet"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel pet = codegen.fromModel(modelName, sc); - Assert.assertEquals(pet.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(pet.discriminator, petDisc); + Assertions.assertTrue(pet.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(pet.discriminator, petDisc); // the Reptile discriminator contains both reptiles List reptileModelNames = Arrays.asList("Lizard", "Snake"); @@ -1181,8 +1182,8 @@ public class DefaultCodegenTest { modelName = "Reptile"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel reptile = codegen.fromModel(modelName, sc); - Assert.assertEquals(reptile.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(reptile.discriminator, reptileDisc); + Assertions.assertTrue(reptile.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(reptile.discriminator, reptileDisc); // the MyPets discriminator contains Cat and Lizard List myPetNames = Arrays.asList("Cat", "Lizard"); @@ -1197,15 +1198,15 @@ public class DefaultCodegenTest { modelName = "MyPets"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel myPets = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPets.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(myPets.discriminator, myPetDisc); + Assertions.assertTrue(myPets.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(myPets.discriminator, myPetDisc); // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator modelName = "MyPetsNoDisc"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPetsNoDisc.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(myPetsNoDisc.discriminator, myPetDisc); + Assertions.assertTrue(myPetsNoDisc.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(myPetsNoDisc.discriminator, myPetDisc); CodegenModel cm; @@ -1216,8 +1217,8 @@ public class DefaultCodegenTest { hs.clear(); hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"), true)); hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertTrue(cm.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // the mapping in b is in B modelName = "B"; @@ -1226,8 +1227,8 @@ public class DefaultCodegenTest { hs.clear(); hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"), true)); hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertTrue(cm.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // the mapping in b is in C modelName = "C"; @@ -1235,8 +1236,8 @@ public class DefaultCodegenTest { cm = codegen.fromModel(modelName, sc); hs.clear(); hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"), true)); - Assert.assertEquals(cm.getHasDiscriminatorWithNonEmptyMapping(), true); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertTrue(cm.getHasDiscriminatorWithNonEmptyMapping()); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); } @Test @@ -1259,7 +1260,7 @@ public class DefaultCodegenTest { for (String leafModelName : leafModelNames) { Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); - Assert.assertNull(leafCm.discriminator); + Assertions.assertNull(leafCm.discriminator); } // the Pet discriminator map contains all animals + Reptile (children + grandchildren) @@ -1275,7 +1276,7 @@ public class DefaultCodegenTest { modelName = "Pet"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel pet = codegen.fromModel(modelName, sc); - Assert.assertEquals(pet.discriminator, petDisc); + Assertions.assertEquals(pet.discriminator, petDisc); // the Reptile discriminator contains both reptiles List reptileModelNames = Arrays.asList("Lizard", "Snake"); @@ -1290,7 +1291,7 @@ public class DefaultCodegenTest { modelName = "Reptile"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel reptile = codegen.fromModel(modelName, sc); - Assert.assertNull(reptile.discriminator); + Assertions.assertNull(reptile.discriminator); // the MyPets discriminator contains Cat and Lizard CodegenDiscriminator myPetDisc = new CodegenDiscriminator(); @@ -1300,13 +1301,13 @@ public class DefaultCodegenTest { modelName = "MyPets"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel myPets = codegen.fromModel(modelName, sc); - Assert.assertEquals(myPets.discriminator, myPetDisc); + Assertions.assertEquals(myPets.discriminator, myPetDisc); // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator modelName = "MyPetsNoDisc"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); - Assert.assertNull(myPetsNoDisc.discriminator); + Assertions.assertNull(myPetsNoDisc.discriminator); CodegenModel cm; @@ -1316,19 +1317,19 @@ public class DefaultCodegenTest { cm = codegen.fromModel(modelName, sc); hs.clear(); hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"), true)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // the mapping in b is in B modelName = "B"; sc = openAPI.getComponents().getSchemas().get(modelName); cm = codegen.fromModel(modelName, sc); - Assert.assertNull(cm.discriminator); + Assertions.assertNull(cm.discriminator); // the mapping in b is in C modelName = "C"; sc = openAPI.getComponents().getSchemas().get(modelName); cm = codegen.fromModel(modelName, sc); - Assert.assertNull(cm.discriminator); + Assertions.assertNull(cm.discriminator); } @Test @@ -1358,9 +1359,9 @@ public class DefaultCodegenTest { // comment out below as we're now showing warnings instead of throwing exceptions try { codegen.fromModel(modelName, sc); - Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + Assertions.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); } catch (RuntimeException re) { - Assert.assertEquals(re.getMessage(), errorMessageExpected); + Assertions.assertEquals(re.getMessage(), errorMessageExpected); } */ } @@ -1393,9 +1394,9 @@ public class DefaultCodegenTest { // comment out below as we're now showing warnings instead of throwing exceptions try { codegen.fromModel(modelName, sc); - Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + Assertions.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); } catch (RuntimeException re) { - Assert.assertEquals(re.getMessage(), errorMessageExpected); + Assertions.assertEquals(re.getMessage(), errorMessageExpected); } */ } @@ -1423,13 +1424,13 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); mn = "FruitInlineDisc_anyOf_1"; hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // inline anyOf with inline anyOf model doesn't work because we have null $refs and we throw an exception final String fmodelName = "FruitInlineInlineDisc"; final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); // comment out below as we're now showing warnings instead of throwing exceptions - //Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); + //Assertions.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); // ref anyOf models with discriminator in properties in those models modelName = "FruitReqDisc"; @@ -1440,7 +1441,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaReqDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in allOf in those models modelName = "FruitAllOfDisc"; @@ -1451,7 +1452,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaAllOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in anyOf in those models modelName = "FruitAnyOfDisc"; @@ -1462,7 +1463,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaAnyOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in anyOf in those models modelName = "FruitAnyOfDisc"; @@ -1473,7 +1474,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaAnyOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in the grandparent schemas of those anyof models modelName = "FruitGrandparentDisc"; @@ -1484,7 +1485,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaGrandparentDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); } @Test @@ -1509,13 +1510,13 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); mn = "FruitInlineDisc_oneOf_1"; hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // inline oneOf with inline oneOf model doesn't work because we have null $refs and we throw an exception final String fmodelName = "FruitInlineInlineDisc"; final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); // comment out below as we're now showing warnings instead of throwing exceptions - //Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); + //Assertions.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); // ref oneOf models with discriminator in properties in those models modelName = "FruitReqDisc"; @@ -1526,7 +1527,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaReqDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in allOf in those models modelName = "FruitAllOfDisc"; @@ -1537,7 +1538,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaAllOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in anyOf in those models modelName = "FruitAnyOfDisc"; @@ -1548,7 +1549,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaAnyOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with discriminator in oneOf in those models modelName = "FruitOneOfDisc"; @@ -1559,7 +1560,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaOneOfDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); // ref oneOf models with enum property discriminator modelName = "FruitOneOfEnumMappingDisc"; @@ -1576,7 +1577,7 @@ public class DefaultCodegenTest { hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); mn = "BananaGrandparentDisc"; hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); - Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + Assertions.assertEquals(cm.discriminator.getMappedModels(), hs); } @Test @@ -1702,13 +1703,14 @@ public class DefaultCodegenTest { List files = new ArrayList<>(); List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); + List aliasModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas, aliasModels); // check that the model's children contain the x-discriminator-values modelName = "BaseObj"; cm = getModel(allModels, modelName); - Assert.assertNotNull(cm); - Assert.assertNotNull(cm.children); + Assertions.assertNotNull(cm); + Assertions.assertNotNull(cm.children); List expectedDiscriminatorValues = new ArrayList<>(Arrays.asList("daily", "sub-obj")); ArrayList xDiscriminatorValues = new ArrayList<>(); for (CodegenModel child : cm.children) { @@ -1737,9 +1739,9 @@ public class DefaultCodegenTest { Schema schema = openAPI.getComponents().getSchemas().get("NewMessageEventCoreNoOwnProps"); codegen.setOpenAPI(openAPI); CodegenModel model = codegen.fromModel("NewMessageEventCoreNoOwnProps", schema); - Assert.assertEquals(getNames(model.getVars()), Arrays.asList("id", "message")); - Assert.assertNull(model.parent); - Assert.assertNull(model.allParents); + Assertions.assertEquals(getNames(model.getVars()), Arrays.asList("id", "message")); + Assertions.assertNull(model.parent); + Assertions.assertNull(model.allParents); } @Test @@ -1750,15 +1752,15 @@ public class DefaultCodegenTest { Schema person = openAPI.getComponents().getSchemas().get("person"); CodegenModel personModel = codegen.fromModel("person", person); - Assert.assertEquals(getRequiredVars(personModel), Arrays.asList("firstName", "name", "email", "id")); + Assertions.assertEquals(getRequiredVars(personModel), Arrays.asList("firstName", "name", "email", "id")); Schema personForCreation = openAPI.getComponents().getSchemas().get("personForCreation"); CodegenModel personForCreationModel = codegen.fromModel("personForCreation", personForCreation); - Assert.assertEquals(getRequiredVars(personForCreationModel), Arrays.asList("firstName", "name", "email")); + Assertions.assertEquals(getRequiredVars(personForCreationModel), Arrays.asList("firstName", "name", "email")); Schema personForUpdate = openAPI.getComponents().getSchemas().get("personForUpdate"); CodegenModel personForUpdateModel = codegen.fromModel("personForUpdate", personForUpdate); - Assert.assertEquals(getRequiredVars(personForUpdateModel), Collections.emptyList()); + Assertions.assertEquals(getRequiredVars(personForUpdateModel), Collections.emptyList()); } private List getRequiredVars(CodegenModel model) { @@ -1780,40 +1782,40 @@ public class DefaultCodegenTest { Operation subscriptionOperation = openAPI.getPaths().get("/streams").getPost(); CodegenOperation op = codegen.fromOperation(path, "post", subscriptionOperation, null); - Assert.assertFalse(op.isCallbackRequest); - Assert.assertNotNull(op.operationId); - Assert.assertEquals(op.callbacks.size(), 2); + Assertions.assertFalse(op.isCallbackRequest); + Assertions.assertNotNull(op.operationId); + Assertions.assertEquals(op.callbacks.size(), 2); CodegenCallback cbB = op.callbacks.get(1); - Assert.assertEquals(cbB.name, "dummy"); - Assert.assertEquals(cbB.urls.size(), 0); + Assertions.assertEquals(cbB.name, "dummy"); + Assertions.assertEquals(cbB.urls.size(), 0); CodegenCallback cbA = op.callbacks.get(0); - Assert.assertEquals(cbA.name, "onData"); + Assertions.assertEquals(cbA.name, "onData"); - Assert.assertEquals(cbA.urls.size(), 2); + Assertions.assertEquals(cbA.urls.size(), 2); CodegenCallback.Url urlB = cbA.urls.get(1); - Assert.assertEquals(urlB.expression, "{$request.query.callbackUrl}/test"); - Assert.assertEquals(urlB.requests.size(), 0); + Assertions.assertEquals(urlB.expression, "{$request.query.callbackUrl}/test"); + Assertions.assertEquals(urlB.requests.size(), 0); CodegenCallback.Url urlA = cbA.urls.get(0); - Assert.assertEquals(urlA.expression, "{$request.query.callbackUrl}/data"); - Assert.assertEquals(urlA.requests.size(), 2); + Assertions.assertEquals(urlA.expression, "{$request.query.callbackUrl}/data"); + Assertions.assertEquals(urlA.requests.size(), 2); urlA.requests.forEach(req -> { - Assert.assertTrue(req.isCallbackRequest); - Assert.assertNotNull(req.bodyParam); - Assert.assertEquals(req.responses.size(), 2); + Assertions.assertTrue(req.isCallbackRequest); + Assertions.assertNotNull(req.bodyParam); + Assertions.assertEquals(req.responses.size(), 2); switch (req.httpMethod.toLowerCase(Locale.getDefault())) { case "post": - Assert.assertEquals(req.operationId, "onDataDataPost"); - Assert.assertEquals(req.bodyParam.dataType, "NewNotificationData"); + Assertions.assertEquals(req.operationId, "onDataDataPost"); + Assertions.assertEquals(req.bodyParam.dataType, "NewNotificationData"); break; case "delete": - Assert.assertEquals(req.operationId, "onDataDataDelete"); - Assert.assertEquals(req.bodyParam.dataType, "DeleteNotificationData"); + Assertions.assertEquals(req.operationId, "onDataDataDelete"); + Assertions.assertEquals(req.bodyParam.dataType, "DeleteNotificationData"); break; default: Assert.fail(String.format(Locale.getDefault(), "invalid callback request http method '%s'", req.httpMethod)); @@ -1832,9 +1834,9 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); CodegenOperation co1 = codegen.fromOperation("/here", "get", operation2, null); - Assert.assertEquals(co1.path, "/here"); + Assertions.assertEquals(co1.path, "/here"); CodegenOperation co2 = codegen.fromOperation("some/path", "get", operation2, null); - Assert.assertEquals(co2.path, "/some/path"); + Assertions.assertEquals(co2.path, "/some/path"); } @Test @@ -1852,8 +1854,8 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); CodegenOperation co = codegen.fromOperation("/here", "get", myOperation, null); - Assert.assertEquals(co.responses.get(0).message, "Error"); - Assert.assertEquals(co.responses.get(1).message, "Default"); + Assertions.assertEquals(co.responses.get(0).message, "Error"); + Assertions.assertEquals(co.responses.get(1).message, "Default"); } @Test @@ -1870,8 +1872,8 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); CodegenResponse cr = codegen.fromResponse("2XX", response2XX); - Assert.assertNotNull(cr); - Assert.assertTrue(cr.hasHeaders); + Assertions.assertNotNull(cr); + Assertions.assertTrue(cr.hasHeaders); } @Test @@ -1883,7 +1885,7 @@ public class DefaultCodegenTest { CodegenProperty property = codegen.fromProperty("address", (Schema) openAPI.getComponents().getSchemas().get("User").getProperties().get("address")); - Assert.assertTrue(property.isNullable); + Assertions.assertTrue(property.isNullable); } @Test @@ -1894,10 +1896,10 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); CodegenModel codegenPetModel = codegen.fromModel("Pet", openAPI.getComponents().getSchemas().get("Pet")); - Assert.assertTrue(codegenPetModel.isDeprecated); + Assertions.assertTrue(codegenPetModel.isDeprecated); CodegenModel codegenFoodModel = codegen.fromModel("Food", openAPI.getComponents().getSchemas().get("Food")); - Assert.assertTrue(codegenFoodModel.isDeprecated); + Assertions.assertTrue(codegenFoodModel.isDeprecated); } @Test @@ -1910,10 +1912,10 @@ public class DefaultCodegenTest { final Map responseProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); - Assert.assertTrue(codegen.fromProperty("firstName", (Schema) responseProperties.get("firstName")).deprecated); - Assert.assertFalse(codegen.fromProperty("customerCode", (Schema) responseProperties.get("customerCode")).deprecated); - Assert.assertTrue(codegen.fromProperty("firstName", (Schema) requestProperties.get("firstName")).deprecated); - Assert.assertFalse(codegen.fromProperty("customerCode", (Schema) requestProperties.get("customerCode")).deprecated); + Assertions.assertTrue(codegen.fromProperty("firstName", (Schema) responseProperties.get("firstName")).deprecated); + Assertions.assertFalse(codegen.fromProperty("customerCode", (Schema) responseProperties.get("customerCode")).deprecated); + Assertions.assertTrue(codegen.fromProperty("firstName", (Schema) requestProperties.get("firstName")).deprecated); + Assertions.assertFalse(codegen.fromProperty("customerCode", (Schema) requestProperties.get("customerCode")).deprecated); } @Test @@ -1925,8 +1927,8 @@ public class DefaultCodegenTest { final Map testProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("ModelWithTitledProperties").getProperties()); - Assert.assertEquals("Simple-Property-Title", codegen.fromProperty("simpleProperty", (Schema) testProperties.get("simpleProperty")).title); - Assert.assertEquals("Ref-Property-Title", codegen.fromProperty("refProperty", (Schema) testProperties.get("refProperty")).title); + Assertions.assertEquals("Simple-Property-Title", codegen.fromProperty("simpleProperty", (Schema) testProperties.get("simpleProperty")).title); + Assertions.assertEquals("Ref-Property-Title", codegen.fromProperty("refProperty", (Schema) testProperties.get("refProperty")).title); } @Test @@ -1938,8 +1940,8 @@ public class DefaultCodegenTest { final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("complex").getProperties()); - Assert.assertTrue(codegen.fromProperty("deprecated", (Schema) requestProperties.get("deprecated")).deprecated); - Assert.assertFalse(codegen.fromProperty("current", (Schema) requestProperties.get("current")).deprecated); + Assertions.assertTrue(codegen.fromProperty("deprecated", (Schema) requestProperties.get("deprecated")).deprecated); + Assertions.assertFalse(codegen.fromProperty("current", (Schema) requestProperties.get("current")).deprecated); } @Test @@ -1951,27 +1953,27 @@ public class DefaultCodegenTest { //Property: final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "integer"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertTrue(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); + Assertions.assertEquals(cp.baseType, "integer"); + Assertions.assertEquals(cp.baseName, "someProperty"); + Assertions.assertFalse(cp.isString); + Assertions.assertTrue(cp.isInteger); + Assertions.assertFalse(cp.isLong); + Assertions.assertFalse(cp.isNumber); + Assertions.assertTrue(cp.isNumeric); + Assertions.assertFalse(cp.isFloat); + Assertions.assertFalse(cp.isDouble); //Model: final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "integer"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertTrue(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); + Assertions.assertEquals(cm.dataType, "integer"); + Assertions.assertEquals(cm.name, "someModel"); + Assertions.assertFalse(cm.isString); + Assertions.assertTrue(cm.isInteger); + Assertions.assertFalse(cm.isLong); + Assertions.assertFalse(cm.isNumber); + Assertions.assertTrue(cm.isNumeric); + Assertions.assertFalse(cm.isFloat); + Assertions.assertFalse(cm.isDouble); } @Test @@ -1983,27 +1985,27 @@ public class DefaultCodegenTest { //Property: final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "long"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertTrue(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); + Assertions.assertEquals(cp.baseType, "long"); + Assertions.assertEquals(cp.baseName, "someProperty"); + Assertions.assertFalse(cp.isString); + Assertions.assertFalse(cp.isInteger); + Assertions.assertTrue(cp.isLong); + Assertions.assertFalse(cp.isNumber); + Assertions.assertTrue(cp.isNumeric); + Assertions.assertFalse(cp.isFloat); + Assertions.assertFalse(cp.isDouble); //Model: final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "long"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertTrue(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); + Assertions.assertEquals(cm.dataType, "long"); + Assertions.assertEquals(cm.name, "someModel"); + Assertions.assertFalse(cm.isString); + Assertions.assertFalse(cm.isInteger); + Assertions.assertTrue(cm.isLong); + Assertions.assertFalse(cm.isNumber); + Assertions.assertTrue(cm.isNumeric); + Assertions.assertFalse(cm.isFloat); + Assertions.assertFalse(cm.isDouble); } @Test @@ -2015,27 +2017,27 @@ public class DefaultCodegenTest { //Property: final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "number"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertTrue(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertFalse(cp.isDouble); + Assertions.assertEquals(cp.baseType, "number"); + Assertions.assertEquals(cp.baseName, "someProperty"); + Assertions.assertFalse(cp.isString); + Assertions.assertFalse(cp.isInteger); + Assertions.assertFalse(cp.isLong); + Assertions.assertTrue(cp.isNumber); + Assertions.assertTrue(cp.isNumeric); + Assertions.assertFalse(cp.isFloat); + Assertions.assertFalse(cp.isDouble); //Model: final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "number"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertTrue(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertFalse(cm.isDouble); + Assertions.assertEquals(cm.dataType, "number"); + Assertions.assertEquals(cm.name, "someModel"); + Assertions.assertFalse(cm.isString); + Assertions.assertFalse(cm.isInteger); + Assertions.assertFalse(cm.isLong); + Assertions.assertTrue(cm.isNumber); + Assertions.assertTrue(cm.isNumeric); + Assertions.assertFalse(cm.isFloat); + Assertions.assertFalse(cm.isDouble); } @Test @@ -2047,27 +2049,27 @@ public class DefaultCodegenTest { //Property: final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "float"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertTrue(cp.isFloat); - Assert.assertFalse(cp.isDouble); + Assertions.assertEquals(cp.baseType, "float"); + Assertions.assertEquals(cp.baseName, "someProperty"); + Assertions.assertFalse(cp.isString); + Assertions.assertFalse(cp.isInteger); + Assertions.assertFalse(cp.isLong); + Assertions.assertFalse(cp.isNumber); + Assertions.assertTrue(cp.isNumeric); + Assertions.assertTrue(cp.isFloat); + Assertions.assertFalse(cp.isDouble); //Model: final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "float"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertTrue(cm.isFloat); - Assert.assertFalse(cm.isDouble); + Assertions.assertEquals(cm.dataType, "float"); + Assertions.assertEquals(cm.name, "someModel"); + Assertions.assertFalse(cm.isString); + Assertions.assertFalse(cm.isInteger); + Assertions.assertFalse(cm.isLong); + Assertions.assertFalse(cm.isNumber); + Assertions.assertTrue(cm.isNumeric); + Assertions.assertTrue(cm.isFloat); + Assertions.assertFalse(cm.isDouble); } @Test @@ -2079,27 +2081,27 @@ public class DefaultCodegenTest { //Property: final CodegenProperty cp = codegen.fromProperty("someProperty", schema); - Assert.assertEquals(cp.baseType, "double"); - Assert.assertEquals(cp.baseName, "someProperty"); - Assert.assertFalse(cp.isString); - Assert.assertFalse(cp.isInteger); - Assert.assertFalse(cp.isLong); - Assert.assertFalse(cp.isNumber); - Assert.assertTrue(cp.isNumeric); - Assert.assertFalse(cp.isFloat); - Assert.assertTrue(cp.isDouble); + Assertions.assertEquals(cp.baseType, "double"); + Assertions.assertEquals(cp.baseName, "someProperty"); + Assertions.assertFalse(cp.isString); + Assertions.assertFalse(cp.isInteger); + Assertions.assertFalse(cp.isLong); + Assertions.assertFalse(cp.isNumber); + Assertions.assertTrue(cp.isNumeric); + Assertions.assertFalse(cp.isFloat); + Assertions.assertTrue(cp.isDouble); //Model: final CodegenModel cm = codegen.fromModel("someModel", schema); - Assert.assertEquals(cm.dataType, "double"); - Assert.assertEquals(cm.name, "someModel"); - Assert.assertFalse(cm.isString); - Assert.assertFalse(cm.isInteger); - Assert.assertFalse(cm.isLong); - Assert.assertFalse(cm.isNumber); - Assert.assertTrue(cm.isNumeric); - Assert.assertFalse(cm.isFloat); - Assert.assertTrue(cm.isDouble); + Assertions.assertEquals(cm.dataType, "double"); + Assertions.assertEquals(cm.name, "someModel"); + Assertions.assertFalse(cm.isString); + Assertions.assertFalse(cm.isInteger); + Assertions.assertFalse(cm.isLong); + Assertions.assertFalse(cm.isNumber); + Assertions.assertTrue(cm.isNumeric); + Assertions.assertFalse(cm.isFloat); + Assertions.assertTrue(cm.isDouble); } @Test @@ -2114,14 +2116,14 @@ public class DefaultCodegenTest { "MyParameterTextField", openAPI.getComponents().getSchemas().get("MyParameterTextField") ); - Assert.assertTrue(typeAliasModel.isAlias); - Assert.assertEquals(typeAliasModel.dataType, "string"); + Assertions.assertTrue(typeAliasModel.isAlias); + Assertions.assertEquals(typeAliasModel.dataType, "string"); CodegenModel composedModel = codegen.fromModel( "ComposedModel", openAPI.getComponents().getSchemas().get("ComposedModel") ); - Assert.assertFalse(composedModel.isAlias); + Assertions.assertFalse(composedModel.isAlias); } private void verifyPersonDiscriminator(CodegenDiscriminator discriminator) { @@ -2133,7 +2135,7 @@ public class DefaultCodegenTest { test.getMapping().put("c", "Child"); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("a", "Adult", true)); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("c", "Child", true)); - Assert.assertEquals(discriminator, test); + Assertions.assertEquals(discriminator, test); } private CodegenProperty codegenPropertyWithArrayOfIntegerValues() { @@ -2211,13 +2213,13 @@ public class DefaultCodegenTest { CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/pony").getGet().getParameters().get(0), imports); // TODO: This must be updated to work with flattened inline models - Assert.assertEquals(parameter.dataType, "ListPageQueryParameter"); - Assert.assertEquals(imports.size(), 1); - Assert.assertEquals(imports.iterator().next(), "ListPageQueryParameter"); + Assertions.assertEquals(parameter.dataType, "ListPageQueryParameter"); + Assertions.assertEquals(imports.size(), 1); + Assertions.assertEquals(imports.iterator().next(), "ListPageQueryParameter"); - Assert.assertNotNull(parameter.getSchema()); - Assert.assertEquals(parameter.getSchema().dataType, "Object"); - Assert.assertEquals(parameter.getSchema().baseType, "object"); + Assertions.assertNotNull(parameter.getSchema()); + Assertions.assertEquals(parameter.getSchema().dataType, "Object"); + Assertions.assertEquals(parameter.getSchema().baseType, "object"); } @Test @@ -2233,7 +2235,7 @@ public class DefaultCodegenTest { HashSet expected = Sets.newHashSet("InstrumentDefinition", "map"); - Assert.assertEquals(imports, expected); + Assertions.assertEquals(imports, expected); } @Test @@ -2246,7 +2248,7 @@ public class DefaultCodegenTest { CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - Assert.assertEquals(codegenModel.vars.size(), 1); + Assertions.assertEquals(codegenModel.vars.size(), 1); } @Test @@ -2260,8 +2262,8 @@ public class DefaultCodegenTest { CodegenModel codegenModel = codegen.fromModel("ParentType", openAPI.getComponents().getSchemas().get("ParentType")); - Assert.assertEquals(codegenModel.vars.size(), 1); - Assert.assertEquals(codegenModel.vars.get(0).getBaseType(), "string"); + Assertions.assertEquals(codegenModel.vars.size(), 1); + Assertions.assertEquals(codegenModel.vars.get(0).getBaseType(), "string"); } @Test @@ -2275,8 +2277,8 @@ public class DefaultCodegenTest { CodegenModel codegenModel = codegen.fromModel("ParentType", openAPI.getComponents().getSchemas().get("ParentType")); - Assert.assertEquals(codegenModel.vars.size(), 1); - Assert.assertEquals(codegenModel.vars.get(0).getBaseType(), "TypeAlias"); + Assertions.assertEquals(codegenModel.vars.size(), 1); + Assertions.assertEquals(codegenModel.vars.get(0).getBaseType(), "TypeAlias"); } @Test @@ -2290,7 +2292,7 @@ public class DefaultCodegenTest { CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - Assert.assertEquals(codegenModel.vars.size(), 1); + Assertions.assertEquals(codegenModel.vars.size(), 1); } @Test @@ -2304,7 +2306,7 @@ public class DefaultCodegenTest { CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); - Assert.assertEquals(codegenModel.vars.size(), 1); + Assertions.assertEquals(codegenModel.vars.size(), 1); } @Test @@ -2319,9 +2321,9 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); - Assert.assertTrue(codegenParameter.isContainer); - Assert.assertTrue(codegenParameter.items.isModel); - Assert.assertFalse(codegenParameter.items.isContainer); + Assertions.assertTrue(codegenParameter.isContainer); + Assertions.assertTrue(codegenParameter.items.isModel); + Assertions.assertFalse(codegenParameter.items.isContainer); } @Test @@ -2337,9 +2339,9 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter = codegen.fromRequestBody(body, imports, ""); - Assert.assertTrue(codegenParameter.isContainer); - Assert.assertTrue(codegenParameter.items.isModel); - Assert.assertFalse(codegenParameter.items.isContainer); + Assertions.assertTrue(codegenParameter.isContainer); + Assertions.assertTrue(codegenParameter.items.isModel); + Assertions.assertFalse(codegenParameter.items.isContainer); } @Test @@ -2422,11 +2424,11 @@ public class DefaultCodegenTest { codegen.setCircularReferences(models); // then - Assert.assertFalse(inboundOut.isCircularReference); - Assert.assertTrue(roundANext.isCircularReference); - Assert.assertTrue(roundBNext.isCircularReference); - Assert.assertTrue(roundCNext.isCircularReference); - Assert.assertFalse(roundCOut.isCircularReference); + Assertions.assertFalse(inboundOut.isCircularReference); + Assertions.assertTrue(roundANext.isCircularReference); + Assertions.assertTrue(roundBNext.isCircularReference); + Assertions.assertTrue(roundCNext.isCircularReference); + Assertions.assertFalse(roundCOut.isCircularReference); } @Test @@ -2444,9 +2446,9 @@ public class DefaultCodegenTest { .getContent() .get("application/json") .getSchema()); - Assert.assertEquals(s.getExtensions().get("x-one-of-name"), "CreateStateRequest"); + Assertions.assertEquals(s.getExtensions().get("x-one-of-name"), "CreateStateRequest"); - Assert.assertEquals( + Assertions.assertEquals( openAPI.getPaths() .get("/state") .getGet() @@ -2458,15 +2460,15 @@ public class DefaultCodegenTest { "#/components/schemas/getState_200_response" ); Schema getState200 = openAPI.getComponents().getSchemas().get("getState_200_response"); - //Assert.assertEquals(getState200, ""); - Assert.assertEquals(getState200.getExtensions().get("x-one-of-name"), "GetState200Response"); + //Assertions.assertEquals(getState200, ""); + Assertions.assertEquals(getState200.getExtensions().get("x-one-of-name"), "GetState200Response"); // for the array schema, assert that a oneOf interface was added to schema map Schema items = ((ArraySchema) openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema")).getItems(); - Assert.assertEquals(items.get$ref(), "#/components/schemas/CustomOneOfArraySchema_inner"); - //Assert.assertEquals(items.get$ref(), "#/components/schemas/createState_request"); + Assertions.assertEquals(items.get$ref(), "#/components/schemas/CustomOneOfArraySchema_inner"); + //Assertions.assertEquals(items.get$ref(), "#/components/schemas/createState_request"); Schema innerItem = ModelUtils.getReferencedSchema(openAPI, openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema_inner")); - Assert.assertEquals(innerItem.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaInner"); + Assertions.assertEquals(innerItem.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaInner"); } @Test @@ -2527,7 +2529,7 @@ public class DefaultCodegenTest { "post", path.getPost(), path.getServers()); - Assert.assertEquals(operation.formParams.size(), 3, + Assertions.assertEquals(operation.formParams.size(), 3, "The list of parameters should include inherited type"); final List names = operation.formParams.stream() @@ -4324,21 +4326,21 @@ public class DefaultCodegenTest { Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody( openAPI.getPaths().get("/thingy/{date}").getPost().getRequestBody()); - Assert.assertEquals(requestBodySchema.get$ref(), "#/components/schemas/updatePetWithForm_request"); - Assert.assertEquals(ModelUtils.getSimpleRef(requestBodySchema.get$ref()), "updatePetWithForm_request"); - Assert.assertNotNull(openAPI.getComponents().getSchemas().get(ModelUtils.getSimpleRef(requestBodySchema.get$ref()))); + Assertions.assertEquals(requestBodySchema.get$ref(), "#/components/schemas/updatePetWithForm_request"); + Assertions.assertEquals(ModelUtils.getSimpleRef(requestBodySchema.get$ref()), "updatePetWithForm_request"); + Assertions.assertNotNull(openAPI.getComponents().getSchemas().get(ModelUtils.getSimpleRef(requestBodySchema.get$ref()))); Schema requestBodySchema2 = ModelUtils.unaliasSchema(openAPI, requestBodySchema); // get$ref is not null as unaliasSchema returns the schema with the last $ref to the actual schema - Assert.assertNotNull(requestBodySchema2.get$ref()); - Assert.assertEquals(requestBodySchema2.get$ref(), "#/components/schemas/updatePetWithForm_request"); + Assertions.assertNotNull(requestBodySchema2.get$ref()); + Assertions.assertEquals(requestBodySchema2.get$ref(), "#/components/schemas/updatePetWithForm_request"); Schema requestBodySchema3 = ModelUtils.getReferencedSchema(openAPI, requestBodySchema); CodegenParameter codegenParameter = codegen.fromFormProperty("visitDate", (Schema) requestBodySchema3.getProperties().get("visitDate"), new HashSet<>()); - Assert.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); - Assert.assertEquals(codegenParameter.getSchema(), null); + Assertions.assertEquals(codegenParameter.defaultValue, "1971-12-19T03:39:57-08:00"); + Assertions.assertEquals(codegenParameter.getSchema(), null); } @Test @@ -4414,7 +4416,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 9, logsList.size()); + assertEquals(9, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); assertEquals("Validation 'minItems' has no effect on schema 'object'. Ignoring!", logsList.get(0) .getMessage()); assertEquals("Validation 'maxItems' has no effect on schema 'object'. Ignoring!", logsList.get(1) @@ -4463,7 +4465,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 8, logsList.size()); + assertEquals(8, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); assertEquals("Validation 'minItems' has no effect on schema 'string'. Ignoring!", logsList.get(0) .getMessage()); assertEquals("Validation 'maxItems' has no effect on schema 'string'. Ignoring!", logsList.get(1) @@ -4510,7 +4512,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 8, logsList.size()); + assertEquals(8, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); assertEquals("Validation 'minItems' has no effect on schema 'integer'. Ignoring!", logsList.get(0) .getMessage()); assertEquals("Validation 'maxItems' has no effect on schema 'integer'. Ignoring!", logsList.get(1) @@ -4557,7 +4559,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 0, logsList.size()); + assertEquals(0, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); } @Test @@ -4585,7 +4587,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 11, logsList.size()); + assertEquals(11, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); assertEquals("Validation 'minItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(0) .getMessage()); assertEquals("Validation 'maxItems' has no effect on schema 'boolean'. Ignoring!", logsList.get(1) @@ -4638,7 +4640,7 @@ public class DefaultCodegenTest { .collect(Collectors.toList()); // JUnit assertions - assertEquals("Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList()), 0, logsList.size()); + assertEquals(0, logsList.size(), "Messages: " + logsList.stream().map(ILoggingEvent::getMessage).collect(Collectors.toList())); } public static class FromParameter { @@ -4678,7 +4680,7 @@ public class DefaultCodegenTest { Map additionalProperties = codegen.additionalProperties(); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, true); boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); + Assertions.assertTrue(result); } @Test @@ -4687,7 +4689,7 @@ public class DefaultCodegenTest { Map additionalProperties = codegen.additionalProperties(); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, false); boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); + Assertions.assertFalse(result); } @Test @@ -4696,7 +4698,7 @@ public class DefaultCodegenTest { Map additionalProperties = codegen.additionalProperties(); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "true"); boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertTrue(result); + Assertions.assertTrue(result); } @Test @@ -4705,7 +4707,7 @@ public class DefaultCodegenTest { Map additionalProperties = codegen.additionalProperties(); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "false"); boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); + Assertions.assertFalse(result); } @Test @@ -4714,7 +4716,7 @@ public class DefaultCodegenTest { Map additionalProperties = codegen.additionalProperties(); additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, "blibb"); boolean result = codegen.convertPropertyToBooleanAndWriteBack(CodegenConstants.SERIALIZABLE_MODEL); - Assert.assertFalse(result); + Assertions.assertFalse(result); } } @@ -4739,16 +4741,16 @@ public class DefaultCodegenTest { modelName = "FooOptional"; sc = openAPI.getComponents().getSchemas().get(modelName); CodegenModel fooOptional = codegen.fromModel(modelName, sc); - Assert.assertTrue(fooRequired.vars.get(0).required); - Assert.assertEquals(fooRequired.vars.get(0).name, "foo"); + Assertions.assertTrue(fooRequired.vars.get(0).required); + Assertions.assertEquals(fooRequired.vars.get(0).name, "foo"); - Assert.assertEquals(fooRequired.requiredVars.size(), 1); - Assert.assertEquals(fooRequired.requiredVars.get(0).name, "foo"); - Assert.assertTrue(fooRequired.requiredVars.get(0).required); + Assertions.assertEquals(fooRequired.requiredVars.size(), 1); + Assertions.assertEquals(fooRequired.requiredVars.get(0).name, "foo"); + Assertions.assertTrue(fooRequired.requiredVars.get(0).required); - Assert.assertFalse(fooOptional.vars.get(0).required); - Assert.assertEquals(fooOptional.vars.get(0).name, "foo"); - Assert.assertEquals(fooOptional.requiredVars.size(), 0); + Assertions.assertFalse(fooOptional.vars.get(0).required); + Assertions.assertEquals(fooOptional.vars.get(0).name, "foo"); + Assertions.assertEquals(fooOptional.requiredVars.size(), 0); } @Test @@ -4770,16 +4772,16 @@ public class DefaultCodegenTest { CodegenModel modelWithReferencedSchema = codegen.fromModel(modelName, schemaWithReferencedEnum); CodegenProperty referencedEnumSchemaProperty = modelWithReferencedSchema.vars.get(1); - Assert.assertNotNull(schemaWithReferencedEnum); - Assert.assertTrue(modelWithReferencedSchema.hasEnums); - Assert.assertEquals(referencedEnumSchemaProperty.getName(), "enumType"); - Assert.assertFalse(referencedEnumSchemaProperty.isEnum); - Assert.assertTrue(referencedEnumSchemaProperty.getIsEnumOrRef()); - Assert.assertTrue(referencedEnumSchemaProperty.isEnumRef); - Assert.assertFalse(referencedEnumSchemaProperty.isInnerEnum); - Assert.assertFalse(referencedEnumSchemaProperty.isString); - Assert.assertFalse(referencedEnumSchemaProperty.isContainer); - Assert.assertFalse(referencedEnumSchemaProperty.isPrimitiveType); + Assertions.assertNotNull(schemaWithReferencedEnum); + Assertions.assertTrue(modelWithReferencedSchema.hasEnums); + Assertions.assertEquals(referencedEnumSchemaProperty.getName(), "enumType"); + Assertions.assertFalse(referencedEnumSchemaProperty.isEnum); + Assertions.assertTrue(referencedEnumSchemaProperty.getIsEnumOrRef()); + Assertions.assertTrue(referencedEnumSchemaProperty.isEnumRef); + Assertions.assertFalse(referencedEnumSchemaProperty.isInnerEnum); + Assertions.assertFalse(referencedEnumSchemaProperty.isString); + Assertions.assertFalse(referencedEnumSchemaProperty.isContainer); + Assertions.assertFalse(referencedEnumSchemaProperty.isPrimitiveType); } @Test @@ -4794,30 +4796,30 @@ public class DefaultCodegenTest { CodegenModel modelWithReferencedSchema = codegen.fromModel(modelName, schemaWithReferencedEnum); CodegenProperty defaultEnumSchemaProperty = modelWithReferencedSchema.vars.get(4); - Assert.assertNotNull(schemaWithReferencedEnum); - Assert.assertTrue(modelWithReferencedSchema.hasEnums); - Assert.assertEquals(defaultEnumSchemaProperty.getName(), "defaultMinusnumberMinusenum"); - Assert.assertFalse(defaultEnumSchemaProperty.isEnum); - Assert.assertTrue(defaultEnumSchemaProperty.getIsEnumOrRef()); - Assert.assertTrue(defaultEnumSchemaProperty.isEnumRef); - Assert.assertFalse(defaultEnumSchemaProperty.isInnerEnum); - Assert.assertFalse(defaultEnumSchemaProperty.isString); - Assert.assertFalse(defaultEnumSchemaProperty.isContainer); - Assert.assertFalse(defaultEnumSchemaProperty.isPrimitiveType); - Assert.assertEquals(defaultEnumSchemaProperty.defaultValue, "2"); + Assertions.assertNotNull(schemaWithReferencedEnum); + Assertions.assertTrue(modelWithReferencedSchema.hasEnums); + Assertions.assertEquals(defaultEnumSchemaProperty.getName(), "defaultMinusnumberMinusenum"); + Assertions.assertFalse(defaultEnumSchemaProperty.isEnum); + Assertions.assertTrue(defaultEnumSchemaProperty.getIsEnumOrRef()); + Assertions.assertTrue(defaultEnumSchemaProperty.isEnumRef); + Assertions.assertFalse(defaultEnumSchemaProperty.isInnerEnum); + Assertions.assertFalse(defaultEnumSchemaProperty.isString); + Assertions.assertFalse(defaultEnumSchemaProperty.isContainer); + Assertions.assertFalse(defaultEnumSchemaProperty.isPrimitiveType); + Assertions.assertEquals(defaultEnumSchemaProperty.defaultValue, "2"); // test allOf with a single sub-schema and no default value set in the top level CodegenProperty allOfEnumSchemaProperty = modelWithReferencedSchema.vars.get(5); - Assert.assertEquals(allOfEnumSchemaProperty.getName(), "allofMinusnumberMinusenum"); - Assert.assertFalse(allOfEnumSchemaProperty.isEnum); - Assert.assertTrue(allOfEnumSchemaProperty.getIsEnumOrRef()); - Assert.assertTrue(allOfEnumSchemaProperty.isEnumRef); - Assert.assertFalse(allOfEnumSchemaProperty.isInnerEnum); - Assert.assertFalse(allOfEnumSchemaProperty.isString); - Assert.assertFalse(allOfEnumSchemaProperty.isContainer); - Assert.assertFalse(allOfEnumSchemaProperty.isPrimitiveType); - Assert.assertTrue(allOfEnumSchemaProperty.deprecated); - Assert.assertEquals(allOfEnumSchemaProperty.defaultValue, "null"); + Assertions.assertEquals(allOfEnumSchemaProperty.getName(), "allofMinusnumberMinusenum"); + Assertions.assertFalse(allOfEnumSchemaProperty.isEnum); + Assertions.assertTrue(allOfEnumSchemaProperty.getIsEnumOrRef()); + Assertions.assertTrue(allOfEnumSchemaProperty.isEnumRef); + Assertions.assertFalse(allOfEnumSchemaProperty.isInnerEnum); + Assertions.assertFalse(allOfEnumSchemaProperty.isString); + Assertions.assertFalse(allOfEnumSchemaProperty.isContainer); + Assertions.assertFalse(allOfEnumSchemaProperty.isPrimitiveType); + Assertions.assertTrue(allOfEnumSchemaProperty.deprecated); + Assertions.assertEquals(allOfEnumSchemaProperty.defaultValue, "null"); } @Test @@ -4831,16 +4833,16 @@ public class DefaultCodegenTest { CodegenModel modelWithReferencedSchema = codegen.fromModel(modelName, schemaWithReferencedEnum); CodegenProperty inlineEnumSchemaProperty = modelWithReferencedSchema.vars.get(1); - Assert.assertNotNull(schemaWithReferencedEnum); - Assert.assertTrue(modelWithReferencedSchema.hasEnums); - Assert.assertEquals(inlineEnumSchemaProperty.getName(), "enumType"); - Assert.assertTrue(inlineEnumSchemaProperty.isEnum); - Assert.assertTrue(inlineEnumSchemaProperty.isInnerEnum); - Assert.assertFalse(inlineEnumSchemaProperty.isEnumRef); - Assert.assertTrue(inlineEnumSchemaProperty.getIsEnumOrRef()); - Assert.assertTrue(inlineEnumSchemaProperty.isString); - Assert.assertFalse(inlineEnumSchemaProperty.isContainer); - Assert.assertFalse(inlineEnumSchemaProperty.isPrimitiveType); + Assertions.assertNotNull(schemaWithReferencedEnum); + Assertions.assertTrue(modelWithReferencedSchema.hasEnums); + Assertions.assertEquals(inlineEnumSchemaProperty.getName(), "enumType"); + Assertions.assertTrue(inlineEnumSchemaProperty.isEnum); + Assertions.assertTrue(inlineEnumSchemaProperty.isInnerEnum); + Assertions.assertFalse(inlineEnumSchemaProperty.isEnumRef); + Assertions.assertTrue(inlineEnumSchemaProperty.getIsEnumOrRef()); + Assertions.assertTrue(inlineEnumSchemaProperty.isString); + Assertions.assertFalse(inlineEnumSchemaProperty.isContainer); + Assertions.assertFalse(inlineEnumSchemaProperty.isPrimitiveType); } @Test @@ -4852,7 +4854,7 @@ public class DefaultCodegenTest { expected.setDefault("defaultValue"); expected.setEnum(Map.of("defaultValue", "defaultDesc")); - Assert.assertTrue(codegen.cliOptions.contains(expected)); + Assertions.assertTrue(codegen.cliOptions.contains(expected)); } @Test @@ -4862,7 +4864,7 @@ public class DefaultCodegenTest { CliOption expected = new CliOption("optionKey", "optionDesc"); - Assert.assertTrue(codegen.cliOptions.contains(expected)); + Assertions.assertTrue(codegen.cliOptions.contains(expected)); } @Test @@ -4873,7 +4875,7 @@ public class DefaultCodegenTest { CliOption expected = new CliOption("optionKey", "optionDesc"); expected.setDefault("defaultValue"); - Assert.assertTrue(codegen.cliOptions.contains(expected)); + Assertions.assertTrue(codegen.cliOptions.contains(expected)); } @Test @@ -4896,8 +4898,8 @@ public class DefaultCodegenTest { @Test void testIsXML() { final DefaultCodegen codegen = new DefaultCodegen(); - Assert.assertTrue(codegen.isXmlMimeType("application/xml")); - Assert.assertTrue(codegen.isXmlMimeType("application/rss+xml")); + Assertions.assertTrue(codegen.isXmlMimeType("application/xml")); + Assertions.assertTrue(codegen.isXmlMimeType("application/rss+xml")); } @Test @@ -4909,8 +4911,28 @@ public class DefaultCodegenTest { Operation operation = openAPI.getWebhooks().get("newPet").getPost(); CodegenOperation co = codegen.fromOperation("newPet", "get", operation, null); - Assert.assertEquals(co.path, "/newPet"); - Assert.assertEquals(co.operationId, "newPetGet"); + Assertions.assertEquals(co.path, "/newPet"); + Assertions.assertEquals(co.operationId, "newPetGet"); } + @Test + public void testAllVars_issue_18340() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_18340.yaml"); + new OpenAPINormalizer(openAPI, Map.of("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true")) + .normalize(); + Schema catModel = ModelUtils.getSchema(openAPI, "Cat"); + Schema cat2Model = ModelUtils.getSchema(openAPI, "Cat2"); + DefaultCodegen defaultCodegen = new DefaultCodegen(); + defaultCodegen.setOpenAPI(openAPI); + CodegenModel defaultCat = defaultCodegen.fromModel("Cat", catModel); + assertThat(getNames(defaultCat.allVars)).isEqualTo(List.of("petType", "name")); + + // the normalizer makes it work even for generators supporting inheritance + SpringCodegen springCodegen = new SpringCodegen(); + springCodegen.setOpenAPI(openAPI); + CodegenModel springCat = springCodegen.fromModel("Cat", catModel); + assertThat(getNames(springCat.allVars)).isEqualTo(List.of("petType", "name")); + CodegenModel springCat2 = springCodegen.fromModel("Cat2", cat2Model); + assertThat(getNames(springCat2.allVars)).isEqualTo(List.of("petType", "name")); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index d3082a891f0..33cee613021 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -660,11 +660,12 @@ public class DefaultGeneratorTest { List files = new ArrayList<>(); List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); + List aliasModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas, aliasModels); List allOperations = new ArrayList<>(); generator.generateApis(files, allOperations, allModels); - Map bundle = generator.buildSupportFileBundle(allOperations, allModels); + Map bundle = generator.buildSupportFileBundle(allOperations, allModels, aliasModels); LinkedList servers = (LinkedList) bundle.get("servers"); Assert.assertEquals(servers.get(0).url, ""); Assert.assertEquals(servers.get(1).url, "http://trailingshlash.io:80/v1"); @@ -686,11 +687,12 @@ public class DefaultGeneratorTest { List files = new ArrayList<>(); List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); List allModels = new ArrayList<>(); - generator.generateModels(files, allModels, filteredSchemas); + List aliasModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas, aliasModels); List allOperations = new ArrayList<>(); generator.generateApis(files, allOperations, allModels); - Map bundle = generator.buildSupportFileBundle(allOperations, allModels); + Map bundle = generator.buildSupportFileBundle(allOperations, allModels, aliasModels); LinkedList servers = (LinkedList) bundle.get("servers"); Assert.assertEquals(servers.get(0).url, "/relative/url"); } @@ -768,8 +770,142 @@ public class DefaultGeneratorTest { List files = new ArrayList<>(); List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); List allModels = new ArrayList<>(); + List aliasModels = new ArrayList<>(); // The bug causes a StackOverflowError when calling generateModels - generator.generateModels(files, allModels, filteredSchemas); + generator.generateModels(files, allModels, filteredSchemas, aliasModels); // all fine, we have passed } + + + private DefaultGenerator generatorGenerateRecursiveDependentModelsBackwardCompatibility(String recursively) throws IOException { + DefaultGenerator generator = new DefaultGenerator(false); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.GENERATE_RECURSIVE_DEPENDENT_MODELS, recursively); + return generator; + } + + private ClientOptInput createOptInputIssue18444(Path target) { + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("spring") + .setInputSpec("src/test/resources/bugs/issue_18444.json") + .setOutputDir(target.toAbsolutePath().toString()); + return configurator.toClientOptInput(); + } + + @Test + public void testGenerateRecursiveDependentModelsBackwardCompatibilityIssue18444() throws IOException { + Path target = Files.createTempDirectory("test"); + File output = target.toFile(); + String oldModelsProp = GlobalSettings.getProperty("models"); + + try { + DefaultGenerator generator = generatorGenerateRecursiveDependentModelsBackwardCompatibility("false"); + GlobalSettings.setProperty("models", "RQ1,RS1"); + ClientOptInput clientOptInput = createOptInputIssue18444(target); + List files = generator.opts(clientOptInput ).generate(); + Assert.assertEquals(files.size(), 17); + + // Check expected generated files + // api sanity check + String apiJavaFileName = "src/main/java/org/openapitools/api/ApiApi.java"; + TestUtils.ensureContainsFile(files, output, apiJavaFileName); + Assert.assertTrue(new File(output, apiJavaFileName).exists()); + + // model sanity check + String rq1FileName = "src/main/java/org/openapitools/model/RQ1.java"; + TestUtils.ensureContainsFile(files, output, rq1FileName); + Assert.assertTrue(new File(output, rq1FileName).exists()); + + String rs1FileName = "src/main/java/org/openapitools/model/RS1.java"; + TestUtils.ensureContainsFile(files, output, rs1FileName ); + Assert.assertTrue(new File(output, rs1FileName).exists()); + + // Check not generated cause backwards compatibility files + String ft1FileName = "src/main/java/org/openapitools/model/FT1.java"; + TestUtils.ensureDoesNotContainsFile(files, output, ft1FileName); + Assert.assertFalse(new File(output, ft1FileName).exists()); + + String ft2FileName = "src/main/java/org/openapitools/model/FT2.java"; + TestUtils.ensureDoesNotContainsFile(files, output, ft2FileName); + Assert.assertFalse(new File(output, ft2FileName).exists()); + + String ft3FileName = "src/main/java/org/openapitools/model/FT3.java"; + TestUtils.ensureDoesNotContainsFile(files, output, ft3FileName); + Assert.assertFalse(new File(output, ft3FileName).exists()); + + String bttFileName = "src/main/java/org/openapitools/model/BTT.java"; + TestUtils.ensureDoesNotContainsFile(files, output, bttFileName); + Assert.assertFalse(new File(output, bttFileName).exists()); + + } finally { + output.deleteOnExit(); + if (oldModelsProp != null) { + GlobalSettings.setProperty("models", oldModelsProp); + } else { + GlobalSettings.clearProperty("models"); + } + } + } + + @Test + public void testGenerateRecursiveDependentModelsIssue18444() throws IOException { + Path target = Files.createTempDirectory("test"); + File output = target.toFile(); + String oldModelsProp = GlobalSettings.getProperty("models"); + + try { + DefaultGenerator generator = generatorGenerateRecursiveDependentModelsBackwardCompatibility("true"); + GlobalSettings.setProperty("models", "RQ1,RS1"); + ClientOptInput clientOptInput = createOptInputIssue18444(target); + List files = generator.opts(clientOptInput ).generate(); + Assert.assertEquals(files.size(), 21); + + // Check expected generated files + // api sanity check + String apiJavaFileName = "src/main/java/org/openapitools/api/ApiApi.java"; + TestUtils.ensureContainsFile(files, output, apiJavaFileName); + Assert.assertTrue(new File(output, apiJavaFileName).exists()); + + // model sanity check + String rq1FileName = "src/main/java/org/openapitools/model/RQ1.java"; + TestUtils.ensureContainsFile(files, output, rq1FileName); + Assert.assertTrue(new File(output, rq1FileName).exists()); + + String rs1FileName = "src/main/java/org/openapitools/model/RS1.java"; + TestUtils.ensureContainsFile(files, output, rs1FileName ); + Assert.assertTrue(new File(output, rs1FileName).exists()); + + // Check generated cause RQ1 and RS1 dependents of FT1,FT2,FT3 files + String ft1FileName = "src/main/java/org/openapitools/model/FT1.java"; + TestUtils.ensureContainsFile(files, output, ft1FileName); + Assert.assertTrue(new File(output, ft1FileName).exists()); + + String ft2FileName = "src/main/java/org/openapitools/model/FT2.java"; + TestUtils.ensureContainsFile(files, output, ft2FileName); + Assert.assertTrue(new File(output, ft2FileName).exists()); + + String ft3FileName = "src/main/java/org/openapitools/model/FT3.java"; + TestUtils.ensureContainsFile(files, output, ft3FileName); + Assert.assertTrue(new File(output, ft3FileName).exists()); + + String bttFileName = "src/main/java/org/openapitools/model/BTT.java"; + TestUtils.ensureContainsFile(files, output, bttFileName); + Assert.assertTrue(new File(output, bttFileName).exists()); + + } finally { + output.deleteOnExit(); + if (oldModelsProp != null) { + GlobalSettings.setProperty("models", oldModelsProp); + } else { + GlobalSettings.clearProperty("models"); + } + } + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java index 844756e9a06..13b401ce2d4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ExampleGeneratorTest.java @@ -152,6 +152,35 @@ public class ExampleGeneratorTest { assertEquals("200", examples.get(0).get("statusCode")); } + @Test + public void generateFromResponseSchemaWithArraySchema() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); + + new InlineModelResolver().flatten(openAPI); + + ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); + Set mediaTypeKeys = new TreeSet<>(); + mediaTypeKeys.add("application/json"); + List> examples = exampleGenerator.generateFromResponseSchema( + "200", + openAPI + .getPaths() + .get("/generate_from_response_schema_array_reference") + .getGet() + .getResponses() + .get("200") + .getContent() + .get("application/json") + .getSchema(), + mediaTypeKeys + ); + + assertEquals(1, examples.size()); + assertEquals("application/json", examples.get(0).get("contentType")); + assertEquals(String.format(Locale.ROOT, "[ {%n \"example_schema_property\" : \"example schema property value\"%n}, {%n \"example_schema_property\" : \"example schema property value\"%n} ]"), examples.get(0).get("example")); + assertEquals("200", examples.get(0).get("statusCode")); + } + @Test public void generateFromResponseSchemaWithModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); @@ -210,6 +239,35 @@ public class ExampleGeneratorTest { assertEquals("200", examples.get(0).get("statusCode")); } + @Test + public void generateFromResponseSchemaWithAllOfChildComposedModel() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); + + new InlineModelResolver().flatten(openAPI); + + ExampleGenerator exampleGenerator = new ExampleGenerator(openAPI.getComponents().getSchemas(), openAPI); + Set mediaTypeKeys = new TreeSet<>(); + mediaTypeKeys.add("application/json"); + List> examples = exampleGenerator.generateFromResponseSchema( + "200", + openAPI + .getPaths() + .get("/generate_from_response_schema_with_allOf_child_composed_model") + .getGet() + .getResponses() + .get("200") + .getContent() + .get("application/json") + .getSchema(), + mediaTypeKeys + ); + + assertEquals(1, examples.size()); + assertEquals("application/json", examples.get(0).get("contentType")); + assertEquals(String.format(Locale.ROOT, "{%n \"example_schema_property_composed\" : \"example schema property value composed\",%n \"example_schema_property_composed_parent\" : \"example schema property value composed parent\",%n \"example_schema_property\" : \"example schema property value\"%n}"), examples.get(0).get("example")); + assertEquals("200", examples.get(0).get("statusCode")); + } + @Test public void generateFromResponseSchemaWithOneOfComposedModel() { OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/example_generator_test.yaml"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java index 5dc0b8f3cf5..d7b85e4be6f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/OpenAPINormalizerTest.java @@ -178,6 +178,9 @@ public class OpenAPINormalizerTest { Schema schema13 = openAPI.getComponents().getSchemas().get("OneOfAnyType"); assertEquals(schema13.getOneOf().size(), 6); + Schema schema15 = openAPI.getComponents().getSchemas().get("AnyOfAnyTypeWithRef"); + assertEquals(schema15.getAnyOf().size(), 6); + Map options = new HashMap<>(); options.put("SIMPLIFY_ONEOF_ANYOF", "true"); OpenAPINormalizer openAPINormalizer = new OpenAPINormalizer(openAPI, options); @@ -216,6 +219,9 @@ public class OpenAPINormalizerTest { assertEquals(schema14.getOneOf(), null); assertEquals(schema14.getType(), null); + Schema schema16 = openAPI.getComponents().getSchemas().get("AnyOfAnyTypeWithRef"); + assertEquals(schema16.getAnyOf(), null); + assertEquals(schema16.getType(), null); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/AbstractGeneratorsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/AbstractGeneratorsTest.java new file mode 100644 index 00000000000..d8e7da91e1b --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/AbstractGeneratorsTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.cpppistache; + +import java.io.*; +import java.nio.file.Files; +import java.util.*; + +import org.openapitools.codegen.*; +import org.openapitools.codegen.config.CodegenConfigurator; + +/** + * Abstract test class to make one or multiple generators generate files for one specific input spec + */ +public abstract class AbstractGeneratorsTest { + /** + * Test each with a given input spec + * @param inputSpec The input spec to use + * @return Map of generator and files + * @throws IOException if the test directory cannot be created + */ + protected Map> eachWith(String inputSpec) throws IOException { + Objects.requireNonNull(inputSpec, "Specify an inputspec to run that test"); + Map> generatedFilesByGenerator = new HashMap<>(); + + for (final CodegenConfig codegenConfig : CodegenConfigLoader.getAll()) { + generatedFilesByGenerator.put(codegenConfig.getName(), oneWith(codegenConfig.getName(), inputSpec)); + } + + return generatedFilesByGenerator; + } + + /** + * Test each with a given input spec + * @param generatorName the generator name to use + * @param inputSpec The input spec to use + * @return List of generated files + * @throws IOException if the test directory cannot be created + */ + protected List oneWith(String generatorName, String inputSpec) throws IOException { + Objects.requireNonNull(generatorName, "Specify a generatorName to run that test"); + Objects.requireNonNull(inputSpec, "Specify an inputspec to run that test"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName(generatorName) + .setInputSpec(inputSpec) + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + return generator.opts(clientOptInput).generate(); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/ObjectAnyTypeSetTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/ObjectAnyTypeSetTest.java new file mode 100644 index 00000000000..95b2ddddcb5 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/ObjectAnyTypeSetTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.cpppistache; + +import java.io.*; +import java.util.*; + +import org.slf4j.*; +import org.testng.annotations.Test; +import org.testng.asserts.SoftAssert; + +/** + * Generate from an input spec containing various abstract objects and sets + */ +public class ObjectAnyTypeSetTest extends AbstractGeneratorsTest { + /** Logger. */ + private static final Logger LOGGER = LoggerFactory.getLogger(ObjectAnyTypeSetTest.class); + + /** A Petstore inputspec with abstract properties added in the Pet */ + private static final String INPUT_SPEC = "src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml"; + + /** Soft assert to check all the generators before eventually failing a test */ + private final SoftAssert softAssert = new SoftAssert(); + + /** + * Test some generators with an input spec requiring generation of abstract properties + * @throws IOException if the test folder cannot be created + */ + @Test + public void testSomeWithPetstoreWithAbstract() throws IOException { +// assertGeneratedFiles("c"); +// assertGeneratedFiles("cpp-restsdk"); + generateFiles("cpp-pistache-server"); +// assertGeneratedFiles("typescript"); + this.softAssert.assertAll(); + } + + /** + * Asserts that a generator has produced some files + * @param generatorName The generator name to test + * @return List of files generated + * @throws IOException if the test folder cannot be created + */ + private List generateFiles(String generatorName) throws IOException { + Objects.requireNonNull(generatorName, "A generator name is expected for this assertion"); + return oneWith(generatorName, INPUT_SPEC); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/README.md b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/README.md new file mode 100644 index 00000000000..23af1c6b581 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/cpppistache/README.md @@ -0,0 +1,2 @@ +These test aren't useful yet +they only run the generator for a single case \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java index 9fe394f3294..8ee09093d5a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientCodegenTest.java @@ -16,9 +16,8 @@ package org.openapitools.codegen.csharpnetcore; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.openapitools.codegen.TestUtils.assertFileContains; -import static org.openapitools.codegen.TestUtils.assertFileExists; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientDeepObjectTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientDeepObjectTest.java index bfacb03a472..06ad440844f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientDeepObjectTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpClientDeepObjectTest.java @@ -32,7 +32,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.openapitools.codegen.TestUtils.assertFileContains; public class CSharpClientDeepObjectTest { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index 87dabbbfd00..90136ff895a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -20,6 +20,7 @@ package org.openapitools.codegen.dart; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.DartClientCodegen; +import org.openapitools.codegen.languages.DartDioClientCodegen; import org.openapitools.codegen.options.DartClientOptionsProvider; import static org.mockito.Mockito.mock; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index 23eee3fd2a2..cb3350d57e2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -53,6 +53,7 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientCodegen.DATE_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setEqualityCheckMethod(DartDioClientCodegen.EQUALITY_CHECK_METHOD_DEFAULT); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java index cbf73e2877b..188cba014ff 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java @@ -291,6 +291,69 @@ public class GoClientCodegenTest { "httpRes, err := apiClient.PetAPI.PetDelete(context.Background()).Execute()"); } + @Test + public void verifyApiWithAllOfMultipleRefAndDiscriminator() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("go") + .setGitUserId("OpenAPITools") + .setGitRepoId("openapi-generator") + .setInputSpec("src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output + "/model_final_item.go")); + TestUtils.assertFileContains(Paths.get(output + "/model_final_item.go"), + "BaseItem"); + } + + @Test + public void testVendorExtensionGenerateUnmarshalJson() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("go") + .setGitUserId("OpenAPITools") + .setGitRepoId("openapi-generator") + .setInputSpec("src/test/resources/3_0/go/allof_with_unmarshal_json.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output + "/model_base_item.go")); + TestUtils.assertFileContains(Paths.get(output + "/model_base_item.go"), + "func (o *BaseItem) UnmarshalJSON(data []byte) (err error) {"); + } + + @Test + public void testVendorExtensionSkipGenerateUnmarshalJson() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("go") + .setGitUserId("OpenAPITools") + .setGitRepoId("openapi-generator") + .setInputSpec("src/test/resources/3_0/go/allof_skip_unmarshal_json.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output + "/model_base_item.go")); + TestUtils.assertFileNotContains(Paths.get(output + "/model_base_item.go"), + "func (o *BaseItem) UnmarshalJSON(data []byte) (err error) {"); + } + @Test public void testAdditionalPropertiesWithGoMod() throws Exception { File output = Files.createTempDirectory("test").toFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 8a67ee0e68e..603515e7e9c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -53,5 +53,6 @@ public class GoClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setUseOneOfDiscriminatorLookup(GoClientOptionsProvider.USE_ONE_OF_DISCRIMINATOR_LOOKUP_VALUE); verify(clientCodegen).setWithGoMod(GoClientOptionsProvider.WITH_GO_MOD_VALUE); verify(clientCodegen).setGenerateMarshalJSON(GoClientOptionsProvider.GENERATE_MARSHAL_JSON_VALUE); + verify(clientCodegen).setGenerateUnmarshalJSON(GoClientOptionsProvider.GENERATE_UNMARSHAL_JSON_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java index 2cbe4c62364..599b40d0b8c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenExampleValuesTest.java @@ -17,11 +17,13 @@ package org.openapitools.codegen.java; +import org.mockito.Answers; +import org.mockito.Mockito; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Arrays; @@ -29,7 +31,17 @@ import java.util.Collections; public class AbstractJavaCodegenExampleValuesTest { - private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); + private AbstractJavaCodegen codegen; + + /** + * In TEST-NG, test class (and its fields) is only constructed once (vs. for every test in Jupiter), + * using @BeforeMethod to have a fresh codegen mock for each test + */ + @BeforeMethod void mockAbstractCodegen() { + codegen = Mockito.mock( + AbstractJavaCodegen.class, Mockito.withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } @Test void referencedEnumTakeFirstName() { @@ -37,7 +49,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); p.dataType = "WrappedEnum"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "WrappedEnum.fromValue(\"first\")"); } @@ -48,7 +60,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.isEnum = true; p.dataType = "String"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "\"first\""); } @@ -61,7 +73,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.dataType = "List"; p.items = new CodegenProperty(); - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "Arrays.asList()"); } @@ -71,7 +83,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.isDate = true; p.dataType = "LocalDate"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "LocalDate.now()"); } @@ -82,7 +94,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.dataType = "LocalDate"; p.example = "2017-03-30"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "LocalDate.parse(\"2017-03-30\")"); } @@ -92,7 +104,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.isDateTime = true; p.dataType = "OffsetDateTime"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "OffsetDateTime.now()"); } @@ -103,7 +115,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.dataType = "OffsetDateTime"; p.example = "2007-12-03T10:15:30+01:00"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "OffsetDateTime.parse(\"2007-12-03T10:15:30+01:00\")"); } @@ -113,7 +125,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.isUuid = true; p.dataType = "UUID"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "UUID.randomUUID()"); } @@ -124,46 +136,7 @@ public class AbstractJavaCodegenExampleValuesTest { p.dataType = "UUID"; p.example = "13b48713-b931-45ea-bd60-b07491245960"; - fakeJavaCodegen.setParameterExampleValue(p); + codegen.setParameterExampleValue(p); Assert.assertEquals(p.example, "UUID.fromString(\"13b48713-b931-45ea-bd60-b07491245960\")"); } - - private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { - @Override - public CodegenType getTag() { - return null; - } - - @Override - public String getName() { - return null; - } - - @Override - public String getHelp() { - return null; - } - - /** - * Gets artifact version. - * Only for testing purposes. - * - * @return version - */ - public String getArtifactVersion() { - return this.artifactVersion; - } - @Test - void customExampleForEnumValue() { - final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); - final CodegenParameter p = new CodegenParameter(); - p.allowableValues = Collections.singletonMap("values", Arrays.asList("first", "second")); - p.dataType = "WrappedEnum"; - p.example = "CustomEnumValue"; - - fakeJavaCodegen.setParameterExampleValue(p); - // Custom example value should not be modified - Assert.assertEquals(p.example, "CustomEnumValue"); - } - } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index 95a9f9f6b69..b3233495371 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -24,63 +24,93 @@ import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.parser.core.models.ParseOptions; + +import java.math.BigDecimal; import java.time.OffsetDateTime; import java.time.ZonedDateTime; import java.util.*; import java.util.stream.Collectors; + +import org.mockito.Answers; +import org.mockito.Mockito; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.io.File; import java.time.LocalDate; import java.time.ZoneId; +import static org.assertj.core.api.Assertions.assertThat; + public class AbstractJavaCodegenTest { - private final AbstractJavaCodegen fakeJavaCodegen = new P_AbstractJavaCodegen(); + static final Map FLATTENED_SPEC = Map.of( + "3_0/petstore", TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"), + "3_0/mapSchemas", TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"), + "3_0/spring/date-time-parameter-types-for-testing", TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml") + ); + + private AbstractJavaCodegen codegen; + + /** + * In TEST-NG, test class (and its fields) is only constructed once (vs. for every test in Jupiter), + * using @BeforeMethod to have a fresh codegen mock for each test + */ + @BeforeMethod void mockAbstractCodegen() { + codegen = Mockito.mock( + AbstractJavaCodegen.class, Mockito.withSettings().defaultAnswer(Answers.CALLS_REAL_METHODS).useConstructor() + ); + } @Test - public void toEnumVarNameShouldNotShortenUnderScore() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("_", "String"), "UNDERSCORE"); - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("__", "String"), "__"); - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("_,.", "String"), "__"); + public void toEnumVarNameShouldNotShortenUnderScore() { + Assert.assertEquals(codegen.toEnumVarName("_", "String"), "UNDERSCORE"); + Assert.assertEquals(codegen.toEnumVarName("__", "String"), "__"); + Assert.assertEquals(codegen.toEnumVarName("_,.", "String"), "__"); } /** * As of Java 9, '_' is a keyword, and may not be used as an identifier. */ @Test - public void toEnumVarNameShouldNotResultInSingleUnderscore() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toEnumVarName(" ", "String"), "SPACE"); - Assert.assertEquals(fakeJavaCodegen.toEnumVarName("==", "String"), "u"); + public void toEnumVarNameShouldNotResultInSingleUnderscore() { + Assert.assertEquals(codegen.toEnumVarName(" ", "String"), "SPACE"); + Assert.assertEquals(codegen.toEnumVarName("==", "String"), "u"); } @Test - public void toVarNameShouldAvoidOverloadingGetClassMethod() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toVarName("class"), "propertyClass"); - Assert.assertEquals(fakeJavaCodegen.toVarName("_class"), "propertyClass"); - Assert.assertEquals(fakeJavaCodegen.toVarName("__class"), "propertyClass"); + public void toEnumVarNameAddUnderscoresIfValueIsPascalCase() { + Assert.assertEquals(codegen.toEnumVarName("OnlyCamelCase", "String"), "ONLY_CAMEL_CASE"); + Assert.assertEquals(codegen.toEnumVarName("WithNumber1", "String"), "WITH_NUMBER1"); + Assert.assertEquals(codegen.toEnumVarName("_LeadingUnderscore", "String"), "_LEADING_UNDERSCORE"); } @Test - public void toModelNameShouldNotUseProvidedMapping() throws Exception { - fakeJavaCodegen.importMapping().put("json_myclass", "com.test.MyClass"); - Assert.assertEquals(fakeJavaCodegen.toModelName("json_myclass"), "JsonMyclass"); + public void toVarNameShouldAvoidOverloadingGetClassMethod() { + Assert.assertEquals(codegen.toVarName("class"), "propertyClass"); + Assert.assertEquals(codegen.toVarName("_class"), "propertyClass"); + Assert.assertEquals(codegen.toVarName("__class"), "propertyClass"); } @Test - public void toModelNameUsesPascalCase() throws Exception { - Assert.assertEquals(fakeJavaCodegen.toModelName("json_anotherclass"), "JsonAnotherclass"); + public void toModelNameShouldNotUseProvidedMapping() { + codegen.importMapping().put("json_myclass", "com.test.MyClass"); + Assert.assertEquals(codegen.toModelName("json_myclass"), "JsonMyclass"); } @Test - public void testPreprocessOpenApiIncludeAllMediaTypesInAcceptHeader() throws Exception { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void toModelNameUsesPascalCase() { + Assert.assertEquals(codegen.toModelName("json_anotherclass"), "JsonAnotherclass"); + } + + @Test + public void testPreprocessOpenApiIncludeAllMediaTypesInAcceptHeader() { + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/petstore"); codegen.preprocessOpenAPI(openAPI); Assert.assertEquals(codegen.getArtifactVersion(), openAPI.getInfo().getVersion()); @@ -91,10 +121,9 @@ public class AbstractJavaCodegenTest { } @Test - public void testPreprocessOpenAPINumVersion() throws Exception { + public void testPreprocessOpenAPINumVersion() { final OpenAPI openAPIOtherNumVersion = TestUtils.parseFlattenSpec("src/test/resources/2_0/duplicateOperationIds.yaml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - + codegen.preprocessOpenAPI(openAPIOtherNumVersion); Assert.assertEquals(codegen.getArtifactVersion(), openAPIOtherNumVersion.getInfo().getVersion()); @@ -102,52 +131,54 @@ public class AbstractJavaCodegenTest { @Test public void convertVarName() { - Assert.assertEquals(fakeJavaCodegen.toVarName("name"), "name"); - Assert.assertEquals(fakeJavaCodegen.toVarName("$name"), "$name"); - Assert.assertEquals(fakeJavaCodegen.toVarName("nam$$e"), "nam$$e"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user-name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user_name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("user|name"), "userName"); - Assert.assertEquals(fakeJavaCodegen.toVarName("uSername"), "uSername"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USERname"), "usERname"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USERNAME"), "USERNAME"); - Assert.assertEquals(fakeJavaCodegen.toVarName("USER123NAME"), "USER123NAME"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1"), "_1"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1a"), "_1a"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1A"), "_1A"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1AAAA"), "_1AAAA"); - Assert.assertEquals(fakeJavaCodegen.toVarName("1AAaa"), "_1aAaa"); - - AbstractJavaCodegen withCaml = new P_AbstractJavaCodegen(); - withCaml.setCamelCaseDollarSign(true); - Assert.assertEquals(withCaml.toVarName("$name"), "$Name"); - Assert.assertEquals(withCaml.toVarName("1AAaa"), "_1AAaa"); + Assert.assertEquals(codegen.toVarName("name"), "name"); + Assert.assertEquals(codegen.toVarName("$name"), "$name"); + Assert.assertEquals(codegen.toVarName("nam$$e"), "nam$$e"); + Assert.assertEquals(codegen.toVarName("user-name"), "userName"); + Assert.assertEquals(codegen.toVarName("user_name"), "userName"); + Assert.assertEquals(codegen.toVarName("user|name"), "userName"); + Assert.assertEquals(codegen.toVarName("uSername"), "uSername"); + Assert.assertEquals(codegen.toVarName("USERname"), "usERname"); + Assert.assertEquals(codegen.toVarName("USERNAME"), "USERNAME"); + Assert.assertEquals(codegen.toVarName("USER123NAME"), "USER123NAME"); + Assert.assertEquals(codegen.toVarName("1"), "_1"); + Assert.assertEquals(codegen.toVarName("1a"), "_1a"); + Assert.assertEquals(codegen.toVarName("1A"), "_1A"); + Assert.assertEquals(codegen.toVarName("1AAAA"), "_1AAAA"); + Assert.assertEquals(codegen.toVarName("1AAaa"), "_1aAaa"); } + @Test + public void convertVarNameWithCaml() { + codegen.setCamelCaseDollarSign(true); + + Assert.assertEquals(codegen.toVarName("$name"), "$Name"); + Assert.assertEquals(codegen.toVarName("1AAaa"), "_1AAaa"); + } + @Test public void convertModelName() { - Assert.assertEquals(fakeJavaCodegen.toModelName("name"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("$name"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("nam#e"), "Name"); - Assert.assertEquals(fakeJavaCodegen.toModelName("$another-fake?"), "AnotherFake"); - Assert.assertEquals(fakeJavaCodegen.toModelName("1a"), "Model1a"); - Assert.assertEquals(fakeJavaCodegen.toModelName("1A"), "Model1A"); - Assert.assertEquals(fakeJavaCodegen.toModelName("AAAb"), "AAAb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("aBB"), "ABB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("AaBBa"), "AaBBa"); - Assert.assertEquals(fakeJavaCodegen.toModelName("A_B"), "AB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("A-B"), "AB"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa_Bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa-Bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa_bb"), "AaBb"); - Assert.assertEquals(fakeJavaCodegen.toModelName("Aa-bb"), "AaBb"); + Assert.assertEquals(codegen.toModelName("name"), "Name"); + Assert.assertEquals(codegen.toModelName("$name"), "Name"); + Assert.assertEquals(codegen.toModelName("nam#e"), "Name"); + Assert.assertEquals(codegen.toModelName("$another-fake?"), "AnotherFake"); + Assert.assertEquals(codegen.toModelName("1a"), "Model1a"); + Assert.assertEquals(codegen.toModelName("1A"), "Model1A"); + Assert.assertEquals(codegen.toModelName("AAAb"), "AAAb"); + Assert.assertEquals(codegen.toModelName("aBB"), "ABB"); + Assert.assertEquals(codegen.toModelName("AaBBa"), "AaBBa"); + Assert.assertEquals(codegen.toModelName("A_B"), "AB"); + Assert.assertEquals(codegen.toModelName("A-B"), "AB"); + Assert.assertEquals(codegen.toModelName("Aa_Bb"), "AaBb"); + Assert.assertEquals(codegen.toModelName("Aa-Bb"), "AaBb"); + Assert.assertEquals(codegen.toModelName("Aa_bb"), "AaBb"); + Assert.assertEquals(codegen.toModelName("Aa-bb"), "AaBb"); } @Test public void testInitialConfigValues() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.processOpts(); codegen.preprocessOpenAPI(openAPI); @@ -168,7 +199,6 @@ public class AbstractJavaCodegenTest { public void testSettersForConfigValues() throws Exception { OpenAPI openAPI = TestUtils.createOpenAPI(); - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setHideGenerationTimestamp(true); codegen.setModelPackage("xyz.yyyyy.zzzzzzz.model"); @@ -195,18 +225,15 @@ public class AbstractJavaCodegenTest { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.model.oooooo"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.api.oooooo"); codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.invoker.oooooo"); codegen.additionalProperties().put(AbstractJavaCodegen.BOOLEAN_GETTER_PREFIX, "getBoolean"); codegen.additionalProperties().put(CodegenConstants.ARTIFACT_VERSION, "0.8.0-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.processOpts(); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); Assert.assertFalse(codegen.isHideGenerationTimestamp()); @@ -222,119 +249,62 @@ public class AbstractJavaCodegenTest { } @Test - public void testAdditionalModelTypeAnnotationsSemiColon() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void testAdditionalModelTypeAnnotationsSemiColon() { codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar"); codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); + assertThat(codegen.getAdditionalModelTypeAnnotations()) + .containsExactlyInAnyOrder("@Bar", "@Foo"); } @Test - public void testAdditionalModelTypeAnnotationsNewLineLinux() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void testAdditionalModelTypeAnnotationsNewLineLinux() { codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\n@Bar"); codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); + assertThat(codegen.getAdditionalModelTypeAnnotations()) + .containsExactlyInAnyOrder("@Bar", "@Foo"); } @Test - public void testAdditionalModelTypeAnnotationsNewLineWindows() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void testAdditionalModelTypeAnnotationsNewLineWindows() { codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo\r\n@Bar"); codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); + assertThat(codegen.getAdditionalModelTypeAnnotations()) + .containsExactlyInAnyOrder("@Bar", "@Foo"); } @Test - public void testAdditionalModelTypeAnnotationsMixed() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void testAdditionalModelTypeAnnotationsMixed() { codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, " \t @Foo;\r\n@Bar ;\n @Foobar "); codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - additionalModelTypeAnnotations.add("@Foobar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); + assertThat(codegen.getAdditionalModelTypeAnnotations()) + .containsExactlyInAnyOrder("@Bar", "@Foo", "@Foobar"); } @Test - public void testAdditionalModelTypeAnnotationsNoDuplicate() throws Exception { - OpenAPI openAPI = TestUtils.createOpenAPI(); - - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + public void testAdditionalModelTypeAnnotationsNoDuplicate() { codegen.additionalProperties().put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@Foo;@Bar;@Foo"); codegen.processOpts(); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); - final List additionalModelTypeAnnotations = new ArrayList(); - additionalModelTypeAnnotations.add("@Foo"); - additionalModelTypeAnnotations.add("@Bar"); - - final List sortedCodegenAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - final List sortedAdditionalModelTypeAnnotations = new ArrayList<>(codegen.getAdditionalModelTypeAnnotations()); - - Collections.sort(sortedCodegenAdditionalModelTypeAnnotations); - Collections.sort(sortedAdditionalModelTypeAnnotations); - Assert.assertEquals(sortedCodegenAdditionalModelTypeAnnotations, sortedAdditionalModelTypeAnnotations); + assertThat(codegen.getAdditionalModelTypeAnnotations()) + .containsExactlyInAnyOrder("@Bar", "@Foo", "@Foo"); } @Test public void toEnumValue() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); Assert.assertEquals(codegen.toEnumValue("1", "Integer"), "1"); Assert.assertEquals(codegen.toEnumValue("42", "Double"), "42"); Assert.assertEquals(codegen.toEnumValue("1337", "Long"), "1337l"); @@ -344,7 +314,6 @@ public class AbstractJavaCodegenTest { @Test public void apiFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputDir("/User/open.api.tools"); codegen.setSourceFolder("source.folder"); codegen.setApiPackage("org.openapitools.codegen.api"); @@ -353,7 +322,6 @@ public class AbstractJavaCodegenTest { @Test public void apiTestFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputDir("/User/open.api.tools"); codegen.setTestFolder("test.folder"); codegen.setApiPackage("org.openapitools.codegen.api"); @@ -362,7 +330,6 @@ public class AbstractJavaCodegenTest { @Test public void modelTestFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputDir("/User/open.api.tools"); codegen.setTestFolder("test.folder"); codegen.setModelPackage("org.openapitools.codegen.model"); @@ -371,7 +338,6 @@ public class AbstractJavaCodegenTest { @Test public void apiTestFileFolderDirect() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputTestFolder("/User/open.api.tools"); codegen.setTestFolder("test.folder"); codegen.setApiPackage("org.openapitools.codegen.api"); @@ -380,7 +346,6 @@ public class AbstractJavaCodegenTest { @Test public void modelTestFileFolderDirect() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputTestFolder("/User/open.api.tools"); codegen.setTestFolder("test.folder"); codegen.setModelPackage("org.openapitools.codegen.model"); @@ -389,7 +354,6 @@ public class AbstractJavaCodegenTest { @Test public void modelFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputDir("/User/open.api.tools"); codegen.setSourceFolder("source.folder"); codegen.setModelPackage("org.openapitools.codegen.model"); @@ -398,69 +362,57 @@ public class AbstractJavaCodegenTest { @Test public void apiDocFileFolder() { - final AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOutputDir("/User/open.api.tools"); Assert.assertEquals(codegen.apiDocFileFolder(), "/User/open.api.tools/docs/".replace('/', File.separatorChar)); } @Test(description = "tests if API version specification is used if no version is provided in additional properties") public void openApiVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - OpenAPI api = TestUtils.createOpenAPI(); codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); Assert.assertEquals(codegen.getArtifactVersion(), "1.0.7"); } @Test(description = "tests if API version specification is used if no version is provided in additional properties with snapshot version") public void openApiSnapShotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put("snapshotVersion", "true"); - OpenAPI api = TestUtils.createOpenAPI(); codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); Assert.assertEquals(codegen.getArtifactVersion(), "1.0.7-SNAPSHOT"); } @Test(description = "tests if artifactVersion additional property is used") public void additionalPropertyArtifactVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - codegen.additionalProperties().put("artifactVersion", "1.1.1"); - OpenAPI api = TestUtils.createOpenAPI(); codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); Assert.assertEquals(codegen.getArtifactVersion(), "1.1.1"); } @Test(description = "tests if artifactVersion additional property is used with snapshot parameter") public void additionalPropertyArtifactSnapShotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put("artifactVersion", "1.1.1"); codegen.additionalProperties().put("snapshotVersion", "true"); - OpenAPI api = TestUtils.createOpenAPI(); codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); Assert.assertEquals(codegen.getArtifactVersion(), "1.1.1-SNAPSHOT"); } @Test(description = "tests if default version is used when neither OpenAPI version nor artifactVersion additional property has been provided") public void defaultVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setArtifactVersion(null); - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion(null); + codegen.processOpts(); codegen.preprocessOpenAPI(api); @@ -469,12 +421,11 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if default version with snapshot is used when neither OpenAPI version nor artifactVersion additional property has been provided") public void snapshotVersionTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put("snapshotVersion", "true"); - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion(null); + codegen.processOpts(); codegen.preprocessOpenAPI(api); @@ -483,12 +434,11 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if default version with snapshot is used when OpenAPI version has been provided") public void snapshotVersionOpenAPITest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion("2.0"); + codegen.processOpts(); codegen.preprocessOpenAPI(api); @@ -497,12 +447,11 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if setting an artifact version programmatically persists to additional properties, when openapi version is null") public void allowsProgrammaticallySettingArtifactVersionWithNullOpenApiVersion() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); final String version = "9.8.7-rc1"; codegen.setArtifactVersion(version); - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion(null); + codegen.processOpts(); codegen.preprocessOpenAPI(api); @@ -512,12 +461,11 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if setting an artifact version programmatically persists to additional properties, even when openapi version is specified") public void allowsProgrammaticallySettingArtifactVersionWithSpecifiedOpenApiVersion() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); final String version = "9.8.7-rc1"; codegen.setArtifactVersion(version); - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion("1.2.3-SNAPSHOT"); + codegen.processOpts(); codegen.preprocessOpenAPI(api); @@ -527,9 +475,7 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if a null in addition properties artifactVersion results in default version") public void usesDefaultVersionWhenAdditionalPropertiesVersionIsNull() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); final String version = "1.0.0"; - OpenAPI api = TestUtils.createOpenAPI(); api.getInfo().setVersion(null); codegen.setArtifactVersion(null); @@ -545,21 +491,18 @@ public class AbstractJavaCodegenTest { @Test(description = "tests if default version with snapshot is used when setArtifactVersion is used") public void snapshotVersionAlreadySnapshotTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - - OpenAPI api = TestUtils.createOpenAPI(); codegen.setArtifactVersion("4.1.2-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.processOpts(); + codegen.preprocessOpenAPI(TestUtils.createOpenAPI()); + Assert.assertEquals(codegen.getArtifactVersion(), "4.1.2-SNAPSHOT"); } @Test public void toDefaultValueDateTimeLegacyTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setDateLibrary("legacy"); String defaultValue; @@ -592,11 +535,9 @@ public class AbstractJavaCodegenTest { @Test public void toDefaultValueTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setDateLibrary("java8"); - - Schema schema = createObjectSchemaWithMinItems(); + Schema schema = new ObjectSchema().addProperty("id", new IntegerSchema().format("int32")).minItems(1); String defaultValue = codegen.toDefaultValue(schema); Assert.assertEquals(defaultValue, "null"); @@ -605,7 +546,7 @@ public class AbstractJavaCodegenTest { codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("NestedArray", nestedArraySchema))); // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); + schema = new ArraySchema().items(new Schema<>().$ref("#/components/schemas/NestedArray")); ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema); @@ -616,7 +557,7 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(defaultValue, "new ArrayList<>()"); // Create a map schema with additionalProperties type set to array alias - schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); + schema = new MapSchema().additionalProperties(new Schema<>().$ref("#/components/schemas/NestedArray")); ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema); @@ -632,14 +573,14 @@ public class AbstractJavaCodegenTest { Date date = Date.from(defaultLocalDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); dateSchema.setDefault(date); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), dateSchema); - Assert.assertEquals(defaultValue, "LocalDate.parse(\"" + defaultLocalDate.toString() + "\")"); + Assert.assertEquals(defaultValue, "LocalDate.parse(\"" + defaultLocalDate + "\")"); DateTimeSchema dateTimeSchema = new DateTimeSchema(); OffsetDateTime defaultDateTime = OffsetDateTime.parse("1984-12-19T03:39:57-08:00"); ZonedDateTime expectedDateTime = defaultDateTime.atZoneSameInstant(ZoneId.systemDefault()); dateTimeSchema.setDefault(defaultDateTime); defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), dateTimeSchema); - Assert.assertTrue(defaultValue.startsWith("OffsetDateTime.parse(\"" + expectedDateTime.toString())); + Assert.assertTrue(defaultValue.startsWith("OffsetDateTime.parse(\"" + expectedDateTime)); // Test default value for number without format NumberSchema numberSchema = new NumberSchema(); @@ -656,15 +597,14 @@ public class AbstractJavaCodegenTest { @Test public void dateDefaultValueIsIsoDate() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/spring/date-time-parameter-types-for-testing"); codegen.setOpenAPI(openAPI); Set imports = new HashSet<>(); CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(2), imports); Assert.assertEquals(parameter.dataType, "Date"); - Assert.assertEquals(parameter.isDate, true); + Assert.assertTrue(parameter.isDate); Assert.assertEquals(parameter.defaultValue, "1974-01-01"); Assert.assertEquals(imports.size(), 1); Assert.assertEquals(imports.iterator().next(), "Date"); @@ -675,15 +615,14 @@ public class AbstractJavaCodegenTest { @Test public void dateDefaultValueIsIsoDateTime() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/spring/date-time-parameter-types-for-testing"); codegen.setOpenAPI(openAPI); Set imports = new HashSet<>(); CodegenParameter parameter = codegen.fromParameter(openAPI.getPaths().get("/thingy/{date}").getGet().getParameters().get(1), imports); Assert.assertEquals(parameter.dataType, "Date"); - Assert.assertEquals(parameter.isDateTime, true); + Assert.assertTrue(parameter.isDateTime); Assert.assertEquals(parameter.defaultValue, "1973-12-19T03:39:57-08:00"); Assert.assertEquals(imports.size(), 1); Assert.assertEquals(imports.iterator().next(), "Date"); @@ -694,19 +633,19 @@ public class AbstractJavaCodegenTest { @Test public void getTypeDeclarationGivenSchemaMappingTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.schemaMapping().put("MyStringType", "com.example.foo"); codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("MyStringType", new StringSchema()))); - Schema schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/MyStringType")); + Schema schema = new ArraySchema().items(new Schema<>().$ref("#/components/schemas/MyStringType")); + String defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List"); } @Test public void getTypeDeclarationTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - Schema schema = createObjectSchemaWithMinItems(); + Schema schema = new ObjectSchema().addProperty("id", new IntegerSchema().format("int32")).minItems(1); String defaultValue = codegen.getTypeDeclaration(schema); Assert.assertEquals(defaultValue, "Object"); @@ -715,7 +654,7 @@ public class AbstractJavaCodegenTest { codegen.setOpenAPI(new OpenAPI().components(new Components().addSchemas("NestedArray", nestedArraySchema))); // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); + schema = new ArraySchema().items(new Schema<>().$ref("#/components/schemas/NestedArray")); ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.getTypeDeclaration(schema); @@ -726,7 +665,7 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(defaultValue, "List"); // Create an array schema with item type set to the array alias - schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); + schema = new ArraySchema().items(new Schema<>().$ref("#/components/schemas/NestedArray")); schema.setUniqueItems(true); ModelUtils.setGenerateAliasAsModel(false); @@ -738,7 +677,7 @@ public class AbstractJavaCodegenTest { Assert.assertEquals(defaultValue, "Set"); // Create a map schema with additionalProperties type set to array alias - schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); + schema = new MapSchema().additionalProperties(new Schema<>().$ref("#/components/schemas/NestedArray")); ModelUtils.setGenerateAliasAsModel(false); defaultValue = codegen.getTypeDeclaration(schema); @@ -751,66 +690,63 @@ public class AbstractJavaCodegenTest { @Test public void processOptsBooleanTrueFromString() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "true"); - codegen.preprocessOpenAPI(openAPI); + + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void processOptsBooleanTrueFromBoolean() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, true); - codegen.preprocessOpenAPI(openAPI); + + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); + Assert.assertTrue((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void processOptsBooleanFalseFromString() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "false"); - codegen.preprocessOpenAPI(openAPI); + + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void processOptsBooleanFalseFromBoolean() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, false); - codegen.preprocessOpenAPI(openAPI); + + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void processOptsBooleanFalseFromGarbage() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, "blibb"); - codegen.preprocessOpenAPI(openAPI); + + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); + Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void processOptsBooleanFalseFromNumeric() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/petstore.yaml"); codegen.additionalProperties().put(CodegenConstants.SNAPSHOT_VERSION, 42L); - codegen.preprocessOpenAPI(openAPI); + codegen.preprocessOpenAPI(FLATTENED_SPEC.get("3_0/petstore")); Assert.assertFalse((boolean) codegen.additionalProperties().get(CodegenConstants.SNAPSHOT_VERSION)); } @Test public void nullDefaultValueForModelWithDynamicProperties() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/mapSchemas"); codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); codegen.setOpenAPI(openAPI); - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithAdditionalProperties"); + Schema schema = openAPI.getComponents().getSchemas().get("ModelWithAdditionalProperties"); CodegenModel cm = codegen.fromModel("ModelWithAdditionalProperties", schema); Assert.assertEquals(cm.vars.size(), 1, "Expected single declared var"); Assert.assertEquals(cm.vars.get(0).name, "id"); @@ -822,12 +758,11 @@ public class AbstractJavaCodegenTest { @Test public void maplikeDefaultValueForModelWithStringToStringMapping() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/mapSchemas"); codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); codegen.setOpenAPI(openAPI); - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToStringMapping"); + Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToStringMapping"); CodegenModel cm = codegen.fromModel("ModelWithAdditionalProperties", schema); Assert.assertEquals(cm.vars.size(), 0, "Expected no declared vars"); Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); @@ -838,12 +773,11 @@ public class AbstractJavaCodegenTest { @Test public void maplikeDefaultValueForModelWithStringToModelMapping() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/mapSchemas.yaml"); + final OpenAPI openAPI = FLATTENED_SPEC.get("3_0/mapSchemas"); codegen.additionalProperties().put(CodegenConstants.GENERATE_ALIAS_AS_MODEL, true); codegen.setOpenAPI(openAPI); - Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToModelMapping"); + Schema schema = openAPI.getComponents().getSchemas().get("ModelWithStringToModelMapping"); CodegenModel cm = codegen.fromModel("ModelWithStringToModelMapping", schema); Assert.assertEquals(cm.vars.size(), 0, "Expected no declared vars"); Assert.assertNull(cm.defaultValue, "Expected no defined default value in spec"); @@ -856,20 +790,19 @@ public class AbstractJavaCodegenTest { public void srcMainFolderShouldNotBeOperatingSystemSpecificPaths() { // it's not responsibility of the generator to fix OS-specific paths. This is left to template manager. // This path must be non-OS-specific for expectations in source outputs (e.g. gradle build files) - Assert.assertEquals(fakeJavaCodegen.getSourceFolder(), "src/main/java"); + Assert.assertEquals(codegen.getSourceFolder(), "src/main/java"); } @Test public void srcTestFolderShouldNotBeOperatingSystemSpecificPaths() { // it's not responsibility of the generator to fix OS-specific paths. This is left to template manager. // This path must be non-OS-specific for expectations in source outputs (e.g. gradle build files) - Assert.assertEquals(fakeJavaCodegen.getTestFolder(), "src/test/java"); + Assert.assertEquals(codegen.getTestFolder(), "src/test/java"); } @Test - public void testOneOfModelImports() throws Exception { + public void testOneOfModelImports() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOf_nonPrimitive.yaml"); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOpenAPI(openAPI); codegen.preprocessOpenAPI(openAPI); @@ -882,16 +815,15 @@ public class AbstractJavaCodegenTest { } @Test - public void arrayParameterDefaultValueDoesNotNeedBraces() throws Exception { + public void arrayParameterDefaultValueDoesNotNeedBraces() { ParseOptions parseOptions = new ParseOptions(); parseOptions.setResolve(true); final OpenAPI openAPI = new OpenAPIParser() .readLocation("src/test/resources/3_0/issue_16223.yaml", null, parseOptions) .getOpenAPI(); - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.setOpenAPI(openAPI); - Map schemas = openAPI.getPaths().get("/test").getGet().getParameters().stream() + Map> schemas = openAPI.getPaths().get("/test").getGet().getParameters().stream() .collect(Collectors.toMap( Parameter::getName, p -> ModelUtils.getReferencedSchema(openAPI, p.getSchema()))); @@ -903,7 +835,6 @@ public class AbstractJavaCodegenTest { @Test public void ignoreBeanValidationAnnotationsTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put("useBeanValidation", true); Schema schema = new Schema<>().type("string").format("uuid").pattern("^[a-z]$").maxLength(36); @@ -921,11 +852,14 @@ public class AbstractJavaCodegenTest { schema = new Schema<>().type("string").format("binary").pattern("^[a-z]$").maxLength(36); defaultValue = codegen.getTypeDeclaration(schema); Assert.assertEquals(defaultValue, "File"); + + schema = new Schema<>().type("string")._enum(List.of("A","B")).pattern("^[a-z]$").maxLength(36); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "String"); } @Test public void ignoreBeanValidationAnnotationsContainerTest() { - final P_AbstractJavaCodegen codegen = new P_AbstractJavaCodegen(); codegen.additionalProperties().put("useBeanValidation", true); Schema schema = new ArraySchema().items(new Schema<>().type("string").format("uuid").pattern("^[a-z]$").maxLength(36)); @@ -943,38 +877,95 @@ public class AbstractJavaCodegenTest { schema = new ArraySchema().items(new Schema<>().type("string").format("binary").pattern("^[a-z]$").maxLength(36)); defaultValue = codegen.getTypeDeclaration(schema); Assert.assertEquals(defaultValue, "List"); + + schema = new ArraySchema().items(new Schema<>().type("string")._enum(List.of("A","B")).pattern("^[a-z]$").maxLength(36)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List"); } - private static Schema createObjectSchemaWithMinItems() { - return new ObjectSchema() - .addProperties("id", new IntegerSchema().format("int32")) - .minItems(1); - } + @Test + public void AnnotationsContainerTest() { + codegen.additionalProperties().put("useBeanValidation", true); - private static class P_AbstractJavaCodegen extends AbstractJavaCodegen { - @Override - public CodegenType getTag() { - return null; - } + // 1. string type + Schema schema = new ArraySchema().items(new Schema<>().type("string").pattern("^[a-z]$").minLength(0).maxLength(36)); + String defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Pattern(regexp = \"^[a-z]$\")@Size(min = 0, max = 36)String>"); - @Override - public String getName() { - return null; - } + schema = new ArraySchema().items(new Schema<>().type("string").pattern("^[a-z]$").minLength(0)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Pattern(regexp = \"^[a-z]$\")@Size(min = 0)String>"); - @Override - public String getHelp() { - return null; - } + schema = new ArraySchema().items(new Schema<>().type("string").pattern("^[a-z]$").maxLength(36)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Pattern(regexp = \"^[a-z]$\")@Size(max = 36)String>"); - /** - * Gets artifact version. - * Only for testing purposes. - * - * @return version - */ - public String getArtifactVersion() { - return this.artifactVersion; - } + schema = new ArraySchema().items(new Schema<>().type("string").format("email")); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Email String>"); + + // 2. string type with number format + schema = new ArraySchema().items(new Schema<>().type("string").format("number").minimum(BigDecimal.ZERO).maximum(BigDecimal.TEN).exclusiveMinimum(Boolean.TRUE).exclusiveMaximum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin(value = \"0\", inclusive = false) @DecimalMax(value = \"10\", inclusive = false)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("string").format("number").minimum(BigDecimal.ZERO).exclusiveMinimum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin( value = \"0\", inclusive = false)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("string").format("number").maximum(BigDecimal.TEN).exclusiveMaximum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMax( value = \"10\", inclusive = false)BigDecimal>"); + + // 3. number type + schema = new ArraySchema().items(new Schema<>().type("number").minimum(BigDecimal.ZERO).maximum(BigDecimal.TEN).exclusiveMinimum(Boolean.TRUE).exclusiveMaximum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin(value = \"0\", inclusive = false) @DecimalMax(value = \"10\", inclusive = false)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("number").minimum(BigDecimal.ZERO).exclusiveMinimum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin( value = \"0\", inclusive = false)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("number").maximum(BigDecimal.TEN).exclusiveMaximum(Boolean.TRUE)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMax( value = \"10\", inclusive = false)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("number").minimum(BigDecimal.ZERO).maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin(value = \"0\", inclusive = true) @DecimalMax(value = \"10\", inclusive = true)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("number").minimum(BigDecimal.ZERO)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMin( value = \"0\", inclusive = true)BigDecimal>"); + + schema = new ArraySchema().items(new Schema<>().type("number").maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@DecimalMax( value = \"10\", inclusive = true)BigDecimal>"); + + // 4. integer type with int64 format + schema = new ArraySchema().items(new Schema<>().type("integer").format("int64").minimum(BigDecimal.ZERO).maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Min(0L) @Max(10L)Long>"); + + schema = new ArraySchema().items(new Schema<>().type("integer").format("int64").minimum(BigDecimal.ZERO)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Min(0L)Long>"); + + schema = new ArraySchema().items(new Schema<>().type("integer").format("int64").maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Max(10L)Long>"); + + // 5. integer type + schema = new ArraySchema().items(new Schema<>().type("integer").minimum(BigDecimal.ZERO).maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Min(0) @Max(10)Integer>"); + + schema = new ArraySchema().items(new Schema<>().type("integer").minimum(BigDecimal.ZERO)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Min(0)Integer>"); + + schema = new ArraySchema().items(new Schema<>().type("integer").maximum(BigDecimal.TEN)); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "List<@Max(10)Integer>"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 7542ca35bab..dcb6aa56ea1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -17,7 +17,7 @@ package org.openapitools.codegen.java; -import static org.junit.Assert.assertNotNull; +import org.junit.jupiter.api.Assertions; import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.assertFileNotContains; import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; @@ -59,6 +59,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; +import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.regex.Matcher; @@ -108,9 +109,9 @@ public class JavaClientCodegenTest { "application/json", new MediaType().schema(new ArraySchema().items(new StringSchema())))); CodegenParameter codegenParameter1 = codegen.fromRequestBody(body1, new HashSet(), null); - Assert.assertEquals(codegenParameter1.description, "A list of ids"); - Assert.assertEquals(codegenParameter1.dataType, "List"); - Assert.assertEquals(codegenParameter1.baseType, "String"); + Assertions.assertEquals(codegenParameter1.description, "A list of ids"); + Assertions.assertEquals(codegenParameter1.dataType, "List"); + Assertions.assertEquals(codegenParameter1.baseType, "String"); RequestBody body2 = new RequestBody(); body2.setDescription("A list of list of values"); @@ -122,9 +123,9 @@ public class JavaClientCodegenTest { .schema( new ArraySchema().items(new ArraySchema().items(new IntegerSchema()))))); CodegenParameter codegenParameter2 = codegen.fromRequestBody(body2, new HashSet(), null); - Assert.assertEquals(codegenParameter2.description, "A list of list of values"); - Assert.assertEquals(codegenParameter2.dataType, "List>"); - Assert.assertEquals(codegenParameter2.baseType, "List"); + Assertions.assertEquals(codegenParameter2.description, "A list of list of values"); + Assertions.assertEquals(codegenParameter2.dataType, "List>"); + Assertions.assertEquals(codegenParameter2.baseType, "List"); RequestBody body3 = new RequestBody(); body3.setDescription("A list of points"); @@ -141,9 +142,9 @@ public class JavaClientCodegenTest { point.addProperty("x", new IntegerSchema().format(SchemaTypeUtil.INTEGER32_FORMAT)); point.addProperty("y", new IntegerSchema().format(SchemaTypeUtil.INTEGER32_FORMAT)); CodegenParameter codegenParameter3 = codegen.fromRequestBody(body3, new HashSet(), null); - Assert.assertEquals(codegenParameter3.description, "A list of points"); - Assert.assertEquals(codegenParameter3.dataType, "List"); - Assert.assertEquals(codegenParameter3.baseType, "Point"); + Assertions.assertEquals(codegenParameter3.description, "A list of points"); + Assertions.assertEquals(codegenParameter3.dataType, "List"); + Assertions.assertEquals(codegenParameter3.baseType, "Point"); } @Test @@ -152,7 +153,7 @@ public class JavaClientCodegenTest { ComposedSchema schema = new ComposedSchema(); CodegenModel result = codegen.fromModel("CompSche", schema); - Assert.assertEquals(result.name, "CompSche"); + Assertions.assertEquals(result.name, "CompSche"); } @Test @@ -176,7 +177,7 @@ public class JavaClientCodegenTest { javaClientCodegen.postProcessOperationsWithModels(objs, Collections.emptyList()); - Assert.assertEquals(Arrays.asList(pathParam1, pathParam2, queryParamRequired, queryParamOptional), codegenOperation.allParams); + Assertions.assertEquals(Arrays.asList(pathParam1, pathParam2, queryParamRequired, queryParamOptional), codegenOperation.allParams); } @Test @@ -184,22 +185,22 @@ public class JavaClientCodegenTest { final JavaClientCodegen codegen = new JavaClientCodegen(); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertFalse(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + Assertions.assertFalse(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "org.openapitools.client.model"); - Assert.assertEquals( + Assertions.assertEquals(codegen.modelPackage(), "org.openapitools.client.model"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.client.model"); - Assert.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assert.assertEquals( + Assertions.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.client.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client"); - Assert.assertEquals( + Assertions.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); + Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); } @Test @@ -212,20 +213,20 @@ public class JavaClientCodegenTest { codegen.setSerializationLibrary("JACKSON"); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals( + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assertions.assertTrue(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.model"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals( + Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.api"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals( + Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.invoker"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.invoker"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); // the library JavaClientCodegen.OKHTTP_GSON only supports GSON + Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_GSON); // the library JavaClientCodegen.OKHTTP_GSON only supports GSON } @Test @@ -243,21 +244,21 @@ public class JavaClientCodegenTest { codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY2); codegen.processOpts(); - Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertTrue(codegen.isHideGenerationTimestamp()); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals( + Assertions.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); + Assertions.assertTrue(codegen.isHideGenerationTimestamp()); + Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals( + Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.iiii.invoker"); - Assert.assertEquals( + Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.iiii.invoker"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.iiii.invoker"); - Assert.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); + Assertions.assertEquals(codegen.getSerializationLibrary(), JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON); } @Test @@ -320,7 +321,7 @@ public class JavaClientCodegenTest { codegen.additionalProperties().put(CodegenConstants.LIBRARY, JavaClientCodegen.JERSEY3); codegen.processOpts(); - Assert.assertTrue(codegen.getFeatureSet().getSecurityFeatures().contains(SecurityFeature.SignatureAuth)); + Assertions.assertTrue(codegen.getFeatureSet().getSecurityFeatures().contains(SecurityFeature.SignatureAuth)); } @Test @@ -332,16 +333,16 @@ public class JavaClientCodegenTest { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.zzzzzzz.aaaaa.api"); codegen.processOpts(); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals( + Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals( + Assertions.assertEquals(codegen.apiPackage(), "xyz.yyyyy.zzzzzzz.aaaaa.api"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.aaaaa"); - Assert.assertEquals( + Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.aaaaa"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.aaaaa"); } @@ -354,16 +355,16 @@ public class JavaClientCodegenTest { .put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.zzzzzzz.mmmmm.model"); codegen.processOpts(); - Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals( + Assertions.assertEquals(codegen.modelPackage(), "xyz.yyyyy.zzzzzzz.mmmmm.model"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm.model"); - Assert.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); - Assert.assertEquals( + Assertions.assertEquals(codegen.apiPackage(), "org.openapitools.client.api"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.client.api"); - Assert.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.mmmmm"); - Assert.assertEquals( + Assertions.assertEquals(codegen.getInvokerPackage(), "xyz.yyyyy.zzzzzzz.mmmmm"); + Assertions.assertEquals( codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "xyz.yyyyy.zzzzzzz.mmmmm"); } @@ -376,8 +377,8 @@ public class JavaClientCodegenTest { Operation operation = openAPI.getPaths().get("/ping").getPost(); CodegenOperation co = codegen.fromOperation("/ping", "POST", operation, null); - Assert.assertEquals(co.allParams.size(), 1); - Assert.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries"); + Assertions.assertEquals(co.allParams.size(), 1); + Assertions.assertEquals(co.allParams.get(0).baseType, "MessageEventCoreWithTimeListEntries"); } @Test @@ -389,11 +390,11 @@ public class JavaClientCodegenTest { List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars); Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "NUMBER_1"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); + Assertions.assertNotNull(testedEnumVar); + Assertions.assertEquals(testedEnumVar.getOrDefault("name", ""), "NUMBER_1"); + Assertions.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); } @Test @@ -409,11 +410,11 @@ public class JavaClientCodegenTest { List> enumVars = (List>) array.getItems().getAllowableValues().get("enumVars"); - Assert.assertNotNull(enumVars); + Assertions.assertNotNull(enumVars); Map testedEnumVar = enumVars.get(0); - Assert.assertNotNull(testedEnumVar); - Assert.assertEquals(testedEnumVar.getOrDefault("name", ""), "ONE"); - Assert.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); + Assertions.assertNotNull(testedEnumVar); + Assertions.assertEquals(testedEnumVar.getOrDefault("name", ""), "ONE"); + Assertions.assertEquals(testedEnumVar.getOrDefault("value", ""), "1"); } @Test @@ -434,7 +435,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 40); + Assertions.assertEquals(files.size(), 40); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -510,7 +511,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 43); + Assertions.assertEquals(files.size(), 43); TestUtils.ensureContainsFile(files, output, ".gitignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator-ignore"); TestUtils.ensureContainsFile(files, output, ".openapi-generator/FILES"); @@ -598,7 +599,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 32); + Assertions.assertEquals(files.size(), 32); validateJavaSourceFiles(files); TestUtils.assertFileContains( @@ -667,7 +668,7 @@ public class JavaClientCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 153); + Assertions.assertEquals(files.size(), 153); validateJavaSourceFiles(files); TestUtils.assertFileContains(Paths.get(output + "/src/main/java/xyz/abcdef/model/Dog.java"), @@ -694,7 +695,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 35); + Assertions.assertEquals(files.size(), 35); validateJavaSourceFiles(files); Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/PingApi.java"); @@ -721,10 +722,10 @@ public class JavaClientCodegenTest { ApiResponse ok_200 = openAPI.getComponents().getResponses().get("OK_200"); CodegenResponse response = codegen.fromResponse("200", ok_200); - Assert.assertEquals(response.headers.size(), 1); + Assertions.assertEquals(response.headers.size(), 1); CodegenProperty header = response.headers.get(0); - Assert.assertEquals(header.dataType, "UUID"); - Assert.assertEquals(header.baseName, "Request"); + Assertions.assertEquals(header.dataType, "UUID"); + Assertions.assertEquals(header.baseName, "Request"); } @Test @@ -790,7 +791,7 @@ public class JavaClientCodegenTest { validateJavaSourceFiles(files); - Assert.assertEquals(files.size(), 1); + Assertions.assertEquals(files.size(), 1); files.forEach(File::deleteOnExit); } @@ -819,7 +820,7 @@ public class JavaClientCodegenTest { validateJavaSourceFiles(files); - Assert.assertEquals(files.size(), 9); + Assertions.assertEquals(files.size(), 9); files.forEach(File::deleteOnExit); } @@ -898,29 +899,29 @@ public class JavaClientCodegenTest { Schema test1 = openAPI.getComponents().getSchemas().get("MapTest1"); codegen.setOpenAPI(openAPI); CodegenModel cm1 = codegen.fromModel("MapTest1", test1); - Assert.assertEquals(cm1.getDataType(), "Map"); - Assert.assertEquals(cm1.getParent(), "HashMap"); - Assert.assertEquals(cm1.getClassname(), "MapTest1"); + Assertions.assertEquals(cm1.getDataType(), "Map"); + Assertions.assertEquals(cm1.getParent(), "HashMap"); + Assertions.assertEquals(cm1.getClassname(), "MapTest1"); Schema test2 = openAPI.getComponents().getSchemas().get("MapTest2"); codegen.setOpenAPI(openAPI); CodegenModel cm2 = codegen.fromModel("MapTest2", test2); - Assert.assertEquals(cm2.getDataType(), "Map"); - Assert.assertEquals(cm2.getParent(), "HashMap"); - Assert.assertEquals(cm2.getClassname(), "MapTest2"); + Assertions.assertEquals(cm2.getDataType(), "Map"); + Assertions.assertEquals(cm2.getParent(), "HashMap"); + Assertions.assertEquals(cm2.getClassname(), "MapTest2"); Schema test3 = openAPI.getComponents().getSchemas().get("MapTest3"); codegen.setOpenAPI(openAPI); CodegenModel cm3 = codegen.fromModel("MapTest3", test3); - Assert.assertEquals(cm3.getDataType(), "Map"); - Assert.assertEquals(cm3.getParent(), "HashMap"); - Assert.assertEquals(cm3.getClassname(), "MapTest3"); + Assertions.assertEquals(cm3.getDataType(), "Map"); + Assertions.assertEquals(cm3.getParent(), "HashMap"); + Assertions.assertEquals(cm3.getClassname(), "MapTest3"); Schema other = openAPI.getComponents().getSchemas().get("OtherObj"); codegen.setOpenAPI(openAPI); CodegenModel cm = codegen.fromModel("OtherObj", other); - Assert.assertEquals(cm.getDataType(), "Object"); - Assert.assertEquals(cm.getClassname(), "OtherObj"); + Assertions.assertEquals(cm.getDataType(), "Object"); + Assertions.assertEquals(cm.getClassname(), "OtherObj"); } /** @@ -948,7 +949,7 @@ public class JavaClientCodegenTest { .setOutputDir(output.getAbsolutePath().replace("\\", "/")); final ClientOptInput clientOptInput = configurator.toClientOptInput(); - Assert.assertEquals( + Assertions.assertEquals( clientOptInput.getConfig().schemaMapping().get("TypeAlias"), "foo.bar.TypeAlias"); DefaultGenerator generator = new DefaultGenerator(); @@ -963,7 +964,7 @@ public class JavaClientCodegenTest { validateJavaSourceFiles(files); - Assert.assertEquals(files.size(), 1); + Assertions.assertEquals(files.size(), 1); TestUtils.ensureContainsFile( files, output, "src/main/java/org/openapitools/client/model/ParentType.java"); @@ -978,11 +979,11 @@ public class JavaClientCodegenTest { final Pattern FIELD_PATTERN = Pattern.compile(".* private (.*?) typeAlias;.*", Pattern.DOTALL); Matcher fieldMatcher = FIELD_PATTERN.matcher(parentTypeContents); - Assert.assertTrue(fieldMatcher.matches()); + Assertions.assertTrue(fieldMatcher.matches()); // this is the type of the field 'typeAlias'. With a working schemaMapping it should // be 'foo.bar.TypeAlias' or just 'TypeAlias' - Assert.assertEquals(fieldMatcher.group(1), "foo.bar.TypeAlias"); + Assertions.assertEquals(fieldMatcher.group(1), "foo.bar.TypeAlias"); } @Test @@ -992,10 +993,43 @@ public class JavaClientCodegenTest { JavaClientCodegen codegen = new JavaClientCodegen(); List security = codegen.fromSecurity(openAPI.getComponents().getSecuritySchemes()); - Assert.assertEquals(security.size(), 1); - Assert.assertEquals(security.get(0).isBasic, Boolean.TRUE); - Assert.assertEquals(security.get(0).isBasicBasic, Boolean.FALSE); - Assert.assertEquals(security.get(0).isBasicBearer, Boolean.TRUE); + Assertions.assertEquals(security.size(), 1); + Assertions.assertEquals(security.get(0).isBasic, Boolean.TRUE); + Assertions.assertEquals(security.get(0).isBasicBasic, Boolean.FALSE); + Assertions.assertEquals(security.get(0).isBasicBearer, Boolean.TRUE); + } + + @Test + public void testVertXAuthInfoWithHyphenSeparatedSecurityScheme() throws Exception { + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.VERTX) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/ping-with-hyphen-separated-security-scheme.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + // Test that hyphen-separated security scheme names does not + // break the Java VertX client code generation + validateJavaSourceFiles(files); + + // Test that the name was correctly transformed to camelCase + // starting with an uppercase letter + TestUtils.assertFileContains( + Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"), + "public static class AuthInfo {", + "public void addHyphenatedNameTestAuthentication(String bearerToken) {", + "public static AuthInfo forHyphenatedNameTestAuthentication(String bearerToken) {" + ); } private CodegenProperty codegenPropertyWithArrayOfIntegerValues() { @@ -1048,135 +1082,135 @@ public class JavaClientCodegenTest { Schema test1 = openAPI.getComponents().getSchemas().get("AnyValueModel"); codegen.setOpenAPI(openAPI); CodegenModel cm1 = codegen.fromModel("AnyValueModel", test1); - Assert.assertEquals(cm1.getClassname(), "AnyValueModel"); + Assertions.assertEquals(cm1.getClassname(), "AnyValueModel"); final CodegenProperty property1 = cm1.allVars.get(0); - Assert.assertEquals(property1.baseName, "any_value"); - Assert.assertEquals(property1.dataType, "Object"); - Assert.assertTrue(property1.isPrimitiveType); - Assert.assertFalse(property1.isContainer); - Assert.assertFalse(property1.isFreeFormObject); - Assert.assertTrue(property1.isAnyType); + Assertions.assertEquals(property1.baseName, "any_value"); + Assertions.assertEquals(property1.dataType, "Object"); + Assertions.assertTrue(property1.isPrimitiveType); + Assertions.assertFalse(property1.isContainer); + Assertions.assertFalse(property1.isFreeFormObject); + Assertions.assertTrue(property1.isAnyType); final CodegenProperty property2 = cm1.allVars.get(1); - Assert.assertEquals(property2.baseName, "any_value_with_desc"); - Assert.assertEquals(property2.dataType, "Object"); - Assert.assertFalse(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertFalse(property2.isContainer); - Assert.assertFalse(property2.isFreeFormObject); - Assert.assertTrue(property2.isAnyType); + Assertions.assertEquals(property2.baseName, "any_value_with_desc"); + Assertions.assertEquals(property2.dataType, "Object"); + Assertions.assertFalse(property2.required); + Assertions.assertTrue(property2.isPrimitiveType); + Assertions.assertFalse(property2.isContainer); + Assertions.assertFalse(property2.isFreeFormObject); + Assertions.assertTrue(property2.isAnyType); final CodegenProperty property3 = cm1.allVars.get(2); - Assert.assertEquals(property3.baseName, "any_value_nullable"); - Assert.assertEquals(property3.dataType, "Object"); - Assert.assertFalse(property3.required); - Assert.assertTrue(property3.isPrimitiveType); - Assert.assertFalse(property3.isContainer); - Assert.assertFalse(property3.isFreeFormObject); - Assert.assertTrue(property3.isAnyType); + Assertions.assertEquals(property3.baseName, "any_value_nullable"); + Assertions.assertEquals(property3.dataType, "Object"); + Assertions.assertFalse(property3.required); + Assertions.assertTrue(property3.isPrimitiveType); + Assertions.assertFalse(property3.isContainer); + Assertions.assertFalse(property3.isFreeFormObject); + Assertions.assertTrue(property3.isAnyType); Schema test2 = openAPI.getComponents().getSchemas().get("AnyValueModelInline"); codegen.setOpenAPI(openAPI); CodegenModel cm2 = codegen.fromModel("AnyValueModelInline", test2); - Assert.assertEquals(cm2.getClassname(), "AnyValueModelInline"); + Assertions.assertEquals(cm2.getClassname(), "AnyValueModelInline"); final CodegenProperty cp1 = cm2.vars.get(0); - Assert.assertEquals(cp1.baseName, "any_value"); - Assert.assertEquals(cp1.dataType, "Object"); - Assert.assertFalse(cp1.required); - Assert.assertTrue(cp1.isPrimitiveType); - Assert.assertFalse(cp1.isContainer); - Assert.assertFalse(cp1.isFreeFormObject); - Assert.assertTrue(cp1.isAnyType); + Assertions.assertEquals(cp1.baseName, "any_value"); + Assertions.assertEquals(cp1.dataType, "Object"); + Assertions.assertFalse(cp1.required); + Assertions.assertTrue(cp1.isPrimitiveType); + Assertions.assertFalse(cp1.isContainer); + Assertions.assertFalse(cp1.isFreeFormObject); + Assertions.assertTrue(cp1.isAnyType); final CodegenProperty cp2 = cm2.vars.get(1); - Assert.assertEquals(cp2.baseName, "any_value_with_desc"); - Assert.assertEquals(cp2.dataType, "Object"); - Assert.assertFalse(cp2.required); - Assert.assertTrue(cp2.isPrimitiveType); - Assert.assertFalse(cp2.isContainer); - Assert.assertFalse(cp2.isFreeFormObject); - Assert.assertTrue(cp2.isAnyType); + Assertions.assertEquals(cp2.baseName, "any_value_with_desc"); + Assertions.assertEquals(cp2.dataType, "Object"); + Assertions.assertFalse(cp2.required); + Assertions.assertTrue(cp2.isPrimitiveType); + Assertions.assertFalse(cp2.isContainer); + Assertions.assertFalse(cp2.isFreeFormObject); + Assertions.assertTrue(cp2.isAnyType); final CodegenProperty cp3 = cm2.vars.get(2); - Assert.assertEquals(cp3.baseName, "any_value_nullable"); - Assert.assertEquals(cp3.dataType, "Object"); - Assert.assertFalse(cp3.required); - Assert.assertTrue(cp3.isPrimitiveType); - Assert.assertFalse(cp3.isContainer); - Assert.assertFalse(cp3.isFreeFormObject); - Assert.assertTrue(cp3.isAnyType); + Assertions.assertEquals(cp3.baseName, "any_value_nullable"); + Assertions.assertEquals(cp3.dataType, "Object"); + Assertions.assertFalse(cp3.required); + Assertions.assertTrue(cp3.isPrimitiveType); + Assertions.assertFalse(cp3.isContainer); + Assertions.assertFalse(cp3.isFreeFormObject); + Assertions.assertTrue(cp3.isAnyType); // map // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp4 = cm2.vars.get(3); - Assert.assertEquals(cp4.baseName, "map_free_form_object"); - Assert.assertEquals(cp4.dataType, "Map"); - Assert.assertFalse(cp4.required); - Assert.assertTrue(cp4.isPrimitiveType); - Assert.assertTrue(cp4.isContainer); - Assert.assertTrue(cp4.isMap); - Assert.assertTrue(cp4.isFreeFormObject); - Assert.assertFalse(cp4.isAnyType); - Assert.assertFalse(cp4.isModel); + Assertions.assertEquals(cp4.baseName, "map_free_form_object"); + Assertions.assertEquals(cp4.dataType, "Map"); + Assertions.assertFalse(cp4.required); + Assertions.assertTrue(cp4.isPrimitiveType); + Assertions.assertTrue(cp4.isContainer); + Assertions.assertTrue(cp4.isMap); + Assertions.assertTrue(cp4.isFreeFormObject); + Assertions.assertFalse(cp4.isAnyType); + Assertions.assertFalse(cp4.isModel); // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp5 = cm2.vars.get(4); - Assert.assertEquals(cp5.baseName, "map_any_value_with_desc"); - Assert.assertEquals(cp5.dataType, "Map"); - Assert.assertFalse(cp5.required); - Assert.assertTrue(cp5.isPrimitiveType); - Assert.assertTrue(cp5.isContainer); - Assert.assertTrue(cp5.isMap); - Assert.assertTrue(cp5.isFreeFormObject); - Assert.assertFalse(cp5.isAnyType); - Assert.assertFalse(cp5.isModel); + Assertions.assertEquals(cp5.baseName, "map_any_value_with_desc"); + Assertions.assertEquals(cp5.dataType, "Map"); + Assertions.assertFalse(cp5.required); + Assertions.assertTrue(cp5.isPrimitiveType); + Assertions.assertTrue(cp5.isContainer); + Assertions.assertTrue(cp5.isMap); + Assertions.assertTrue(cp5.isFreeFormObject); + Assertions.assertFalse(cp5.isAnyType); + Assertions.assertFalse(cp5.isModel); // Should allow in any type including map, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp6 = cm2.vars.get(5); - Assert.assertEquals(cp6.baseName, "map_any_value_nullable"); - Assert.assertEquals(cp6.dataType, "Map"); - Assert.assertFalse(cp6.required); - Assert.assertTrue(cp6.isPrimitiveType); - Assert.assertTrue(cp6.isContainer); - Assert.assertTrue(cp6.isMap); - Assert.assertTrue(cp6.isFreeFormObject); - Assert.assertFalse(cp6.isAnyType); + Assertions.assertEquals(cp6.baseName, "map_any_value_nullable"); + Assertions.assertEquals(cp6.dataType, "Map"); + Assertions.assertFalse(cp6.required); + Assertions.assertTrue(cp6.isPrimitiveType); + Assertions.assertTrue(cp6.isContainer); + Assertions.assertTrue(cp6.isMap); + Assertions.assertTrue(cp6.isFreeFormObject); + Assertions.assertFalse(cp6.isAnyType); // array // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp7 = cm2.vars.get(6); - Assert.assertEquals(cp7.baseName, "array_any_value"); - Assert.assertEquals(cp7.dataType, "List"); - Assert.assertFalse(cp7.required); - Assert.assertTrue(cp7.isPrimitiveType); - Assert.assertTrue(cp7.isContainer); - Assert.assertTrue(cp7.isArray); - Assert.assertFalse(cp7.isFreeFormObject); - Assert.assertFalse(cp7.isAnyType); + Assertions.assertEquals(cp7.baseName, "array_any_value"); + Assertions.assertEquals(cp7.dataType, "List"); + Assertions.assertFalse(cp7.required); + Assertions.assertTrue(cp7.isPrimitiveType); + Assertions.assertTrue(cp7.isContainer); + Assertions.assertTrue(cp7.isArray); + Assertions.assertFalse(cp7.isFreeFormObject); + Assertions.assertFalse(cp7.isAnyType); // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp8 = cm2.vars.get(7); - Assert.assertEquals(cp8.baseName, "array_any_value_with_desc"); - Assert.assertEquals(cp8.dataType, "List"); - Assert.assertFalse(cp8.required); - Assert.assertTrue(cp8.isPrimitiveType); - Assert.assertTrue(cp8.isContainer); - Assert.assertTrue(cp8.isArray); - Assert.assertFalse(cp8.isFreeFormObject); - Assert.assertFalse(cp8.isAnyType); + Assertions.assertEquals(cp8.baseName, "array_any_value_with_desc"); + Assertions.assertEquals(cp8.dataType, "List"); + Assertions.assertFalse(cp8.required); + Assertions.assertTrue(cp8.isPrimitiveType); + Assertions.assertTrue(cp8.isContainer); + Assertions.assertTrue(cp8.isArray); + Assertions.assertFalse(cp8.isFreeFormObject); + Assertions.assertFalse(cp8.isAnyType); // Should allow in any type including array, https://github.com/swagger-api/swagger-parser/issues/1603 final CodegenProperty cp9 = cm2.vars.get(8); - Assert.assertEquals(cp9.baseName, "array_any_value_nullable"); - Assert.assertEquals(cp9.dataType, "List"); - Assert.assertFalse(cp9.required); - Assert.assertTrue(cp9.isPrimitiveType); - Assert.assertTrue(cp9.isContainer); - Assert.assertTrue(cp9.isArray); - Assert.assertFalse(cp9.isFreeFormObject); - Assert.assertFalse(cp9.isAnyType); + Assertions.assertEquals(cp9.baseName, "array_any_value_nullable"); + Assertions.assertEquals(cp9.dataType, "List"); + Assertions.assertFalse(cp9.required); + Assertions.assertTrue(cp9.isPrimitiveType); + Assertions.assertTrue(cp9.isContainer); + Assertions.assertTrue(cp9.isArray); + Assertions.assertFalse(cp9.isFreeFormObject); + Assertions.assertFalse(cp9.isAnyType); } /** @@ -1328,7 +1362,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 49); + Assertions.assertEquals(files.size(), 49); TestUtils.ensureContainsFile( files, output, "src/main/java/org/openapitools/client/model/RealCommand.java"); TestUtils.ensureContainsFile( @@ -1623,7 +1657,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 35); + Assertions.assertEquals(files.size(), 35); validateJavaSourceFiles(files); TestUtils.assertFileContains( @@ -1654,7 +1688,7 @@ public class JavaClientCodegenTest { DefaultGenerator generator = new DefaultGenerator(); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 38); + Assertions.assertEquals(files.size(), 38); validateJavaSourceFiles(files); TestUtils.assertFileContains( @@ -2125,7 +2159,7 @@ public class JavaClientCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); List files = generator.opts(clientOptInput).generate(); - Assert.assertEquals(files.size(), 27); + Assertions.assertEquals(files.size(), 27); validateJavaSourceFiles(files); TestUtils.assertFileContains( @@ -2362,6 +2396,16 @@ public class JavaClientCodegenTest { final String pathToSpecification, final String library, final Map properties + ) { + return generateFromContract(pathToSpecification, library, properties, configurator -> {}); + } + + @SneakyThrows + private static Map generateFromContract( + final String pathToSpecification, + final String library, + final Map properties, + final Consumer consumer ) { final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); @@ -2372,7 +2416,7 @@ public class JavaClientCodegenTest { .setAdditionalProperties(properties) .setInputSpec(pathToSpecification) .setOutputDir(output.getAbsolutePath()); - + consumer.accept(configurator); final ClientOptInput clientOptInput = configurator.toClientOptInput(); final DefaultGenerator generator = new DefaultGenerator(); return generator.opts(clientOptInput).generate().stream() @@ -2453,12 +2497,12 @@ public class JavaClientCodegenTest { CodegenModel cm1 = codegen.fromModel("Cat", test1); CodegenProperty cp0 = cm1.getAllVars().get(0); - Assert.assertEquals(cp0.getName(), "petType"); - Assert.assertEquals(cp0.isOverridden, true); + Assertions.assertEquals(cp0.getName(), "petType"); + Assertions.assertEquals(cp0.isOverridden, true); CodegenProperty cp1 = cm1.getAllVars().get(1); - Assert.assertEquals(cp1.getName(), "name"); - Assert.assertEquals(cp1.isOverridden, false); + Assertions.assertEquals(cp1.getName(), "name"); + Assertions.assertEquals(cp1.isOverridden, false); } @Test @@ -2986,7 +3030,7 @@ public class JavaClientCodegenTest { File apiFile = files.get("HelloExampleApi.java"); - assertNotNull(apiFile); + Assertions.assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile) .assertMethod("helloCall", "String", "ApiCallback") .bodyContainsLines( @@ -3110,12 +3154,12 @@ public class JavaClientCodegenTest { // enum File modelFile = files.get("Metadata.java"); - assertNotNull(modelFile); + Assertions.assertNotNull(modelFile); JavaFileAssert.assertThat(modelFile).fileContains(expectedEnumLines); // Inner enum File apiFile = files.get("V1SchemasGetDefaultResponse.java"); - assertNotNull(apiFile); + Assertions.assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile).fileContains(expectedInnerEnumLines); } @@ -3146,4 +3190,288 @@ public class JavaClientCodegenTest { Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/DepartmentApi.java"); TestUtils.assertFileContains(petApi, "if (filter != null) {"); } + + @Test + public void generateAllArgsConstructor() { + Map files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", JavaClientCodegen.RESTTEMPLATE, + Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE), + codegenConfigurator -> codegenConfigurator.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "false")); + JavaFileAssert.assertThat(files.get("Pet.java")) + .fileContains("protected String name", "protected String type") + .assertConstructor("String") + .hasParameter("type").toConstructor() + .toFileAssert() + .assertConstructor("LocalDate", "String", "String") + .hasParameter("dateOfBirth").toConstructor() + .hasParameter("name").toConstructor() + .hasParameter("type").toConstructor(); + JavaFileAssert.assertThat(files.get("Cat.java")) + .assertConstructor("Integer", "String", "LocalDate", "String", "String"); + + // test readonly constructor + JavaFileAssert.assertThat(files.get("Page.java")) + .assertConstructor("Integer") + .toFileAssert() + .fileContains("Constructor with only readonly parameters and all parameters"); + + JavaFileAssert.assertThat(files.get("PageOfPets.java")) + .assertConstructor("Integer") + .hasParameter("count").toConstructor() + .toFileAssert() + .assertConstructor("Integer", "List") + .hasParameter("count").toConstructor() + .hasParameter("_list").toConstructor(); + } + + @Test + public void generateAllArgsConstructor_REFACTOR_ALLOF_WITH_PROPERTIES_ONLY() { + // try the generation with some additional OpenAPINormalizers + + Map files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", JavaClientCodegen.RESTTEMPLATE, + Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE), + codegenConfigurator -> codegenConfigurator.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true")); + JavaFileAssert.assertThat(files.get("Pet.java")) + .fileContains("protected String name", "protected String type") + .assertConstructor("String") + .hasParameter("type").toConstructor() + .toFileAssert() + .assertConstructor("LocalDate", "String", "String") + .hasParameter("dateOfBirth").toConstructor() + .hasParameter("name").toConstructor() + .hasParameter("type").toConstructor(); + + JavaFileAssert.assertThat(files.get("PageOfPets.java")) + .assertConstructor("Integer", "List") + .hasParameter("count").toConstructor() + .hasParameter("_list").toConstructor() + .toFileAssert() + .assertConstructor("Integer") + .hasParameter("count").toConstructor(); + + JavaFileAssert.assertThat(files.get("Cat.java")) + .assertConstructor("Integer", "String", "LocalDate", "String", "String"); + } + + @Test + public void testRestClientFormMultipart() throws IOException { + + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + validateJavaSourceFiles(files); + + Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); + TestUtils.assertFileContains( + defaultApi, + // multiple files + "multipartArray(List files)", + "formParams.addAll(\"files\"," + + " files.stream().map(FileSystemResource::new).collect(Collectors.toList()));", + + // mixed + "multipartMixed(MultipartMixedStatus status, File _file, MultipartMixedRequestMarker marker, List statusArray)", + "formParams.add(\"file\", new FileSystemResource(_file));", + + // single file + "multipartSingle(File _file)", + "formParams.add(\"file\", new FileSystemResource(_file));"); + } + + @Test + public void testRestClientWithUseAbstractionForFiles() throws IOException { + + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + validateJavaSourceFiles(files); + + Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); + TestUtils.assertFileContains( + defaultApi, + // multiple files + "multipartArray(java.util.Collection files)", + "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", + + // mixed + "multipartMixed(MultipartMixedStatus status, org.springframework.core.io.AbstractResource _file, MultipartMixedRequestMarker marker, List statusArray)", + "formParams.add(\"file\", _file);", + + // single file + "multipartSingle(org.springframework.core.io.AbstractResource _file)", + "formParams.add(\"file\", _file);"); + } + + @Test + public void testRestClientWithFreeFormInQueryParameters() throws IOException { + final Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + + final File output = Files.createTempDirectory("test") + .toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator().setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/issue8352.yaml") + .setOutputDir(output.getAbsolutePath() + .replace("\\", "/")); + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(configurator.toClientOptInput()) + .generate(); + files.forEach(File::deleteOnExit); + + validateJavaSourceFiles(files); + + final Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/ApiClient.java"); + TestUtils.assertFileContains(defaultApi, "value instanceof Map"); + } + + @Test + public void testRestClientJsonCreatorWithNullable_issue12790() throws Exception { + Map properties = new HashMap<>(); + properties.put(AbstractJavaCodegen.OPENAPI_NULLABLE, "true"); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setAdditionalProperties(properties) + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setInputSpec("src/test/resources/bugs/issue_12790.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + Map files = generator.opts(clientOptInput).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + JavaFileAssert.assertThat(files.get("TestObject.java")) + .printFileContent() + .assertConstructor("String", "String") + .bodyContainsLines( + "this.nullableProperty = nullableProperty == null ? JsonNullable.undefined() :" + + " JsonNullable.of(nullableProperty);", + "this.notNullableProperty = notNullableProperty;"); + } + + @Test + public void testRestClientSupportListOfStringReturnType_issue7118() throws IOException { + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/bugs/issue_7118.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + validateJavaSourceFiles(files); + + Path userApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/UsersApi.java"); + TestUtils.assertFileContains( + userApi, + // set of string + "ParameterizedTypeReference> localVarReturnType = new" + + " ParameterizedTypeReference<>() {};", + "getUserIdSetRequestCreation().toEntity(localVarReturnType)", + // list of string + "ParameterizedTypeReference> localVarReturnType = new" + + " ParameterizedTypeReference<>() {};", + "getUserIdListRequestCreation().toEntity(localVarReturnType)"); + } + + @Test + public void testRestClientResponseTypeWithUseAbstractionForFiles_issue16589() throws IOException { + Map properties = new HashMap<>(); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.RESTCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/issue13146_file_abstraction_response.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + validateJavaSourceFiles(files); + + Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/ResourceApi.java"); + + TestUtils.assertFileContains(defaultApi, + "org.springframework.core.io.Resource resourceInResponse()", + "ResponseEntity resourceInResponseWithHttpInfo()", + "ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>()" + ); + } + + @Test + void testBuilderJavaClient() throws IOException { + Map files = generateFromContract("src/test/resources/3_0/java/builder.yaml", JavaClientCodegen.RESTTEMPLATE, + Map.of(AbstractJavaCodegen.GENERATE_BUILDERS, Boolean.TRUE)); + JavaFileAssert.assertThat(files.get("Pet.java")) + .fileContains("protected String petReadonlyProperty", + "toBuilder()", + "builder()", + "public static class Builder {"); + JavaFileAssert.assertThat(files.get("Snake.java")) + .fileContains("toBuilder()", + "builder()", + "public static class Builder extends Reptile.Builder {", + ".petType(getPetType())", + ".name(getName())", + "hasLegs(getHasLegs())"); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java index 2c6197e8dcc..b3bcd53ef60 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientDeepObjectTest.java @@ -59,6 +59,6 @@ public class JavaClientDeepObjectTest { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/DefaultApi.java"), "options.toUrlQueryString(\"options\")", - "inputOptions.toUrlQueryString(\"inputOptions\"))"); + "inputOptions.toUrlQueryString(\"inputOptions\")"); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java index 9d55893acd6..2fbe08939c9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaInheritanceTest.java @@ -37,7 +37,6 @@ import org.testng.annotations.Test; public class JavaInheritanceTest { - @Test(description = "convert a composed model with parent") public void javaInheritanceTest() { final Schema parentModel = new Schema().name("Base"); @@ -181,4 +180,32 @@ public class JavaInheritanceTest { Assert.assertFalse(propertyCD.required); Assert.assertEquals(cm.requiredVars.size() + cm.optionalVars.size(), cm.allVars.size()); } + + @Test(description = "convert a composed model with parent with custom schema param") + public void javaInheritanceWithCustomSchemaTest() { + Schema custom = new Schema() + .name("Custom") + .addProperty("value", new StringSchema()); + Schema parentModel = new Schema() + .name("Base") + .addProperty("customProperty", new Schema().type("custom")); + Schema schema = new ComposedSchema() + .name("Composed") + .addAllOfItem(new Schema().$ref("Base")); + + OpenAPI openAPI = TestUtils.createOpenAPI(); + openAPI.setComponents(new Components() + .addSchemas(custom.getName(), custom) + .addSchemas(parentModel.getName(), parentModel) + .addSchemas(schema.getName(), schema) + ); + + JavaClientCodegen codegen = new JavaClientCodegen(); + codegen.setOpenAPI(openAPI); + codegen.schemaMapping() + .put("custom", custom.getName()); + CodegenModel model = codegen.fromModel("sample", schema); + + Assert.assertTrue(model.imports.contains(custom.getName())); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java index f3cc4a4c490..b784b642ac0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java @@ -1,6 +1,6 @@ /* - * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright (c) 2022 Oracle and/or its affiliates. + * Copyright 2022, 2024 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,12 +44,12 @@ public class JavaHelidonCommonCodegenPackagePrefixTest { private static final String EXCEPTION_MESSAGE_FRAGMENT = "namespace but options specified"; // The generated SE client does not depend on the jakarta/javax imports, so no need to test it. - private static final List> GENERATOR_LIBRARY_PAIRS = new ArrayList>() { - { - add(listOf("java-helidon-client", "mp")); - add(listOf("java-helidon-server", "se")); - add(listOf("java-helidon-server", "mp")); - } + private static final List> GENERATOR_LIBRARY_PAIRS = new ArrayList<>() { + { + add(listOf("java-helidon-client", "mp")); + add(listOf("java-helidon-server", "se")); + add(listOf("java-helidon-server", "mp")); + } }; private String outputDir; @@ -76,12 +76,27 @@ public class JavaHelidonCommonCodegenPackagePrefixTest { String explicitPrefix, String generatorName, String libraryName) { - IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class, + IllegalArgumentException e = Assert.assertThrows("Run invalid combo: " + assertMsg(explicitHelidonVersion, + explicitPrefix, + generatorName, + libraryName), + IllegalArgumentException.class, () -> runTest(explicitHelidonVersion, explicitPrefix, generatorName, libraryName)); - Assert.assertTrue("Exception message '" + e.getMessage() + "' contains '" + EXCEPTION_MESSAGE_FRAGMENT + "'", + Assert.assertTrue("Exception message for " + assertMsg(explicitHelidonVersion, + explicitPrefix, + generatorName, + libraryName) + + "'" + e.getMessage() + "' containing '" + EXCEPTION_MESSAGE_FRAGMENT + "'", e.getMessage().contains(EXCEPTION_MESSAGE_FRAGMENT)); } + private static String assertMsg(String explicitHelidonVersion, String explicitPrefix, String generatorName, String libraryName) { + return "Explicit version: " + (explicitHelidonVersion == null ? "null" : explicitHelidonVersion) + + ", explicit prefix: " + (explicitPrefix == null ? "null" : explicitPrefix) + + ", generatorName: " + generatorName + + ", libraryName: " + libraryName; + } + @DataProvider(name = "valid") public Object [][] createValidData() { Object [][] settingsForEachRun = new Object[][] { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java index c92b404c09d..7a11ae416e9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java @@ -1,6 +1,6 @@ /* - * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright (c) 2022 Oracle and/or its affiliates + * Copyright 2022, 2024 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022, 2024 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,76 +31,113 @@ import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.languages.JavaHelidonCommonCodegen; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class JavaHelidonCommonCodegenTest { - private DefaultGenerator generator; - private CodegenConfigurator configurator; - private String outputDir; + private DefaultGenerator mpServerGenerator; + private DefaultGenerator mpClientGenerator; + private CodegenConfigurator mpServerConfigurator; + private CodegenConfigurator mpClientConfigurator; + private String mpServerOutputDir; + private String mpClientOutputDir; @BeforeMethod public void setup() throws IOException { - File output = Files.createTempDirectory("test").toFile(); - output.deleteOnExit(); - outputDir = output.getAbsolutePath().replace('\\', '/'); + File mpServerOutput = Files.createTempDirectory("testMpServer").toFile(); + mpServerOutput.deleteOnExit(); + mpServerOutputDir = mpServerOutput.getAbsolutePath().replace('\\', '/'); - configurator = new CodegenConfigurator() + File mpClientOutput = Files.createTempDirectory("testMpClient").toFile(); + mpClientOutputDir = mpClientOutput.getAbsolutePath().replace('\\', '/'); + + mpServerConfigurator = new CodegenConfigurator() .setGeneratorName("java-helidon-server") .setLibrary("mp") .setInputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml") - .setOutputDir(outputDir); + .setOutputDir(mpServerOutputDir); - generator = new DefaultGenerator(); + mpClientConfigurator = new CodegenConfigurator() + .setGeneratorName("java-helidon-client") + .setLibrary("mp") + .setInputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml") + .setOutputDir(mpClientOutputDir); + + + mpServerGenerator = new DefaultGenerator(); + mpClientGenerator = new DefaultGenerator(); } @Test public void defaultVersionTest() { - runVersionTest(null, null); + runServerVersionTest(null, null); } @Test public void customHelidonVersionOnlyTest() { - runVersionTest("3.0.0", null); + runServerVersionTest("3.0.0", null); + } + + @Test + void customHelidonMajorVersionOnlyTest() { + runServerVersionTest("3", null); } @Test public void customParentVersionOnlyTest() { - runVersionTest(null, "3.0.0"); + runServerVersionTest(null, "3.0.0"); } @Test public void bothEqualsVersionTest() { - runVersionTest("3.0.0", "3.0.0"); + runServerVersionTest("3.0.0", "3.0.0"); } @Test public void bothNotEqualsVersionTest() { - IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class,() -> runVersionTest("1.0.0", "2.0.0")); + IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class,() -> runServerVersionTest("1.0.0", "2.0.0")); Assert.assertEquals( "Both parentVersion and helidonVersion properties were set with different value.", e.getMessage()); } - private void runVersionTest(String helidonVersion, String parentVersion) { + @Test + void customHelidonVersionOnlyClientTest() { + runClientVersionTest("4", null); + } + + private void runServerVersionTest(String helidonVersion, String parentVersion) { + runVersionTest(helidonVersion, parentVersion, mpServerGenerator, mpServerConfigurator, mpServerOutputDir); + } + + private void runClientVersionTest(String helidonVersion, String parentVersion) { + runVersionTest(helidonVersion, parentVersion, mpClientGenerator, mpClientConfigurator, mpClientOutputDir); + } + + private void runVersionTest(String helidonVersion, + String parentVersion, + DefaultGenerator generator, + CodegenConfigurator configurator, + String outputDir) { Map additionalProperties = new HashMap<>(); - String expected = "3.0.1"; + String expected = JavaHelidonCommonCodegen.defaultHelidonVersion(); if (parentVersion != null) { additionalProperties.put(CodegenConstants.PARENT_VERSION, parentVersion); - expected = parentVersion; + expected = JavaHelidonCommonCodegen.chooseVersion(parentVersion); } if (helidonVersion != null) { additionalProperties.put("helidonVersion", helidonVersion); - expected = helidonVersion; + expected = JavaHelidonCommonCodegen.chooseVersion(helidonVersion); } generator.opts(configurator.setAdditionalProperties(additionalProperties) - .toClientOptInput()); + .toClientOptInput()); List files = generator.generate(); TestUtils.ensureContainsFile(files, Paths.get(outputDir).toFile(), "pom.xml"); TestUtils.assertFileContains(Paths.get(outputDir + "/pom.xml"), - String.format(Locale.ROOT, "%s", expected)); + String.format(Locale.ROOT, "%s", expected)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java index c11931e8a4f..d63754a2747 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java @@ -808,6 +808,103 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest { ); } + @Test + public void generateApiForQuarkusWithoutMutiny() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_4832.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary(QUARKUS_LIBRARY); + codegen.additionalProperties().put(SUPPORT_ASYNC, true); + codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in PingApi.java + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //Using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated class contains CompletionStage + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java"); + TestUtils.assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"), + "CompletionStage pingGetBoolean", //Support primitive types response + "CompletionStage pingGetInteger" //Support primitive types response + ); + } + + @Test + public void generateApiForQuarkusWithMutinyApi() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_4832.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary(QUARKUS_LIBRARY); + codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in PingApi.java + codegen.additionalProperties().put(SUPPORT_ASYNC, true); + codegen.additionalProperties().put(INTERFACE_ONLY, true); + codegen.additionalProperties().put(USE_MUTINY, true); + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //Using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated class contains CompletionStage + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java"); + TestUtils.assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"), + "Uni pingGetBoolean", //Support primitive types response + "Uni pingGetInteger" //Support primitive types response + ); + } + + + @Test + public void generateApiForQuarkusWithMutinyImpl() throws Exception { + final File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/issue_4832.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary(QUARKUS_LIBRARY); + codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in PingApi.java + codegen.additionalProperties().put(SUPPORT_ASYNC, true); + codegen.additionalProperties().put(USE_MUTINY, true); + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //Using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated class contains CompletionStage + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PingApi.java"); + TestUtils.assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PingApi.java"), + "Uni pingGetBoolean", //Support primitive types response + "Uni pingGetInteger" //Support primitive types response + ); + } + @Test public void testHandleRequiredAndReadOnlyPropertiesCorrectly() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index d2249db3983..48fef733c94 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -21,6 +21,8 @@ import static java.util.stream.Collectors.groupingBy; import static org.assertj.core.api.Assertions.assertThat; import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.assertFileNotContains; +import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_BUILDERS; +import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS; import static org.openapitools.codegen.languages.SpringCodegen.ASYNC; import static org.openapitools.codegen.languages.SpringCodegen.DELEGATE_PATTERN; import static org.openapitools.codegen.languages.SpringCodegen.DocumentationProvider; @@ -127,7 +129,7 @@ public class SpringCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) @@ -205,7 +207,7 @@ public class SpringCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) @@ -277,11 +279,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java")) @@ -321,11 +322,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); @@ -358,11 +358,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); @@ -387,11 +386,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ElephantsApi.java")) @@ -416,7 +414,7 @@ public class SpringCodegenTest { codegen.processOpts(); // jdk8 tag has been removed - Assert.assertEquals(codegen.additionalProperties().get("jdk8"), null); + Assert.assertNull(codegen.additionalProperties().get("jdk8")); } @Test(expectedExceptions = IllegalArgumentException.class) @@ -446,11 +444,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); @@ -484,11 +481,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); @@ -517,6 +513,8 @@ public class SpringCodegenTest { final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(clientOptInput).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -548,7 +546,6 @@ public class SpringCodegenTest { additionalProperties.put(CodegenConstants.MODEL_TESTS, "false"); additionalProperties.put(CodegenConstants.MODEL_DOCS, "false"); additionalProperties.put(CodegenConstants.APIS, "true"); - additionalProperties.put(CodegenConstants.SUPPORTING_FILES, "false"); Map files = generateFromContract("src/test/resources/3_0/petstore.yaml", SPRING_BOOT, additionalProperties); @@ -584,7 +581,7 @@ public class SpringCodegenTest { codegen.preprocessOpenAPI(openAPI); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + Assert.assertTrue(codegen.isHideGenerationTimestamp()); Assert.assertEquals(codegen.modelPackage(), "xyz.yyyyy.mmmmm.model"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xyz.yyyyy.mmmmm.model"); Assert.assertEquals(codegen.apiPackage(), "xyz.yyyyy.aaaaa.api"); @@ -658,22 +655,19 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGenerateMetadata(false); generator.opts(input).generate(); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java")) + .fileContains("@RequestBody(required = false") .assertMethod("exampleApiPost", "ExampleApiPostRequest") .hasParameter("exampleApiPostRequest") .assertParameterAnnotations() .containsWithNameAndAttributes("RequestBody", ImmutableMap.of("required", "false")); - - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java"), - "@RequestBody(required = false"); } @Test @@ -687,7 +681,7 @@ public class SpringCodegenTest { codegen.preprocessOpenAPI(openAPI); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + Assert.assertFalse(codegen.isHideGenerationTimestamp()); Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); @@ -812,6 +806,7 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -836,6 +831,7 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary(SPRING_CLOUD_LIBRARY); codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.model"); codegen.additionalProperties().put(CodegenConstants.API_NAME_SUFFIX, "Controller"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); @@ -847,6 +843,7 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -855,8 +852,8 @@ public class SpringCodegenTest { File notExisting = files.get("PetApi.java"); assertThat(notExisting).isNull(); - } + @Test public void shouldUseTagsForClassname() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -867,6 +864,7 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary(SPRING_CLOUD_LIBRARY); codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(USE_TAGS, "true"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); @@ -878,6 +876,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); + Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -886,7 +886,6 @@ public class SpringCodegenTest { File notExisting = files.get("PetApi.java"); assertThat(notExisting).isNull(); - } @Test @@ -899,18 +898,19 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary(SPRING_CLOUD_LIBRARY); codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(USE_TAGS, "false"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -941,6 +941,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -999,6 +1001,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -1085,6 +1089,7 @@ public class SpringCodegenTest { input.config(codegen); final DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation List files = generator.opts(input).generate(); return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); @@ -1176,7 +1181,7 @@ public class SpringCodegenTest { codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); - Assert.assertEquals(codegen.isHideGenerationTimestamp(), true); + Assert.assertTrue(codegen.isHideGenerationTimestamp()); Assert.assertEquals(codegen.modelPackage(), "xx.yyyyyyyy.model"); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "xx.yyyyyyyy.model"); Assert.assertEquals(codegen.apiPackage(), "xx.yyyyyyyy.api"); @@ -1187,7 +1192,7 @@ public class SpringCodegenTest { Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "xx.yyyyyyyy.base"); Assert.assertEquals(codegen.getConfigPackage(), "xx.yyyyyyyy.config"); Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "xx.yyyyyyyy.config"); - Assert.assertEquals(codegen.isUnhandledException(), true); + Assert.assertTrue(codegen.isUnhandledException()); Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), true); } @@ -1215,11 +1220,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true"); + generator.setGenerateMetadata(false); // skip metadata generation generator.opts(input).generate(); @@ -1245,26 +1249,26 @@ public class SpringCodegenTest { } @Test - public void useBeanValidationTruePerformBeanValidationFalseJava8TrueForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, false, true, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); + public void useBeanValidationTruePerformBeanValidationFalseForFormatEmail() throws IOException { + beanValidationForFormatEmail(true, false, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); } @Test - public void useBeanValidationTruePerformBeanValidationTrueJava8FalseForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, true, false, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); + public void useBeanValidationTruePerformBeanValidationTrueForFormatEmail() throws IOException { + beanValidationForFormatEmail(true, true, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); } @Test - public void useBeanValidationTruePerformBeanValidationFalseJava8TrueJakartaeeTrueForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, false, true, true,"@jakarta.validation.constraints.Email", "@javax.validation.constraints.Email"); + public void useBeanValidationTruePerformBeanValidationFalseJakartaeeTrueForFormatEmail() throws IOException { + beanValidationForFormatEmail(true, false, true,"@jakarta.validation.constraints.Email", "@javax.validation.constraints.Email"); } // note: java8 option/mustache tag has been removed and default to true - private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean java8, String contains, String notContains) throws IOException { - this.beanValidationForFormatEmail(useBeanValidation, performBeanValidation, java8, false, contains, notContains); + private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, String contains, String notContains) throws IOException { + this.beanValidationForFormatEmail(useBeanValidation, performBeanValidation, false, contains, notContains); } - private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean java8, boolean useJakarta, String contains, String notContains) throws IOException { + private void beanValidationForFormatEmail(boolean useBeanValidation, boolean performBeanValidation, boolean useJakarta, String contains, String notContains) throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); String outputPath = output.getAbsolutePath().replace('\\', '/'); @@ -1283,12 +1287,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -1296,13 +1298,9 @@ public class SpringCodegenTest { JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java")); if (useBeanValidation) javaFileAssert.hasImports((useJakarta? "jakarta" : "javax") + ".validation.constraints"); if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java"), contains); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java"), notContains); - } - - @Test - public void useBeanValidationTruePerformBeanValidationTrueJava8TrueForFormatEmail() throws IOException { - beanValidationForFormatEmail(true, true, true, "@javax.validation.constraints.Email", "@org.hibernate.validator.constraints.Email"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java")) + .fileContains(contains) + .fileDoesNotContains(notContains); } @Test @@ -1324,19 +1322,19 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate API files generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApi.java"), "Mono>"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java"), "Mono>"); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApi.java"), "Mono"); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java"), "Mono"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApi.java")) + .fileContains("Mono>") + .fileDoesNotContains("Mono"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SomeApiDelegate.java")) + .fileContains("Mono>") + .fileDoesNotContains("Mono"); } @Test @@ -1346,10 +1344,7 @@ public class SpringCodegenTest { additionalProperties.put(SpringCodegen.REACTIVE, "true"); additionalProperties.put(SpringCodegen.USE_RESPONSE_ENTITY, "false"); additionalProperties.put(SpringCodegen.USE_SPRING_BOOT3, "true"); - additionalProperties.put(CodegenConstants.MODEL_TESTS, "false"); - additionalProperties.put(CodegenConstants.MODEL_DOCS, "false"); additionalProperties.put(CodegenConstants.APIS, "true"); - additionalProperties.put(CodegenConstants.SUPPORTING_FILES, "false"); Map files = generateFromContract("src/test/resources/3_0/petstore.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert @@ -1406,6 +1401,7 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -1437,6 +1433,7 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -1469,6 +1466,7 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -1511,23 +1509,21 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate API generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java"), "allowableValues = \"0, 1\""); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java"), "@PathVariable"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java"), "allowableValues = \"sleeping, awake\""); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java"), "@PathVariable"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java"), "allowableValues = \"sleeping, awake\""); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java"), "@PathVariable"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GiraffesApi.java"), "allowableValues = \"0, 1\""); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GiraffesApi.java"), "@PathVariable"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java")) + .fileContains( "allowableValues = \"0, 1\"", "@PathVariable"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java")) + .fileContains( "allowableValues = \"sleeping, awake\"", "@PathVariable"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java")) + .fileContains( "allowableValues = \"sleeping, awake\"", "@PathVariable"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GiraffesApi.java")) + .fileContains( "allowableValues = \"0, 1\"", "@PathVariable"); } @Test @@ -1549,12 +1545,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate API generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -1636,19 +1630,15 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "status"); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "@NotNull"); - Files.readAllLines(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")).forEach(System.out::println); - + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")) + .fileContains( "status", "@NotNull"); } @Test @@ -1667,19 +1657,16 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "status"); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java"), "@NotNull"); - Files.readAllLines(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")).forEach(System.out::println); - + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Dummy.java")) + .fileContains( "status") + .fileDoesNotContains("@NotNull"); } @Test @@ -1701,17 +1688,14 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); codegen.setHateoas(true); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - //generator.setGeneratorPropertyDefault(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - - codegen.setUseOneOfInterfaces(true); - codegen.setLegacyDiscriminatorBehavior(false); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); + + codegen.setUseOneOfInterfaces(true); + codegen.setLegacyDiscriminatorBehavior(false); generator.opts(input).generate(); @@ -1739,26 +1723,23 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); codegen.setHateoas(true); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - //generator.setGeneratorPropertyDefault(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(input).generate(); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Foo.java"), "public class Foo extends Entity implements FooRefOrValue"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/FooRef.java"), "public class FooRef extends EntityRef implements FooRefOrValue"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/FooRefOrValue.java"), "public interface FooRefOrValue"); // previous bugs - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/BarRef.java"), "atTypesuper.hashCode"); - assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/BarRef.java"), "private String atBaseType"); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/BarRef.java")) + .fileDoesNotContains( "atTypesuper.hashCode", "private String atBaseType"); // imports for inherited properties assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PizzaSpeziale.java"), "import java.math.BigDecimal"); } @@ -1782,6 +1763,9 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); codegen.setHateoas(true); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); @@ -1791,11 +1775,6 @@ public class SpringCodegenTest { codegen.setUseSpringBoot3(true); codegen.setModelNameSuffix("DTO"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(input).generate(); assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/ChildWithMappingADTO.java"), "@JsonTypeName"); @@ -1821,7 +1800,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); codegen.setHateoas(true); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); @@ -1830,11 +1812,6 @@ public class SpringCodegenTest { codegen.setUseSpringBoot3(true); codegen.setModelNameSuffix("DTO"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(input).generate(); @@ -1861,18 +1838,15 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); codegen.setHateoas(true); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - //generator.setGeneratorPropertyDefault(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); - generator.opts(input).generate(); assertFileContains( @@ -1925,12 +1899,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate API generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -1986,12 +1958,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Address.java"), @@ -2016,12 +1986,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); File[] generatedModels = new File(outputPath + "/src/main/java/org/openapitools/model").listFiles(); @@ -2054,11 +2022,10 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate API generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2154,12 +2121,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); TestUtils.assertExtraAnnotationFiles(outputPath + "/src/main/java/org/openapitools/model"); @@ -2413,6 +2378,7 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary(SPRING_BOOT); codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); codegen.additionalProperties().put(BeanValidationFeatures.USE_BEANVALIDATION, "true"); @@ -2421,6 +2387,9 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGenerateMetadata(false); + Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2461,7 +2430,6 @@ public class SpringCodegenTest { codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); - DefaultGenerator generator = new DefaultGenerator(); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); //Assert that NotNull annotation exists alone with no other BeanValidation annotations @@ -2492,7 +2460,6 @@ public class SpringCodegenTest { codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, "PascalCase"); codegen.additionalProperties().put(SpringCodegen.USE_TAGS, "true"); - DefaultGenerator generator = new DefaultGenerator(); Map files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml"); //Assert that NotNull annotation exists alone with no other BeanValidation annotations @@ -2595,6 +2562,11 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2625,6 +2597,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2633,7 +2607,6 @@ public class SpringCodegenTest { .bodyContainsLines("return Arrays.equals(this.picture, testObject.picture);"); } - @Test public void useBeanValidationGenerateAnnotationsForRequestBody_issue13932() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -2654,6 +2627,7 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2687,6 +2661,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2732,6 +2708,8 @@ public class SpringCodegenTest { final ClientOptInput clientOptInput = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); + Map files = generator.opts(clientOptInput).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2741,7 +2719,9 @@ public class SpringCodegenTest { @Test public void shouldUseTheSameTagNameForTheInterfaceAndTheMethod_issue11570() throws IOException { - final Map output = generateFromContract("src/test/resources/bugs/issue_11570.yml", SPRING_BOOT); + final Map output = generateFromContract( + "src/test/resources/bugs/issue_11570.yml", SPRING_BOOT, Map.of(INTERFACE_ONLY, "true") + ); final String expectedTagName = "\"personTagWithExclamation!\""; final String expectedTagDescription = "\"the personTagWithExclamation! API\""; @@ -2753,7 +2733,11 @@ public class SpringCodegenTest { @Test public void shouldGenerateConstructorWithOnlyRequiredParameters() throws IOException { - final Map output = generateFromContract("src/test/resources/3_0/spring/issue_9789.yml", SPRING_BOOT); + final Map output = generateFromContract( + "src/test/resources/3_0/spring/issue_9789.yml", + SPRING_BOOT, + Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "false") + ); JavaFileAssert.assertThat(output.get("ObjectWithNoRequiredParameter.java")).assertNoConstructor("String"); @@ -2773,25 +2757,36 @@ public class SpringCodegenTest { private Map generateFromContract(String url, String library) throws IOException { return generateFromContract(url, library, new HashMap<>()); } + private Map generateFromContract(String url, String library, Map additionalProperties) throws IOException { + return generateFromContract(url, library, additionalProperties, codegen -> {}); + } + + /** + * Generate the contract with additional configuration. + * + * use CodegenConfigurator instead of CodegenConfig for easier configuration like in JavaClientCodeGenTest + */ + private Map generateFromContract(String url, String library, Map additionalProperties, + Consumer consumer) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); - OpenAPI openAPI = new OpenAPIParser() - .readLocation(url, null, new ParseOptions()).getOpenAPI(); - - SpringCodegen codegen = new SpringCodegen(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("spring") + .setAdditionalProperties(additionalProperties) + .setValidateSpec(false) + .setInputSpec(url) + .setOutputDir(output.getAbsolutePath()); if (null != library) { - codegen.setLibrary(library); + configurator.setLibrary(library); } - codegen.setOutputDir(output.getAbsolutePath()); - codegen.additionalProperties().putAll(additionalProperties); - - ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + consumer.accept(configurator); + ClientOptInput input = configurator.toClientOptInput(); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); return generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2809,23 +2804,20 @@ public class SpringCodegenTest { codegen.setOutputDir(output.getAbsolutePath()); codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); codegen.setUseOneOfInterfaces(true); + codegen.setHateoas(true); + codegen.setUseOneOfInterfaces(true); + codegen.setLegacyDiscriminatorBehavior(false); ClientOptInput input = new ClientOptInput(); input.openAPI(openAPI); input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - codegen.setHateoas(true); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - - codegen.setUseOneOfInterfaces(true); - codegen.setLegacyDiscriminatorBehavior(false); - + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); generator.opts(input).generate(); @@ -2852,6 +2844,8 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2917,6 +2911,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -2960,6 +2956,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3005,6 +3003,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3042,6 +3042,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3079,6 +3081,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3115,6 +3119,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3149,6 +3155,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3190,6 +3198,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3221,6 +3231,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3231,7 +3243,6 @@ public class SpringCodegenTest { .bodyContainsLines("if (b.value.equals(value)) {"); } - @Test public void testHasOperationExtraAnnotation_issue15822() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -3254,6 +3265,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3287,6 +3300,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3322,6 +3337,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata generation + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -3355,11 +3372,10 @@ public class SpringCodegenTest { DefaultGenerator generator = new DefaultGenerator(); - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); // skip metadata generation generator.opts(input).generate(); @@ -3393,8 +3409,6 @@ public class SpringCodegenTest { .assertNoMethod("setAlias"); } - - @Test public void testModelsWithNoneOptionalAndJsonNullable() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -3419,8 +3433,6 @@ public class SpringCodegenTest { generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -3633,12 +3645,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -3851,12 +3861,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -4088,12 +4096,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); - generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); @@ -4376,6 +4382,7 @@ public class SpringCodegenTest { public void multiLineOperationDescription() throws IOException { Map additionalProperties = new HashMap<>(); additionalProperties.put(SpringCodegen.USE_TAGS, "true"); + additionalProperties.put(INTERFACE_ONLY, "true"); additionalProperties.put(DOCUMENTATION_PROVIDER, DocumentationProvider.SPRINGDOC.name()); Map files = generateFromContract("src/test/resources/3_0/spring/issue12474-multiline-description.yaml", SPRING_BOOT, additionalProperties); @@ -4389,6 +4396,7 @@ public class SpringCodegenTest { public void multiLineTagDescription() throws IOException { Map additionalProperties = new HashMap<>(); additionalProperties.put(SpringCodegen.USE_TAGS, "true"); + additionalProperties.put(INTERFACE_ONLY, "true"); additionalProperties.put(DOCUMENTATION_PROVIDER, DocumentationProvider.SPRINGDOC.name()); Map files = generateFromContract("src/test/resources/3_0/spring/issue12474-multiline-description.yaml", SPRING_BOOT, additionalProperties); @@ -4418,6 +4426,8 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); + generator.setGenerateMetadata(false); Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -4468,7 +4478,7 @@ public class SpringCodegenTest { final SpringCodegen codegen = new SpringCodegen(); codegen.setOpenAPI(openAPI); codegen.setOutputDir(output.getAbsolutePath()); - + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true"); ClientOptInput input = new ClientOptInput(); @@ -4476,12 +4486,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -4497,6 +4505,7 @@ public class SpringCodegenTest { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/petstore-with-tags.yaml"); final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.setOpenAPI(openAPI); codegen.setOutputDir(output.getAbsolutePath()); @@ -4505,12 +4514,10 @@ public class SpringCodegenTest { input.config(codegen); DefaultGenerator generator = new DefaultGenerator(); - - generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false"); + generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true"); - generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); generator.opts(input).generate(); @@ -4518,9 +4525,40 @@ public class SpringCodegenTest { "@Valid @RequestParam(value = \"additionalMetadata\", required = false) String additionalMetadata"); } + @Test + public void testAllArgsConstructor_16797() throws IOException { + final Map output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT, + Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE, INTERFACE_ONLY, "true"), + codegen -> codegen.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "false")); + JavaFileAssert.assertThat(output.get("Object4.java")) + .assertConstructor("String", "Type1", "String", "String", "Boolean") + .hasParameter("responseType").toConstructor() + .hasParameter("requestId").toConstructor() + .hasParameter("success").toConstructor() + .hasParameter("pageInfo") + ; + + } + + @Test + public void testAllArgsConstructor_16797_REFACTOR_ALLOF_WITH_PROPERTIES_ONLY() throws IOException { + final Map output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT, + Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE, INTERFACE_ONLY, "true"), + codegen -> codegen.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true")); + JavaFileAssert.assertThat(output.get("Object4.java")) + .assertConstructor("String", "Type1", "String", "String", "Boolean") + .hasParameter("responseType").toConstructor() + .hasParameter("requestId").toConstructor() + .hasParameter("success").toConstructor() + .hasParameter("pageInfo") + ; + } + @Test public void testMultiInheritanceParentRequiredParams_issue16797() throws IOException { - final Map output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT); + final Map output = generateFromContract( + "src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT, Map.of(INTERFACE_ONLY, "true") + ); // constructor should as // public Object4(Type1 pageInfo, String responseType, String requestId, Boolean success) { // super(responseType, requestId, success, pageInfo); @@ -4536,7 +4574,9 @@ public class SpringCodegenTest { @Test public void testMultiInheritanceParentRequiredParams_issue15796() throws IOException { - final Map output = generateFromContract("src/test/resources/3_0/spring/issue_15796.yaml", SPRING_BOOT); + final Map output = generateFromContract( + "src/test/resources/3_0/spring/issue_15796.yaml", SPRING_BOOT, Map.of(INTERFACE_ONLY, "true") + ); // constructor should as this //public Poodle(String race, String type) { // super(race, type); @@ -4548,10 +4588,82 @@ public class SpringCodegenTest { ; } + @Test + public void testAllArgsConstructor_defaultOrder_15796() throws IOException { + final Map output = generateFromContract("src/test/resources/3_0/spring/issue_15796.yaml", SPRING_BOOT, + Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE, INTERFACE_ONLY, "true"), + config -> config.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true")); + // constructors should as this + //public Poodle(String race, String type) { + // super(race, type); + //} + // and + //public Poodle(String hairType, Integer tails, String race, String name, String type) { + // super(tails, race, name, type); + // this.hairType = hairType; + //} + JavaFileAssert.assertThat(output.get("Poodle.java")) + .assertConstructor("String", "String") + .hasParameter("type").toConstructor() + .hasParameter("race").toConstructor() + .toFileAssert() + .assertConstructor("String", "Integer", "String", "String", "String") + .hasParameter("tails").toConstructor() + .hasParameter("race").toConstructor() + .hasParameter("name").toConstructor() + .hasParameter("type").toConstructor() + .hasParameter("hairType").toConstructor() + ; + } + + @Test + public void generateAllArgsConstructor() throws IOException { + Map files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", null, + Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE, INTERFACE_ONLY, "true"), + codegenConfig -> codegenConfig.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true")); + JavaFileAssert.assertThat(files.get("Pet.java")) + .assertConstructor("String") + .hasParameter("type").toConstructor() + .toFileAssert() + .assertConstructor("LocalDate", "String", "String") + .hasParameter("dateOfBirth").toConstructor() + .hasParameter("name").toConstructor() + .hasParameter("type").toConstructor(); + JavaFileAssert.assertThat(files.get("Cat.java")) + .assertConstructor("Integer", "String", "LocalDate", "String", "String"); + + // test required constructor + JavaFileAssert.assertThat(files.get("Page.java")) + .assertConstructor("Integer") + .toFileAssert() + .fileContains("Constructor with only required parameters and all parameters"); + + JavaFileAssert.assertThat(files.get("PageOfPets.java")) + .assertConstructor("Integer", "List") + .hasParameter("count").toConstructor() + .hasParameter("_list").toConstructor() + .toFileAssert() + .assertConstructor("Integer") + .hasParameter("count").toConstructor(); + } + + @Test + public void allOfDuplicatedProperties() throws IOException { + Map output = generateFromContract( + "src/test/resources/3_0/allOfDuplicatedProperties.yaml", + SPRING_BOOT, + Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, true, INTERFACE_ONLY, "true") + ); + + JavaFileAssert.assertThat(output.get("ModelC.java")) + .assertConstructor("String", "Integer", "Integer", "String", "String"); + } + @Test public void testLombokAnnotations() throws IOException { final Map additionalProperties = new HashMap<>(); additionalProperties.put(AbstractJavaCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "@lombok.Data;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"); + additionalProperties.put(INTERFACE_ONLY, "true"); Map output = generateFromContract("src/test/resources/3_0/petstore.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(output.get("Pet.java")) .assertNoConstructor() @@ -4592,6 +4704,64 @@ public class SpringCodegenTest { ; } + @Test + void testBuilderJavaSpring_noOptional() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/java/builder.yaml", + SPRING_BOOT, + Map.of( + GENERATE_BUILDERS, true, + SpringCodegen.OPENAPI_NULLABLE, false, + SpringCodegen.USE_OPTIONAL, false, + INTERFACE_ONLY, "true" + ) + ); + + JavaFileAssert.assertThat(files.get("Pet.java")) + .fileContains("toBuilder()", + "builder()", + "public static class Builder {"); + JavaFileAssert.assertThat(files.get("Snake.java")) + .fileContains("toBuilder()", + "builder()", + "public static class Builder extends Reptile.Builder {", + "return builder.copyOf(this);"); + JavaFileAssert.assertThat(files.get("SimpleObject.java")) + .fileContains("public SimpleObject.Builder additionalProperties(Map additionalProperties) {", + "SimpleObject.Builder nullableObject(String nullableObject) {", + "SimpleObject.Builder nb(BigDecimal nb) {") + .fileDoesNotContains("SimpleObject.Builder nullableObject(JsonNullable nullableObject) {"); + } + + @Test + void testBuilderJavaSpring_useOptional() throws IOException { + Map files = generateFromContract( + "src/test/resources/3_0/java/builder.yaml", + SPRING_BOOT, + Map.of( + GENERATE_BUILDERS, true, + SpringCodegen.OPENAPI_NULLABLE, true, + SpringCodegen.USE_OPTIONAL, true, + INTERFACE_ONLY, "true" + ) + ); + + JavaFileAssert.assertThat(files.get("Pet.java")) + .fileContains("toBuilder()", + "builder()", + "public static class Builder {"); + JavaFileAssert.assertThat(files.get("Snake.java")) + .fileContains("toBuilder()", + "builder()", + "public static class Builder extends Reptile.Builder {", + "return builder.copyOf(this);"); + JavaFileAssert.assertThat(files.get("SimpleObject.java")) + .fileContains("public SimpleObject.Builder additionalProperties(Map additionalProperties) {", + "SimpleObject.Builder nullableObject(String nullableObject) {", + "SimpleObject.Builder nullableObject(JsonNullable nullableObject) {", + "SimpleObject.Builder nb(BigDecimal nb) {"); + } + @Test public void optionalListShouldBeEmpty() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -4602,6 +4772,7 @@ public class SpringCodegenTest { SpringCodegen codegen = new SpringCodegen(); codegen.setLibrary(SPRING_CLOUD_LIBRARY); codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, "true"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.model"); codegen.additionalProperties().put(CodegenConstants.API_NAME_SUFFIX, "Controller"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); @@ -4613,6 +4784,9 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); @@ -4644,6 +4818,9 @@ public class SpringCodegenTest { .config(codegen); DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); // skip metadata and ↓ only generate models + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + Map files = generator.opts(input).generate().stream() .collect(Collectors.toMap(File::getName, Function.identity())); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/jetbrains/http/client/JetbrainsHttpClientClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/jetbrains/http/client/JetbrainsHttpClientClientCodegenTest.java index 6362f286dfd..dd283de1bee 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/jetbrains/http/client/JetbrainsHttpClientClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/jetbrains/http/client/JetbrainsHttpClientClientCodegenTest.java @@ -1,7 +1,7 @@ package org.openapitools.codegen.jetbrains.http.client; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.JetbrainsHttpClientClientCodegen; @@ -403,7 +403,7 @@ public class JetbrainsHttpClientClientCodegenTest { } @Test - @Ignore // For some reason this test fails during Docker image generation. Investigate one day. + @Disabled // For some reason this test fails during Docker image generation. Investigate one day. public void testBasicGenerationMultipleRequests() throws IOException { // Checking that each request example is present in the output file File output = Files.createTempDirectory("jetbrainstest_").toFile(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java new file mode 100644 index 00000000000..46c489b29a9 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2024 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openapitools.codegen.languages; + +import java.util.List; + +import org.junit.Assert; +import org.testng.annotations.Test; + +// This test class is in this package, not org.openapitools.codegen.java.helidon, so it can refer to elements of +// JavaHelidonCommonCodegen without making them public; package-private is sufficient and we don't want to expose those methods +// more broadly. +class HelidonCommonCodegenTest { + + @Test + void checkMajorVersionMatch() { + Assert.assertEquals("1.2.3", + JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1", + List.of("3.2.1", + "3.2.0", + "2.0.4", + "1.2.3", + "1.2.2", + "1.1.0"))); + } + + @Test + void checkExactMatch() { + Assert.assertEquals("1.2.2", + JavaHelidonCommonCodegen.VersionUtil.instance().chooseVersion("1.2.2", + List.of("3.2.1", + "3.2.0", + "2.0.4", + "1.2.3", + "1.2.2", + "1.1.0"))); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/n4js/N4jsClientCodegenOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/n4js/N4jsClientCodegenOptionsTest.java index b2e02054140..38659942983 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/n4js/N4jsClientCodegenOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/n4js/N4jsClientCodegenOptionsTest.java @@ -1,7 +1,7 @@ package org.openapitools.codegen.n4js; import static java.lang.Boolean.parseBoolean; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.openapitools.codegen.CodegenConstants.API_NAME_PREFIX; import static org.openapitools.codegen.CodegenConstants.API_PACKAGE; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index 60cb3529322..bcda220f432 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -64,6 +64,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioClientCodegen.DATE_LIBRARY, DartDioClientCodegen.DATE_LIBRARY_DEFAULT) .put(DartDioClientCodegen.FINAL_PROPERTIES, DartDioClientCodegen.FINAL_PROPERTIES_DEFAULT_VALUE) + .put(DartDioClientCodegen.EQUALITY_CHECK_METHOD, DartDioClientCodegen.EQUALITY_CHECK_METHOD_DEFAULT) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java index 830fd29a6c5..372e293f636 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java @@ -38,6 +38,7 @@ public class GoClientOptionsProvider implements OptionsProvider { public static final boolean USE_ONE_OF_DISCRIMINATOR_LOOKUP_VALUE = true; public static final boolean WITH_GO_MOD_VALUE = true; public static final boolean GENERATE_MARSHAL_JSON_VALUE = true; + public static final boolean GENERATE_UNMARSHAL_JSON_VALUE = true; @Override public String getLanguage() { @@ -60,6 +61,7 @@ public class GoClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, "true") .put(CodegenConstants.WITH_GO_MOD, "true") .put(CodegenConstants.GENERATE_MARSHAL_JSON, "true") + .put(CodegenConstants.GENERATE_UNMARSHAL_JSON, "true") .put("generateInterfaces", "true") .put("structPrefix", "true") .build(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index e07f01cc32d..b2f8f1e447b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -24,6 +24,9 @@ import org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen; import java.util.Map; +import static org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.CAMEL_CASE; +import static org.openapitools.codegen.languages.TypeScriptFetchClientCodegen.PASCAL_CASE; + public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String SORT_PARAMS_VALUE = "false"; public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; @@ -32,9 +35,9 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String IMPORT_FILE_EXTENSION_VALUE = ""; public static final Boolean NULL_SAFE_ADDITIONAL_PROPS_VALUE = false; public static final String ENUM_NAME_SUFFIX = "Enum"; - public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; - public static final String PARAM_NAMING_VALUE = "camelCase"; - public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; + public static final String MODEL_PROPERTY_NAMING_VALUE = CAMEL_CASE; + public static final String PARAM_NAMING_VALUE = CAMEL_CASE; + public static final String ENUM_PROPERTY_NAMING_VALUE = PASCAL_CASE; private static final String NMP_NAME = "npmName"; private static final String NMP_VERSION = "1.0.0"; private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; @@ -44,6 +47,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String SAGAS_AND_RECORDS = "false"; public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; public static final String STRING_ENUMS = "false"; + public static final String FILE_NAMING_VALUE = PASCAL_CASE; public static final String ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE = "false"; @Override @@ -74,6 +78,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { .put(TypeScriptFetchClientCodegen.WITHOUT_RUNTIME_CHECKS, WITHOUT_RUNTIME_CHECKS) .put(TypeScriptFetchClientCodegen.SAGAS_AND_RECORDS, SAGAS_AND_RECORDS) .put(TypeScriptFetchClientCodegen.IMPORT_FILE_EXTENSION_SWITCH, IMPORT_FILE_EXTENSION_VALUE) + .put(TypeScriptFetchClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java index d09fafce21d..8c89e824f24 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java @@ -48,6 +48,7 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { public static String MODEL_FILE_SUFFIX = ""; public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; public static final String ENUM_PROPERTY_NAMING_REPLACE_SPECIAL_CHAR_VALUE = "false"; + public static final String USE_SINGLE_REQUEST_PARAMETER = "false"; @Override public String getLanguage() { @@ -88,6 +89,7 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptNestjsClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) + .put(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, USE_SINGLE_REQUEST_PARAMETER) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/flight/PhpFlightServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/flight/PhpFlightServerCodegenTest.java new file mode 100644 index 00000000000..cbba0a00ed8 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/flight/PhpFlightServerCodegenTest.java @@ -0,0 +1,74 @@ +package org.openapitools.codegen.php.flight; + +import java.io.File; +import java.nio.file.Files; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.Test; + +public class PhpFlightServerCodegenTest { + + @Test + public void shouldGenerateModel() throws Exception { + Map properties = new HashMap<>(); + + File output = Files.createTempDirectory("test").toFile(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("php-flight") + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/petstore-php-flight.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + + TestUtils.ensureContainsFile(files, output, "Api/AbstractPetApi.php"); + TestUtils.ensureContainsFile(files, output, "Model/Pet.php"); + TestUtils.ensureContainsFile(files, output, "Model/StandaloneEnum.php"); + TestUtils.ensureContainsFile(files, output, "Model/PetStatus.php"); // inline enum + TestUtils.ensureContainsFile(files, output, "README.md"); + TestUtils.ensureContainsFile(files, output, "RegisterRoutes.php"); + + java.nio.file.Path petModelFile = files.stream().filter(f -> f.getName().contains("Pet.php")).findFirst().orElseThrow().toPath(); + TestUtils.assertFileContains(petModelFile, "namespace OpenAPIServer\\Model;"); + TestUtils.assertFileContains(petModelFile, "public int $id;"); + TestUtils.assertFileContains(petModelFile, "public ?string $name;"); + TestUtils.assertFileContains(petModelFile, "public ?\\DateTime $dateTimeAttribute;"); + TestUtils.assertFileContains(petModelFile, "@var Order[]|null"); + TestUtils.assertFileContains(petModelFile, "public ?array $objectList;"); + TestUtils.assertFileContains(petModelFile, "$data['photo_urls'] ?? null,"); + TestUtils.assertFileContains(petModelFile, "'photo_urls' => $this->photoUrls"); + + TestUtils.assertFileContains(petModelFile, "isset($data['category']) ? Category::fromArray($data['category']) : null,"); + TestUtils.assertFileContains(petModelFile, "isset($data['status']) ? PetStatus::tryFrom($data['status']) : null"); + TestUtils.assertFileContains(petModelFile, "isset($data['refEnum']) ? StandaloneEnum::tryFrom($data['refEnum']) : null"); + TestUtils.assertFileContains(petModelFile, "isset($data['dateTimeAttribute']) ? new \\DateTime($data['dateTimeAttribute']) : null"); + + java.nio.file.Path petApiFile = files.stream().filter(f -> f.getName().contains("AbstractPetApi.php")).findFirst().orElseThrow().toPath(); + TestUtils.assertFileContains(petApiFile, "namespace OpenAPIServer\\Api;"); + TestUtils.assertFileContains(petApiFile, "public function getPetById(int $petId)"); + TestUtils.assertFileContains(petApiFile, "public function updatePet(\\OpenAPIServer\\Model\\Pet $pet): \\OpenAPIServer\\Model\\Pet|null"); + + java.nio.file.Path registerRoutesFile = files.stream().filter(f -> f.getName().contains("RegisterRoutes.php")).findFirst().orElseThrow().toPath(); + TestUtils.assertFileContains(registerRoutesFile, "function registerRoutes(\\OpenAPIServer\\Api\\AbstractPetApi|\\OpenAPIServer\\Api\\AbstractUserApi $handler): void"); + TestUtils.assertFileContains(registerRoutesFile, + "Flight::route('POST /user/createWithArray/@pathParamInt/@pathParamString', function (string $pathParamInt, string $pathParamString) use ($handler) {"); + TestUtils.assertFileContains(registerRoutesFile, "parseParam($pathParamInt, 'int')"); + TestUtils.assertFileContains(registerRoutesFile, "parseParam($pathParamString, 'string')"); + TestUtils.assertFileContains(registerRoutesFile, "parseParam(json_decode($r->getBody(), true), '\\\\OpenAPIServer\\\\Model\\\\User[]')"); + TestUtils.assertFileContains(registerRoutesFile, "parseParam($r->getHeader('api_key'), '?string')"); + + Files.readAllLines(files.stream().filter(f -> f.getName().contains("RegisterRoutesTest.php")).findFirst().orElseThrow().toPath()).forEach(System.out::println); + java.nio.file.Path registerRoutesTestFile = files.stream().filter(f -> f.getName().contains("RegisterRoutesTest.php")).findFirst().orElseThrow().toPath(); + TestUtils.assertFileContains(registerRoutesTestFile, "namespace OpenAPIServer\\Test;"); + + output.deleteOnExit(); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/postman/PostmanCollectionCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/postman/PostmanCollectionCodegenTest.java index fedee8c1129..d6471c387e4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/postman/PostmanCollectionCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/postman/PostmanCollectionCodegenTest.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.v3.oas.models.tags.Tag; -import org.junit.Assert; import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.languages.PostmanCollectionCodegen; @@ -22,8 +21,7 @@ import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.*; import static org.openapitools.codegen.TestUtils.*; public class PostmanCollectionCodegenTest { @@ -33,11 +31,11 @@ public class PostmanCollectionCodegenTest { final PostmanCollectionCodegen postmanCollectionCodegen = new PostmanCollectionCodegen(); postmanCollectionCodegen.processOpts(); - Assert.assertEquals(postmanCollectionCodegen.folderStrategy, "Tags"); - Assert.assertEquals(postmanCollectionCodegen.postmanFile, "postman.json"); + assertEquals(postmanCollectionCodegen.folderStrategy, "Tags"); + assertEquals(postmanCollectionCodegen.postmanFile, "postman.json"); - Assert.assertNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsList")); - Assert.assertNotNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsByTag")); + assertNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsList")); + assertNotNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsByTag")); } @Test @@ -47,10 +45,10 @@ public class PostmanCollectionCodegenTest { postmanCollectionCodegen.additionalProperties().put(postmanCollectionCodegen.FOLDER_STRATEGY, "Tags"); postmanCollectionCodegen.processOpts(); - Assert.assertEquals(postmanCollectionCodegen.folderStrategy, "Tags"); + assertEquals(postmanCollectionCodegen.folderStrategy, "Tags"); - Assert.assertNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsList")); - Assert.assertNotNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsByTag")); + assertNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsList")); + assertNotNull(postmanCollectionCodegen.additionalProperties().get("codegenOperationsByTag")); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java index 63b3d0f6016..b1ec1b42065 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java @@ -17,7 +17,7 @@ package org.openapitools.codegen.python; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import com.google.common.collect.Sets; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; @@ -31,7 +31,6 @@ import org.openapitools.codegen.languages.features.CXFServerFeatures; import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.assertFileExists; import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.java.assertions.JavaFileAssert; import org.testng.Assert; import org.testng.annotations.Test; import java.io.File; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java index 739d632daac..334e270e860 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java @@ -1,6 +1,6 @@ package org.openapitools.codegen.templating.mustache; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Map; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java index 31a67ed6190..32e5e42e325 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java @@ -6,8 +6,13 @@ import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.MapSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.Generator; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen; @@ -17,6 +22,14 @@ import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; @Test(groups = {TypeScriptGroups.TYPESCRIPT, TypeScriptGroups.TYPESCRIPT_FETCH}) @@ -55,6 +68,32 @@ public class TypeScriptFetchClientCodegenTest { Assert.assertEquals(operation.isResponseOptional, true); } + @Test + public void testModelsWithoutPaths() throws IOException { + final String specPath = "src/test/resources/3_1/reusable-components-without-paths.yaml"; + + Map properties = new HashMap<>(); + properties.put("supportsES6", true); + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("typescript-fetch") + .setInputSpec(specPath) + .setAdditionalProperties(properties) + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + Generator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + TestUtils.assertFileExists(Paths.get(output + "/index.ts")); + TestUtils.assertFileExists(Paths.get(output + "/runtime.ts")); + TestUtils.assertFileExists(Paths.get(output + "/models/Pet.ts")); + TestUtils.assertFileExists(Paths.get(output + "/models/index.ts")); + } + @Test public void testWithoutSnapshotVersion() { OpenAPI api = TestUtils.createOpenAPI(); @@ -183,4 +222,99 @@ public class TypeScriptFetchClientCodegenTest { assertThat(codegen.supportingFiles()).contains(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); assertThat(codegen.supportingFiles()).doesNotContain(new SupportingFile("tsconfig.esm.mustache", "", "tsconfig.esm.json")); } + + @Test(description = "Verify file name formatting from model name in PascalCase") + public void testModelFileNameInPascalCase() { + final TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.setFileNaming(TypeScriptFetchClientCodegen.PASCAL_CASE); + Assert.assertEquals("FirstSimpleModel", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNameSuffix("suffix"); + Assert.assertEquals("FirstSimpleModelSuffix", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNamePrefix("prefix"); + Assert.assertEquals("PrefixFirstSimpleModelSuffix", codegen.toModelFilename("FirstSimpleModel")); + } + + @Test(description = "Verify file name formatting from model name in camelCase") + public void testModelFileNameInCamelCase() { + final TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.setFileNaming(TypeScriptFetchClientCodegen.CAMEL_CASE); + Assert.assertEquals("firstSimpleModel", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNameSuffix("suffix"); + Assert.assertEquals("firstSimpleModelSuffix", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNamePrefix("prefix"); + Assert.assertEquals("prefixFirstSimpleModelSuffix", codegen.toModelFilename("FirstSimpleModel")); + } + + @Test(description = "Verify file name formatting from model name in kebab-case") + public void testModelFileNameInKebabCase() { + final TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.setFileNaming("kebab-case"); + Assert.assertEquals("first-simple-model", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNameSuffix("suffix"); + Assert.assertEquals("first-simple-model-suffix", codegen.toModelFilename("FirstSimpleModel")); + codegen.setModelNamePrefix("prefix"); + Assert.assertEquals("prefix-first-simple-model-suffix", codegen.toModelFilename("FirstSimpleModel")); + } + + @Test(description = "Verify file name formatting from api name in PascalCase, camelCase and kebab-case") + public void testApiFileNameInVariousFormat() { + final TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.setFileNaming(TypeScriptFetchClientCodegen.PASCAL_CASE); + String prefix = codegen.getApiNamePrefix() != null ? codegen.getApiNamePrefix() : ""; + String suffix = codegen.getApiNameSuffix() != null ? codegen.getApiNameSuffix() : ""; + Assert.assertEquals(StringUtils.capitalize(prefix + "FirstSimpleController") + StringUtils.capitalize(suffix), + codegen.toApiFilename("FirstSimpleController")); + codegen.setFileNaming(TypeScriptFetchClientCodegen.CAMEL_CASE); + Assert.assertEquals(StringUtils.uncapitalize(prefix + "FirstSimpleController") + StringUtils.capitalize(suffix), + codegen.toApiFilename("FirstSimpleController")); + codegen.setFileNaming(TypeScriptFetchClientCodegen.KEBAB_CASE); + Assert.assertEquals((prefix.isBlank() ? "" : (StringUtils.lowerCase(suffix) + "-")) + "first-simple-controller" + (suffix.isBlank() ? "" : ("-" + StringUtils.lowerCase(suffix))), + codegen.toApiFilename("FirstSimpleController")); + } + + @Test(description = "Verify names of files generated in kebab-case and imports") + public void testGeneratedFilenamesInKebabCase() throws IOException { + + Map properties = new HashMap<>(); + properties.put("fileNaming", TypeScriptFetchClientCodegen.KEBAB_CASE); + + File output = generate(properties); + + Path pet = Paths.get(output + "/models/pet.ts"); + TestUtils.assertFileExists(pet); + TestUtils.assertFileContains(pet, "} from './pet-category';"); + TestUtils.assertFileExists(Paths.get(output + "/models/pet-category.ts")); + TestUtils.assertFileExists(Paths.get(output + "/apis/pet-controller-api.ts")); + } + + @Test(description = "Verify names of files generated in camelCase and imports") + public void testGeneratedFilenamesInCamelCase() throws IOException { + + Map properties = new HashMap<>(); + properties.put("fileNaming", TypeScriptFetchClientCodegen.CAMEL_CASE); + + File output = generate(properties); + + Path pet = Paths.get(output + "/models/pet.ts"); + TestUtils.assertFileExists(pet); + TestUtils.assertFileContains(pet, "} from './petCategory';"); + TestUtils.assertFileExists(Paths.get(output + "/models/petCategory.ts")); + TestUtils.assertFileExists(Paths.get(output + "/apis/petControllerApi.ts")); + } + + private static File generate(Map properties) throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("typescript-fetch") + .setInputSpec("src/test/resources/3_0/typescript-fetch/example-for-file-naming-option.yaml") + .setAdditionalProperties(properties) + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + Generator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + return output; + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java index afbf555beb3..26c9796291d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java @@ -22,6 +22,7 @@ import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.openapitools.codegen.options.TypeScriptFetchClientOptionsProvider; import org.openapitools.codegen.typescript.TypeScriptGroups; +import org.testng.Assert; import org.testng.annotations.Test; import static org.mockito.Mockito.mock; @@ -53,5 +54,21 @@ public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setSagasAndRecords(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SAGAS_AND_RECORDS)); verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.STRING_ENUMS)); + verify(clientCodegen).setFileNaming(TypeScriptFetchClientOptionsProvider.FILE_NAMING_VALUE); } + + @Test(description = "Verify if an exception is thrown when invalid values are used with fileNaming option") + public void testFileNamingInvalidValues() { + final TypeScriptFetchClientCodegen codegen = new TypeScriptFetchClientCodegen(); + Assert.assertThrows(IllegalArgumentException.class, () -> + codegen.setFileNaming(null) + ); + Assert.assertThrows(IllegalArgumentException.class, () -> + codegen.setFileNaming("") + ); + Assert.assertThrows(IllegalArgumentException.class, () -> + codegen.setFileNaming("invalid-format") + ); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java index 04c0a9b71be..0c2ad39f41f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java @@ -21,6 +21,7 @@ import com.google.common.collect.Sets; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.parser.util.SchemaTypeUtil; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; @@ -35,12 +36,7 @@ import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; +import java.util.*; /* import static io.swagger.codegen.CodegenConstants.IS_ENUM_EXT_NAME; @@ -480,4 +476,5 @@ public class TypeScriptFetchModelTest { final Map schemaBefore = openAPI.getComponents().getSchemas(); Assert.assertEquals(schemaBefore.keySet(), Sets.newHashSet("club", "owner")); } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java index d99c2fa678c..187e22f55cc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/ModelUtilsTest.java @@ -26,6 +26,7 @@ import org.openapitools.codegen.TestUtils; import org.testng.Assert; import org.testng.annotations.Test; +import java.math.BigDecimal; import java.util.*; public class ModelUtilsTest { @@ -391,4 +392,58 @@ public class ModelUtilsTest { Schema complexComposedSchema = ModelUtils.getSchema(openAPI, "ComplexComposedSchema"); Assert.assertTrue(ModelUtils.isComplexComposedSchema(complexComposedSchema)); } + + @Test + public void testCloneNumberSchema() { + Schema schema = new NumberSchema() + .name("test-schema") + .minimum(new BigDecimal(100)); + + Schema deepCopy = ModelUtils.cloneSchema(schema); + + Assert.assertEquals(schema, deepCopy); + } + + @Test + public void testCloneCustomSchema() { + Schema schema = new Schema().type("money"); + + Schema deepCopy = ModelUtils.cloneSchema(schema); + + Assert.assertEquals(schema, deepCopy); + } + + @Test + public void testCloneComposedSchema() { + Schema base1 = new Schema() + .name("Base1") + .addProperty("foo", new StringSchema()); + Schema base2 = new Schema() + .name("Base2") + .addProperty("bar", new StringSchema()); + Schema composedSchema = new ComposedSchema() + .name("Composed") + .allOf(List.of(base1, base2)) + .addProperty("baz", new StringSchema()); + + var deepCopy = ModelUtils.cloneSchema(composedSchema); + + Assert.assertEquals(composedSchema, deepCopy); + } + + @Test + public void testCloneArrayOfEnumsSchema() { + Schema arraySchema = new Schema() + .name("ArrayType") + .type("array") + .items(new Schema() + .type("string") + ._enum(List.of("SUCCESS", "FAILURE", "SKIPPED")) + ) + ._default(List.of("SUCCESS", "FAILURE")); + + var deepCopy = ModelUtils.cloneSchema(arraySchema); + + Assert.assertEquals(arraySchema, deepCopy); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/yaml/YamlGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/yaml/YamlGeneratorTest.java index 6f289d538e1..6c26f20f50f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/yaml/YamlGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/yaml/YamlGeneratorTest.java @@ -28,6 +28,7 @@ import org.testng.annotations.Test; import java.io.File; import java.nio.file.Files; +import java.nio.file.Path; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -121,4 +122,31 @@ public class YamlGeneratorTest { Assert.assertEquals(actual.getPaths().get("/foo/bar").getPost().getResponses().get("200").getContent().get("*/*").getSchema().getAdditionalProperties(), expected.getComponents().getSchemas().get("_foo_bar_post_200_response").getAdditionalProperties()); } + + @Test + public void testIssue18622() throws Exception { + Map properties = new HashMap<>(); + properties.put(OpenAPIYamlGenerator.OUTPUT_NAME, "issue_18622.yaml"); + + File output = Files.createTempDirectory("issue_18622").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("openapi-yaml") + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/2_0/issue_18622.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(clientOptInput).generate(); + Assert.assertEquals(files.size(), 5); + TestUtils.ensureContainsFile(files, output, "issue_18622.yaml"); + + OpenAPI expected = TestUtils.parseSpec("src/test/resources/2_0/issue_18622_expected.yaml"); + OpenAPI actual = TestUtils.parseSpec(Path.of(output.getAbsolutePath(), "issue_18622.yaml").toString()); + + Assert.assertEquals(actual.getComponents().getSchemas().get("myresponse").getExample(), + expected.getComponents().getSchemas().get("myresponse").getExample()); + } } diff --git a/modules/openapi-generator/src/test/resources/2_0/issue_18622.yaml b/modules/openapi-generator/src/test/resources/2_0/issue_18622.yaml new file mode 100644 index 00000000000..9a3ea0f7eb7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/issue_18622.yaml @@ -0,0 +1,27 @@ +swagger: '2.0' +info: + title: 'Buggy Api' + version: '1.0' +consumes: + - application/json +paths: + /foo/bar: + post: + responses: + '200': + description: ok + schema: + $ref: "#/definitions/myresponse" +definitions: + myresponse: + type: object + additionalProperties: false + properties: + x: + $ref: "#/definitions/myenum" + myenum: + type: string + enum: + - A + - B + - C diff --git a/modules/openapi-generator/src/test/resources/2_0/issue_18622_expected.yaml b/modules/openapi-generator/src/test/resources/2_0/issue_18622_expected.yaml new file mode 100644 index 00000000000..a81bd8e86f8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/issue_18622_expected.yaml @@ -0,0 +1,33 @@ +openapi: 3.0.1 +info: + title: Buggy Api + version: "1.0" +servers: + - url: / +paths: + /foo/bar: + post: + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/myresponse' + description: ok +components: + schemas: + myresponse: + additionalProperties: false + example: + x: A + properties: + x: + $ref: '#/components/schemas/myenum' + type: object + myenum: + enum: + - A + - B + - C + type: string +x-original-swagger-version: "2.0" diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache index d5029896718..2c34b3c5d0c 100644 --- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/ApiClient.mustache @@ -19,7 +19,12 @@ import java.time.OffsetDateTime; {{#threetenbp}} import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; {{/threetenbp}} +{{#useJakartaEe}} +import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; +{{/useJakartaEe}} +{{^useJakartaEe}} import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +{{/useJakartaEe}} import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; diff --git a/modules/openapi-generator/src/test/resources/3_0/cpp-restsdk/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/cpp-restsdk/petstore.yaml new file mode 100644 index 00000000000..64ca7deaaf8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/cpp-restsdk/petstore.yaml @@ -0,0 +1,773 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + SchemaWithSet: + description: Schema with a set property + type: object + properties: + certificates: + description: pedigree and other certificates + type: array + uniqueItems: true + items: + type: string + vaccinationBook: + description: Vaccination book of the pet + type: object + required: + - vaccines + properties: + vaccines: + type: array + uniqueItems: true + items: + title: vaccine + type: object + required: + - date + - boosterRequired + properties: + date: + format: date + description: vaccination date + boosterRequired: + type: boolean + description: true if a booster is still needed to complete the vaccination diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 2dfa05e16ad..21570bfa9ac 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -2752,4 +2752,106 @@ components: a_objVariableobject: type: array items: - $ref: '#/components/schemas/Custom-Variableobject-Response' \ No newline at end of file + $ref: '#/components/schemas/Custom-Variableobject-Response' + # this class ensures that the CodegenProperties are sorted correctly + # https://github.com/OpenAPITools/openapi-generator/issues/18607 + MixLog: + type: object + properties: + id: + $ref: '#/components/schemas/uuid' + description: + type: string + mixDate: + type: string + format: date-time + shopId: + $ref: '#/components/schemas/uuid' + totalPrice: + type: number + format: float + nullable: true + totalRecalculations: + type: integer + format: int32 + totalOverPoors: + type: integer + format: int32 + totalSkips: + type: integer + format: int32 + totalUnderPours: + type: integer + format: int32 + formulaVersionDate: + type: string + format: date-time + someCode: + type: string + nullable: true + description: SomeCode is only required for color mixes + batchNumber: + type: string + brandCode: + type: string + description: BrandCode is only required for non-color mixes + brandId: + type: string + description: BrandId is only required for color mixes + brandName: + type: string + description: BrandName is only required for color mixes + categoryCode: + type: string + description: CategoryCode is not used anymore + color: + type: string + description: Color is only required for color mixes + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + type: string + description: ProductLineCode is only required for color mixes + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + nullable: true + type: integer + format: int32 + primerProductId: + type: string + productId: + type: string + description: ProductId is only required for color mixes + productName: + type: string + description: ProductName is only required for color mixes + selectedVersionIndex: + type: integer + format: int32 + required: + - id + - description + - mixDate + - totalRecalculations + - totalOverPoors + - totalSkips + - totalUnderPours + - formulaVersionDate + uuid: + type: string + format: uuid diff --git a/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml b/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml index d101a638c3e..020edb73b40 100644 --- a/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/example_generator_test.yaml @@ -61,6 +61,16 @@ paths: items: type: string example: primitive types example value + /generate_from_response_schema_array_reference: + get: + operationId: generateFromResponseSchemaArrayReference + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ExampleArraySchema' /generate_from_response_schema_with_model: get: operationId: generateFromResponseSchemaWithModel @@ -81,6 +91,16 @@ paths: application/json: schema: $ref: '#/components/schemas/ExampleAllOfSchema' + /generate_from_response_schema_with_allOf_child_composed_model: + get: + operationId: generateFromResponseSchemaWithAllOfModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ExampleAllOfParentSchema' /generate_from_response_schema_with_anyOf_composed_model: get: operationId: generateFromResponseSchemaWithAnyOfModel @@ -131,6 +151,15 @@ components: example_schema_property_composed: type: string example: example schema property value composed + ExampleAllOfParentSchema: + type: object + allOf: + - $ref: '#/components/schemas/ExampleAllOfSchema' + - type: object + properties: + example_schema_property_composed_parent: + type: string + example: example schema property value composed parent ExampleAnyOfSchema: type: object anyOf: @@ -149,3 +178,7 @@ components: example_schema_property_composed: type: string example: example schema property value composed + ExampleArraySchema: + type: array + items: + $ref: '#/components/schemas/ExampleSchema' diff --git a/modules/openapi-generator/src/test/resources/3_0/go-server/no-body-path-params.yaml b/modules/openapi-generator/src/test/resources/3_0/go-server/no-body-path-params.yaml new file mode 100644 index 00000000000..10c9ff27f6a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go-server/no-body-path-params.yaml @@ -0,0 +1,91 @@ +openapi: 3.0.0 + +info: + version: 1.0.0 + title: Simple no path and body param spec + +paths: + /none/endpoint: + get: + tags: + - none + summary: summary + description: description + operationId: one + responses: + '204': + description: successful operation + /path/endpoint/{pathParam}: + get: + tags: + - path + summary: summary + description: description + operationId: path + parameters: + - name: pathParam + in: path + required: true + style: form + explode: false + schema: + type: string + responses: + '204': + description: successful operation + + /body/endpoint: + post: + tags: + - body + summary: summary + description: description + operationId: body + requestBody: + description: Optional description in *Markdown* + required: true + content: + application/json: + schema: + type: object + properties: + param: + type: string + text/plain: + schema: + type: string + responses: + '204': + description: successful operation + + /both/endpoint/{pathParam}: + post: + tags: + - both + summary: summary + description: description + operationId: both + parameters: + - name: pathParam + in: path + required: true + style: form + explode: false + schema: + type: string + requestBody: + description: Optional description in *Markdown* + required: true + content: + application/json: + schema: + type: object + properties: + param: + type: string + text/plain: + schema: + type: string + responses: + '204': + description: successful operation diff --git a/modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml index 78a7a1ec6cc..0e249cae5d9 100644 --- a/modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml @@ -100,6 +100,21 @@ paths: - "OPTION_1" - "OPTION_2" - "OPTION_3" + - name: defaultInt + in: query + schema: + default: 1 + type: integer + - name: defaultNum + in: query + schema: + default: 1.5 + type: number + - name: defaultStr + in: query + schema: + default: default + type: string - name: status in: query description: Status values that need to be considered for filter @@ -616,9 +631,9 @@ paths: required: true schema: type: string - - name: boolean_test + - name: remember_me in: query - description: The password for login in clear text + description: Remember Me schema: type: boolean responses: @@ -731,9 +746,9 @@ paths: required: true schema: type: string - - name: boolean_test # to ensure boolean query parameter won't cause compilation errors + - name: confirmation # to ensure boolean query parameter won't cause compilation errors in: query - description: boolean query parameter + description: Confirm the deletion schema: type: boolean responses: diff --git a/modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml new file mode 100644 index 00000000000..3dba3eeac2d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go/allof_multiple_ref_and_discriminator.yaml @@ -0,0 +1,54 @@ +openapi: 3.0.0 +info: + title: Test + version: 1.0.0 +paths: {} +components: + schemas: + FinalItem: + type: object + allOf: + - $ref: '#/components/schemas/base.item' + - $ref: '#/components/schemas/AdditionalData' + base.item: + type: object + properties: + title: + type: string + type: + type: string + enum: + - FINAL + example: FINAL + discriminator: + propertyName: type + mapping: + FINAL: '#/components/schemas/FinalItem' + required: + - title + - type + AdditionalData: + type: object + properties: + prop1: + type: string + quantity: + type: integer + format: int32 + example: 1 + minimum: 1 + unitPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + totalPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + required: + - prop1 + - quantity + - unitPrice + - totalPrice diff --git a/modules/openapi-generator/src/test/resources/3_0/go/allof_skip_unmarshal_json.yaml b/modules/openapi-generator/src/test/resources/3_0/go/allof_skip_unmarshal_json.yaml new file mode 100644 index 00000000000..bd69102a855 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go/allof_skip_unmarshal_json.yaml @@ -0,0 +1,55 @@ +openapi: 3.0.0 +info: + title: Test + version: 1.0.0 +paths: {} +components: + schemas: + FinalItem: + type: object + allOf: + - $ref: '#/components/schemas/BaseItem' + - $ref: '#/components/schemas/AdditionalData' + BaseItem: + type: object + x-go-generate-unmarshal-json: false + properties: + title: + type: string + type: + type: string + enum: + - FINAL + example: FINAL + discriminator: + propertyName: type + mapping: + FINAL: '#/components/schemas/FinalItem' + required: + - title + - type + AdditionalData: + type: object + properties: + prop1: + type: string + quantity: + type: integer + format: int32 + example: 1 + minimum: 1 + unitPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + totalPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + required: + - prop1 + - quantity + - unitPrice + - totalPrice \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/go/allof_with_unmarshal_json.yaml b/modules/openapi-generator/src/test/resources/3_0/go/allof_with_unmarshal_json.yaml new file mode 100644 index 00000000000..f32b662de1e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/go/allof_with_unmarshal_json.yaml @@ -0,0 +1,54 @@ +openapi: 3.0.0 +info: + title: Test + version: 1.0.0 +paths: {} +components: + schemas: + FinalItem: + type: object + allOf: + - $ref: '#/components/schemas/BaseItem' + - $ref: '#/components/schemas/AdditionalData' + BaseItem: + type: object + properties: + title: + type: string + type: + type: string + enum: + - FINAL + example: FINAL + discriminator: + propertyName: type + mapping: + FINAL: '#/components/schemas/FinalItem' + required: + - title + - type + AdditionalData: + type: object + properties: + prop1: + type: string + quantity: + type: integer + format: int32 + example: 1 + minimum: 1 + unitPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + totalPrice: + type: number + format: double + example: 9.99 + minimum: 0.0 + required: + - prop1 + - quantity + - unitPrice + - totalPrice \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml index aa139e06290..b5de57e0f47 100644 --- a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml @@ -279,7 +279,7 @@ paths: - petstore_auth: - 'write:pets' - 'read:pets' - '/pet/{petId}/uploadImage': + '/pet/{petId}/{petDate}/uploadImage': post: tags: - pet diff --git a/modules/openapi-generator/src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml b/modules/openapi-generator/src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml new file mode 100644 index 00000000000..da9323c1512 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issues-anytype-object-set-petstore-everything.yaml @@ -0,0 +1,838 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user + +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] + +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' + +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + + required: + - name + - photoUrls + + properties: + id: + type: integer + format: int64 + + category: + $ref: '#/components/schemas/Category' + + name: + type: string + example: doggie + + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + + # ----------------------------------------------------------------------- + # Properties that dedicate this configuration to some issues or checkings + # ----------------------------------------------------------------------- + + # https://github.com/OpenAPITools/openapi-generator/issues/2769 + # object property (leading to Object.h) + veterinarianVisit: + type: object + description: last veterinarian visit advice + + # leading to Anytype.h + # https://github.com/OpenAPITools/openapi-generator/issues/10266 + goodies: + type: array + items: {} + nullable: true + description: to help you installing your pet at home + + # Leading to Set.h + certificates: + description: pedigree and other certificates + type: array + uniqueItems: true + + items: + type: string + + # https://github.com/OpenAPITools/openapi-generator/issues/14234 + vaccinationBook: + description: Vaccination book of the pet + type: object + + required: + - vaccines + + properties: + vaccines: + type: array + uniqueItems: true + + items: + title: vaccine + type: object + + required: + - date + - boosterRequired + + properties: + date: + format: date + description: vaccination date + + boosterRequired: + type: boolean + description: true if a booster is still needed to complete the vaccination + + + xml: + name: Pet + + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/java/all_args_constructor.yaml b/modules/openapi-generator/src/test/resources/3_0/java/all_args_constructor.yaml new file mode 100644 index 00000000000..7e3f31a371a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/all_args_constructor.yaml @@ -0,0 +1,125 @@ +openapi: 3.0.0 +info: + title: My service + description: My service + version: 1.0.0 +servers: + - url: 'https://localhost' +paths: + /generator/test: + post: + summary: Get test generator models + responses: + 200: + description: returns Page of Pets + content: + application/json: + schema: + $ref: '#/components/schemas/PageOfPets' +components: + schemas: + Page: + properties: + count: +# test readonly and required + type: integer + readOnly: true + required: + - count + # test composition + PageOfPets: + allOf: + - $ref: '#/components/schemas/Page' + - type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/Pet' +# test inheritance + Pet: + type: object + required: + - type + properties: + dateOfBirth: + type: string + format: date + name: + type: string + type: + type: string + readOnly: true + discriminator: + propertyName: type + mapping: + CAT: '#/components/schemas/Cat' + DOG: '#/components/schemas/Dog' + Cat: + type: object + allOf: + - $ref: '#/components/schemas/Pet' + required: + - race + properties: + paws: + type: integer + race: + type: string + discriminator: + propertyName: race + mapping: + PERSIAN: '#/components/schemas/Persian' + MAINE_COON: '#/components/schemas/MaineCoon' + Dog: + type: object + allOf: + - $ref: '#/components/schemas/Pet' + required: + - race + properties: + tails: + type: integer + race: + type: string + discriminator: + propertyName: race + mapping: + POODLE: '#/components/schemas/Poodle' + LABRADOR: '#/components/schemas/Labrador' + Poodle: + type: object + allOf: + - $ref: '#/components/schemas/Dog' + properties: + hairType: + type: string + required: + - race + Labrador: + type: object + allOf: + - $ref: '#/components/schemas/Dog' + properties: + hairColor: + type: string + required: + - race + Persian: + type: object + allOf: + - $ref: '#/components/schemas/Cat' + properties: + hairType: + type: string + required: + - race + MaineCoon: + type: object + allOf: + - $ref: '#/components/schemas/Cat' + properties: + hairColor: + type: string + required: + - race diff --git a/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml b/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml new file mode 100644 index 00000000000..bf77f24a400 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml @@ -0,0 +1,140 @@ +openapi: 3.0.2 +info: + title: OAI Specification example for Polymorphism + version: 1.0.0 +paths: + /pet: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + /reptile: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/Reptile' + /mypets: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/MyPets' +components: + schemas: + SimpleObject: + type: object + properties: + nb: + type: number + minimum: 1 + simple: + type: string + list: + type: array + items: + minLength: 1 + type: string + nullableObject: + type: string + nullable: true + nullableList: + type: array + nullable: true + items: + maxLength: 100 + type: string + additionalProperties: + type: integer + Pet: + type: object + required: + - petType + properties: + petType: + type: string + name: + type: string + petReadonlyProperty: + type: string + readOnly: true + petNullableProperty: + type: string + nullable: true + discriminator: + propertyName: petType + additionalProperties: + type: number + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + name: + type: string + Reptile: + allOf: + - $ref: '#/components/schemas/Pet' + Dog: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + bark: + type: string + simple: + $ref: '#/components/schemas/SimpleObject' + Lizard: + allOf: + - $ref: '#/components/schemas/Reptile' + - type: object + properties: + lovesRocks: + type: boolean + readOnly: true + Snake: + allOf: + - $ref: '#/components/schemas/Reptile' + - type: object + properties: + hasLegs: + type: boolean + MyPets: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Lizard' + discriminator: + propertyName: petType + # per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminatorObject + # this discriminator must be included to use it as a hint to pick a schema + MyPetsNoDisc: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Lizard' + A: + type: object + required: + - petType + properties: + petType: + type: string + discriminator: + propertyName: petType + mapping: + b: '#/components/schemas/B' + B: + allOf: + - $ref: '#/components/schemas/A' + C: + allOf: + - $ref: '#/components/schemas/B' diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml index 0aff5a7c095..c2d678c532b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml @@ -938,6 +938,38 @@ paths: $ref: '#/components/schemas/FreeFormObject' description: request body required: true + /fake/oneOfWIthSameErasure: + get: + description: Test route, this shouldn't cause a compiler error + responses: + 200: + description: successful response + content: + application/json: + schema: + oneOf: + - type: array + items: + type: string + - type: array + items: + type: integer + /fake/anyOfWIthSameErasure: + get: + description: Test route, this shouldn't cause a compiler error + responses: + 200: + description: successful response + content: + application/json: + schema: + anyOf: + - type: array + items: + type: string + - type: array + items: + type: integer /fake/stringMap-reference: post: tags: @@ -1048,6 +1080,18 @@ paths: schema: $ref: '#/components/schemas/FileSchemaTestClass' required: true + /fake/get-free-form-object: + get: + tags: + - fake + description: Get a free form object or Json string + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObjectTestClass' /fake/test-query-parameters: put: tags: @@ -2035,6 +2079,16 @@ components: type: array items: $ref: '#/components/schemas/File' + FreeFormObjectTestClass: + type: object + properties: + name: + type: string + properties: + oneOf: + - type: string + - type: object + additionalProperties: true File: type: object description: Must be named `File` for test. diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 00000000000..ab021b4b528 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,2109 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + - url: 'http://{server}.swagger.io:{port}/v2' + description: test server with variables + variables: + server: + description: target server + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + x-webclient-blocking: true + responses: + '200': + description: Successful operation + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + x-webclient-blocking: true + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + x-webclient-blocking: true + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + uniqueItems: true + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + x-webclient-blocking: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + x-webclient-blocking: false + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + - name: enum_query_model_array + in: query + schema: + type: array + items: + $ref: '#/components/schemas/EnumClass' + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/property/enum-int: + post: + tags: + - fake + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + responses: + '200': + description: Output enum (int) + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/BigDecimalMap: + get: + tags: + - fake + description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + operationId: fakeBigDecimalMap + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: object + properties: + someId: + type: number + someMap: + type: object + additionalProperties: + type: number + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/additionalProperties-reference: + post: + tags: + - fake + summary: test referenced additionalProperties + description: '' + operationId: testAdditionalPropertiesReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true + /fake/nullable: + post: + tags: + - fake + summary: test nullable parent property + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request must reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/body-with-binary: + put: + tags: + - fake + description: >- + For this test, the body has to be a binary file. + operationId: testBodyWithBinary + responses: + '200': + description: Success + requestBody: + content: + image/png: + schema: + type: string + nullable: true + format: binary + description: image to upload + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + style: pipeDelimited + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: language + in: query + required: false + schema: + type: object + additionalProperties: + type: string + format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - http_signature_test: [] + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully + /fake/tests/defaults: + get: + tags: + - fake + summary: test enum default in request body + operationId: fake-tests-defaults + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + stringEnum: + $ref: '#/components/schemas/StringEnum' + integerEnum: + $ref: '#/components/schemas/IntegerEnum' + stringEnumInline: + type: string + enum: + - foo + - bar + - baz + default: foo + integerEnumInline: + type: integer + enum: + - 1 + - 2 + - 3 + default: 1 +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_varaible + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + uniqueItems: true + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + FreeFormObject: + type: object + description: A schema consisting only of additional properties + additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + type: object + discriminator: + propertyName: type + properties: + type: + type: string + enum: + - ChildWithNullable + nullableProperty: + type: string + nullable: true + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - type: object + properties: + otherProperty: + type: string + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user + StringEnum: + type: string + enum: + - foo + - bar + - baz + default: foo + IntegerEnum: + type: integer + enum: + - 1 + - 2 + - 3 + default: 1 diff --git a/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml b/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml new file mode 100644 index 00000000000..8e03562fb83 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Test swagger file + +paths: + /pet: + get: + tags: + - store + operationId: getNestedObject + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/outerType' +components: + schemas: + outerType: + type: object + required: + - middle + properties: + middle: + $ref: '#/components/schemas/middleType' + middleType: + type: object + required: + - inner + properties: + inner: + $ref: '#/components/schemas/innerType' + innerType: + type: string + \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-multiple-2xx-responses.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-multiple-2xx-responses.yaml new file mode 100644 index 00000000000..dbe18bd8b04 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-multiple-2xx-responses.yaml @@ -0,0 +1,754 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '206': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-php-flight.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-php-flight.yaml new file mode 100644 index 00000000000..ded453c4dd3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-php-flight.yaml @@ -0,0 +1,411 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + requestBody: + $ref: '#/components/requestBodies/Pet' + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + /user/createWithArray/{pathParamInt}/{pathParamString}: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + parameters: + - name: pathParamInt + in: path + required: true + schema: + type: integer + format: int64 + - name: pathParamString + in: path + required: true + schema: + type: string + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + StandaloneEnum: + type: string + enum: + - firstValue + - secondValue + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - id + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photo_urls: + type: array + items: + type: string + tags: + type: array + items: + $ref: '#/components/schemas/Tag' + refEnum: + $ref: '#/components/schemas/StandaloneEnum' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + dateTimeAttribute: + type: string + format: date-time + primitiveList: + type: array + items: + type: integer + objectList: + type: array + items: + $ref: '#/components/schemas/Order' + dateTimeList: + type: array + items: + type: string + format: date-time + inlineEnumList: + type: array + items: + type: string + enum: + - firstValue + - secondValue + refEnumList: + type: array + items: + $ref: '#/components/schemas/StandaloneEnum' + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml index 28b35f47071..433bd56071e 100644 --- a/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1660,6 +1660,8 @@ components: description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. type: string pattern: '/^image_\d{1,3}$/i' + array_ref: + $ref: '#/components/schemas/ArrayRef' EnumClass: type: string default: '-efg' @@ -2061,3 +2063,7 @@ components: enum: - admin - user + ArrayRef: + type: array + items: + type: string \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/ping-with-hyphen-separated-security-scheme.yaml b/modules/openapi-generator/src/test/resources/3_0/ping-with-hyphen-separated-security-scheme.yaml new file mode 100644 index 00000000000..e2fcc9f41cd --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/ping-with-hyphen-separated-security-scheme.yaml @@ -0,0 +1,21 @@ +openapi: 3.0.1 +info: + title: ping test + version: '1.0' +servers: + - url: 'http://localhost:8080/' +paths: + /ping: + get: + operationId: pingGet + responses: + '201': + description: OK +components: + securitySchemes: + hyphenated-name-test: + scheme: bearer + bearerFormat: token + type: http +security: + - hyphenated-name-test: [] diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml index 0d98d575973..7f592594358 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml @@ -2060,6 +2060,35 @@ components: enum: - 1.1 - -1.2 + enum_number_vendor_ext: + type: integer + format: int32 + enum: + - 42 + - 18 + - 56 + x-enum-descriptions: + - 'Description for 42' + - 'Description for 18' + - 'Description for 56' + x-enum-varnames: + - FortyTwo + - Eigtheen + - FiftySix + enum_string_vendor_ext: + type: string + enum: + - FOO + - Bar + - baz + x-enum-descriptions: + - 'Description for FOO' + - 'Description for Bar' + - 'Description for baz' + x-enum-varnames: + - FOOVar + - BarVar + - bazVar outerEnum: $ref: '#/components/schemas/OuterEnum' outerEnumInteger: @@ -2741,3 +2770,26 @@ components: _name: type: string type: object + Info: + allOf: + - $ref: '#/components/schemas/BaseDiscriminator' + - properties: + val: + $ref: '#/components/schemas/BaseDiscriminator' + type: object + BaseDiscriminator: + discriminator: + mapping: + string: '#/components/schemas/PrimitiveString' + propertyName: _typeName + properties: + _typeName: + type: string + type: object + PrimitiveString: + allOf: + - $ref: '#/components/schemas/BaseDiscriminator' + - properties: + _value: + type: string + type: object \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-header-uuid.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-header-uuid.yaml new file mode 100644 index 00000000000..e2aee6440aa --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust-axum/rust-axum-header-uuid.yaml @@ -0,0 +1,32 @@ +# Test deserialization of uuid objects in headers +openapi: 3.0.0 +info: + title: Sample API + version: 0.1.9 +paths: + /users: + post: + description: Adds a user to the users database table. + parameters: + - $ref: "#/components/parameters/UuidHeaderParam" + responses: + "201": # status code + description: Added row to table! + content: + application/json: + schema: + type: string +components: + schemas: + HeaderUuid: + type: string + format: uuid + example: a9f5a638-728c-479d-af9b-016eb8049ab6 + parameters: + UuidHeaderParam: + name: some_uid + in: header + required: true + description: A uuid transmitted in the header. + schema: + $ref: "#/components/schemas/HeaderUuid" \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml index 6b42b99ab75..917b103eb0c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml @@ -838,6 +838,7 @@ components: - string - boolean - uuid + - bytes properties: int32: type: integer @@ -858,6 +859,9 @@ components: uuid: type: string format: uuid + bytes: + type: string + format: byte Return: description: Test using keywords type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-validation-test.yaml b/modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-validation-test.yaml new file mode 100644 index 00000000000..d1442055687 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-validation-test.yaml @@ -0,0 +1,23 @@ +openapi: 3.0.1 +info: + title: Test to check that validation logic is not rendered when disabled. + version: 0.0.1 +paths: + /mail: + put: + description: Updates the email. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Email" + responses: + "204": + description: OK. +components: + schemas: + Email: + type: string + pattern: '^[\w\-\.]+@([\w-]+\.)+[\w-]{2,}$' + example: example@example.com \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml b/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml index 8f829a884d1..f057ce6aea9 100644 --- a/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/simplifyOneOfAnyOf_test.yaml @@ -103,6 +103,17 @@ components: - type: string - type: number - type: integer + AnyOfAnyTypeWithRef: + anyOf: + - type: boolean + - type: array + items: { } + - type: object + - type: string + - type: number + - $ref: '#/components/schemas/IntegerRef' + IntegerRef: + type: integer OneOfAnyType: oneOf: - type: object diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_18340.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_18340.yaml new file mode 100644 index 00000000000..c60e5ee24ae --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_18340.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.1 +info: + title: OpenAPI definition + version: '1.0' +paths: + /pets: + get: + summary: Get all pets + operationId: getAllPets + responses: + default: + description: ok +components: + schemas: + Pet: + type: object + properties: + petType: + type: string + discriminator: + propertyName: petType + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + type: object + properties: + name: + type: string + Cat2: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + name: + type: string diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/example-for-file-naming-option.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/example-for-file-naming-option.yaml new file mode 100644 index 00000000000..9cbd0d8048a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/example-for-file-naming-option.yaml @@ -0,0 +1,72 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Example for fileNaming option +paths: + /pet: + get: + tags: + - pet-controller + summary: Get a pet + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input +components: + schemas: + PetCategory: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/PetCategory' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml b/modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml index 1d238e67202..5877e4448fa 100644 --- a/modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml @@ -969,3 +969,15 @@ components: - Code 1 - Code 2 - Code 3 + SimpleModelWithArrayProperty: + type: object + required: + - arrayOfStrings + properties: + arrayOfStrings: + type: array + items: + type: string + AllOfSimpleModel: + allOf: + - $ref: '#/components/schemas/SimpleModelWithArrayProperty' diff --git a/modules/openapi-generator/src/test/resources/3_1/reusable-components-without-paths.yaml b/modules/openapi-generator/src/test/resources/3_1/reusable-components-without-paths.yaml new file mode 100644 index 00000000000..d7ab4d11e6e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_1/reusable-components-without-paths.yaml @@ -0,0 +1,19 @@ +openapi: 3.1.0 +info: + title: Reusable components without paths example + version: 1.0.0 +# Since OAS 3.1.0 the paths element isn't necessary. Now a valid OpenAPI Document can describe only paths, webhooks, or even only reusable components +components: + schemas: + Pet: + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_18336.yaml b/modules/openapi-generator/src/test/resources/bugs/issue_18336.yaml new file mode 100644 index 00000000000..170e469d957 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_18336.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.0 +info: + title: "OpenAPI Definition" + version: "0.0.1" +paths: + /pets: + get: + responses: + 200: + description: "Return Pet with name" + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + +components: + schemas: + Pet: + type: object + required: + - name + properties: + name: + type: string + readOnly: true \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/bugs/issue_18444.json b/modules/openapi-generator/src/test/resources/bugs/issue_18444.json new file mode 100755 index 00000000000..3509c2b78e4 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/bugs/issue_18444.json @@ -0,0 +1,194 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenAPI definition", + "version": "v0" + }, + "servers": [ + { + "url": "http://localhost/service", + "description": "Generated server url" + } + ], + "paths": { + "/api/v1/subservice/m1": { + "post": { + "tags": [ + "subservice" + ], + "summary": "subservice", + "operationId": "m1", + "parameters": [ + { + "name": "n1", + "in": "header", + "description": "n1 description", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RQ1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RS1" + } + } + } + }, + "403": { + "description": "Forbidden" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "B_TT": { + "discriminator": { + "propertyName": "otype" + }, + "required": [ + "ident", + "otype" + ], + "type": "object", + "properties": { + "ident": { + "type": "integer", + "format": "int32" + }, + "otype": { + "type": "object" + } + } + }, + "BadRequestError": { + "allOf": [ + { "$ref": "#/components/schemas/B_TT" }, + { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32", + "default": 400 + }, + "error": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + ] + }, + "RQ1": { + "allOf": [ + { "$ref": "#/components/schemas/B_TT" }, + { "type": "object", + "properties": { + "f1": { + "$ref": "#/components/schemas/FT1" + }, + "f2": { + "$ref": "#/components/schemas/FT2" + } + } + } + ] + }, + "FT1": { + "required": [ + "code" + ], + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "FT2": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "date": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "RS1": { + "type": "object", + "properties": { + "f1": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FT3" + } + }, + "f2": { + "type": "integer", + "format": "int32" + } + } + }, + "FT3": { + "required": [ + "f1", + "f2" + ], + "type": "object", + "properties": { + "f2": { + "type": "string", + "enum": [ + "E1", + "E2" + ] + }, + "f1": { + "type": "integer", + "format": "int64" + } + } + } + } + } +} diff --git a/modules/openapi-generator/src/test/resources/integrationtests/typescript/node-es5-expected/package.json b/modules/openapi-generator/src/test/resources/integrationtests/typescript/node-es5-expected/package.json index e146042b7ed..b464c010e33 100644 --- a/modules/openapi-generator/src/test/resources/integrationtests/typescript/node-es5-expected/package.json +++ b/modules/openapi-generator/src/test/resources/integrationtests/typescript/node-es5-expected/package.json @@ -17,7 +17,7 @@ "request": "^2.72.0" }, "devDependencies": { - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "typings": "^0.8.1" } } diff --git a/modules/openapi-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/package.json b/modules/openapi-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/package.json index b95f70f0d33..3ce77f14101 100644 --- a/modules/openapi-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/package.json +++ b/modules/openapi-generator/src/test/resources/integrationtests/typescript/objectsWithEnums-expected/package.json @@ -20,7 +20,7 @@ "rewire": "^3.0.2" }, "devDependencies": { - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "@types/node": "8.10.34" } } diff --git a/pom.xml b/pom.xml index 246dab5cb38..c769b1b6023 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,13 @@ - + org.sonatype.oss oss-parent 5 - - + + 4.0.0 org.openapitools @@ -505,7 +507,8 @@ false min - ${project.basedir}${file.separator}spotbugs-exclude.xml + + ${project.basedir}${file.separator}spotbugs-exclude.xml @@ -1183,8 +1186,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -1214,7 +1217,7 @@ 11 11 - 0.23.1 + 1.3.0 3.1.0 1.5.0 2.11.0 @@ -1227,11 +1230,11 @@ 32.1.3-jre 4.3.1 2.15.2 - 2.15.3 - 2.15.3 + 2.16.2 + 2.16.2 0.8.10 1.15 - 4.13.2 + 5.10.2 1.6.21 1.6.21 1.18.30 @@ -1242,18 +1245,19 @@ 3.0.0 2.5.3 4.0.0-M8 - 3.0.0 + 3.2.5 4.10.0 8.8.3 3.12.0 0.10.2 + 1.9.18 1.4 4.6.1 1.7.36 3.1.12.2 io.swagger.parser.v3 - 2.1.19 - 7.5 + 2.1.22 + 7.10.2 1.34 3.4.3 1.12 diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj index addc6411ef6..51c96d7c8ea 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update annotations + false diff --git a/samples/client/echo_api/go-external-refs/client.go b/samples/client/echo_api/go-external-refs/client.go index fba23f94074..6c4adba0956 100644 --- a/samples/client/echo_api/go-external-refs/client.go +++ b/samples/client/echo_api/go-external-refs/client.go @@ -178,7 +178,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/client/echo_api/go/client.go b/samples/client/echo_api/go/client.go index fba23f94074..6c4adba0956 100644 --- a/samples/client/echo_api/go/client.go +++ b/samples/client/echo_api/go/client.go @@ -178,7 +178,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/client/echo_api/java/apache-httpclient/.github/workflows/maven.yml b/samples/client/echo_api/java/apache-httpclient/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/apache-httpclient/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/apache-httpclient/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/apache-httpclient/gradlew b/samples/client/echo_api/java/apache-httpclient/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/apache-httpclient/gradlew +++ b/samples/client/echo_api/java/apache-httpclient/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/apache-httpclient/gradlew.bat b/samples/client/echo_api/java/apache-httpclient/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/apache-httpclient/gradlew.bat +++ b/samples/client/echo_api/java/apache-httpclient/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/apache-httpclient/pom.xml b/samples/client/echo_api/java/apache-httpclient/pom.xml index 47a3274035b..45f3a1cf34d 100644 --- a/samples/client/echo_api/java/apache-httpclient/pom.xml +++ b/samples/client/echo_api/java/apache-httpclient/pom.xml @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.2.5 @@ -84,7 +84,6 @@ -Xms512m -Xmx1500m methods 10 - pertest @@ -244,11 +243,11 @@ jackson-jaxrs-json-provider ${jackson-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.openapitools jackson-databind-nullable @@ -262,8 +261,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -275,6 +274,6 @@ 2.15.2 0.2.6 1.3.5 - 4.13.2 + 5.10.2 diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 80e058ed40a..5cb4ce8d028 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.time.OffsetDateTime; -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; @@ -778,7 +777,7 @@ public class ApiClient extends JavaTimeFormatter { } return objectMapper.readValue(content, valueType); - } else if ("text/plain".equalsIgnoreCase(mimeType)) { + } else if (mimeType.toLowerCase().startsWith("text/")) { // convert input stream to string return (T) EntityUtils.toString(entity); } else { diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java index b578da3a9fe..93a9bb79d5f 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Bird.java @@ -69,7 +69,6 @@ public class Bird { this.size = size; } - public Bird color(String color) { this.color = color; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index 7e4b8a71a13..36518a6ff89 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -69,7 +69,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java index e6369b93513..bc969a431ac 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DataQuery.java @@ -79,7 +79,6 @@ public class DataQuery extends Query { this.suffix = suffix; } - public DataQuery text(String text) { this.text = text; @@ -105,7 +104,6 @@ public class DataQuery extends Query { this.text = text; } - public DataQuery date(OffsetDateTime date) { this.date = date; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java index ee0c5615180..8860fb698b9 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -146,7 +146,6 @@ public class DefaultValue { this.arrayStringEnumRefDefault = arrayStringEnumRefDefault; } - public DefaultValue arrayStringEnumDefault(List arrayStringEnumDefault) { this.arrayStringEnumDefault = arrayStringEnumDefault; @@ -180,7 +179,6 @@ public class DefaultValue { this.arrayStringEnumDefault = arrayStringEnumDefault; } - public DefaultValue arrayStringDefault(List arrayStringDefault) { this.arrayStringDefault = arrayStringDefault; @@ -214,7 +212,6 @@ public class DefaultValue { this.arrayStringDefault = arrayStringDefault; } - public DefaultValue arrayIntegerDefault(List arrayIntegerDefault) { this.arrayIntegerDefault = arrayIntegerDefault; @@ -248,7 +245,6 @@ public class DefaultValue { this.arrayIntegerDefault = arrayIntegerDefault; } - public DefaultValue arrayString(List arrayString) { this.arrayString = arrayString; @@ -282,7 +278,6 @@ public class DefaultValue { this.arrayString = arrayString; } - public DefaultValue arrayStringNullable(List arrayStringNullable) { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); @@ -328,7 +323,6 @@ public class DefaultValue { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); } - public DefaultValue arrayStringExtensionNullable(List arrayStringExtensionNullable) { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); @@ -374,7 +368,6 @@ public class DefaultValue { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); } - public DefaultValue stringNullable(String stringNullable) { this.stringNullable = JsonNullable.of(stringNullable); diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 6fdd17e70a1..29a5e596b64 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -74,7 +74,6 @@ public class NumberPropertiesOnly { this.number = number; } - public NumberPropertiesOnly _float(Float _float) { this._float = _float; @@ -100,7 +99,6 @@ public class NumberPropertiesOnly { this._float = _float; } - public NumberPropertiesOnly _double(Double _double) { this._double = _double; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index fc820163943..5e6760d0d58 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet name(String name) { this.name = name; @@ -153,7 +152,6 @@ public class Pet { this.name = name; } - public Pet category(Category category) { this.category = category; @@ -179,7 +177,6 @@ public class Pet { this.category = category; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -213,7 +210,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -247,7 +243,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java index 12711c7a6f7..001c021e29c 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Query.java @@ -39,7 +39,7 @@ import java.util.StringJoiner; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Query { public static final String JSON_PROPERTY_ID = "id"; - private Long id; + protected Long id; /** * Gets or Sets outcomes @@ -79,7 +79,7 @@ public class Query { } public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; - private List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); + protected List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); public Query() { } @@ -109,7 +109,6 @@ public class Query { this.id = id; } - public Query outcomes(List outcomes) { this.outcomes = outcomes; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index 3078c99dc9d..51168440105 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -69,7 +69,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index 9e9a64246b1..edf9518a0ac 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -78,7 +78,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.size = size; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) { this.color = color; @@ -104,7 +103,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.color = color; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) { this.id = id; @@ -130,7 +128,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.id = id; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java index 7e0076c7e6a..405db1ed671 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/CustomTest.java @@ -17,8 +17,8 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collections; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openapitools.client.api.BodyApi; import org.openapitools.client.api.QueryApi; import org.openapitools.client.model.Category; @@ -52,13 +52,13 @@ public class CustomTest { photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) ); final Pet p = bodyApi.testEchoBodyPet( queryObject ); - Assert.assertNotNull( p ); - Assert.assertEquals( "Hello World", p.getName() ); - Assert.assertEquals( Long.valueOf( 12345L ), p.getId() ); + Assertions.assertNotNull( p ); + Assertions.assertEquals( "Hello World", p.getName() ); + Assertions.assertEquals( Long.valueOf( 12345L ), p.getId() ); // response is empty body final Pet p2 = bodyApi.testEchoBodyPet( null ); - Assert.assertNull( p2 ); + Assertions.assertNull( p2 ); } /** @@ -72,7 +72,7 @@ public class CustomTest { public void testEchoBodyPetResponseString() throws ApiException { // response is empty body final String p2 = bodyApi.testEchoBodyPetResponseString( null ); - Assert.assertNull( p2 ); + Assertions.assertNull( p2 ); } /** @@ -89,7 +89,7 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueObject( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( + Assertions.assertEquals( "/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path ); } @@ -106,13 +106,13 @@ public class CustomTest { final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ). photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) ); - Assert.assertEquals( + Assertions.assertEquals( "query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", queryObject.toUrlQueryString( "query_object" ) ); final String response = api.testQueryStyleDeepObjectExplodeTrueObject( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( + Assertions.assertEquals( "/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path ); } @@ -132,7 +132,7 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueObjectAllOf( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path ); + Assertions.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path ); } /** @@ -149,7 +149,7 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueArrayString( q ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path ); + Assertions.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path ); } /** @@ -163,44 +163,44 @@ public class CustomTest { public void testQueryIntegerBooleanString() throws ApiException { final String response = api.testQueryIntegerBooleanString( 1, true, "Hello World" ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/query/integer/boolean/string?integer_query=1&boolean_query=true&string_query=Hello%20World", p.path ); + Assertions.assertEquals( "/query/integer/boolean/string?integer_query=1&boolean_query=true&string_query=Hello%20World", p.path ); } @Test public void testArrayDefaultValues() { // test array default values final DefaultValue d = new DefaultValue(); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); - Assert.assertEquals( d.getArrayStringDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertEquals( d.getArrayString(), Collections.emptyList() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertEquals( d.getArrayString(), Collections.emptyList() ); // test addItem d.addArrayStringEnumDefaultItem( DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 3 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); d.addArrayStringDefaultItem( "new item" ); - Assert.assertEquals( d.getArrayStringDefault().size(), 3 ); - Assert.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" ); d.addArrayIntegerDefaultItem( 5 ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 3 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) ); } @@ -213,26 +213,26 @@ public class CustomTest { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference() { } ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); - Assert.assertEquals( d.getArrayStringDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertEquals( d.getArrayString(), Collections.emptyList() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertEquals( d.getArrayString(), Collections.emptyList() ); - Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), + Assertions.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}" ); } @@ -245,23 +245,23 @@ public class CustomTest { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference() { } ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertEquals( d.getArrayString(), Collections.emptyList() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertEquals( d.getArrayString(), Collections.emptyList() ); - Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), + Assertions.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}" ); } @@ -274,9 +274,9 @@ public class CustomTest { try { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference() { } ); - Assert.assertTrue( false ); // the test should not reach this line + Assertions.assertTrue( false ); // the test should not reach this line } catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) { - Assert.assertEquals( e.getMessage(), + Assertions.assertEquals( e.getMessage(), "Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" + " at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])" ); } diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/AuthApiTest.java index 7fc2956fce2..81b483fa706 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/AuthApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -59,10 +59,10 @@ public class AuthApiTest { String response; api.getApiClient().setBearerToken("fixed token"); response = api.testAuthHttpBearer(); - Assert.assertTrue(response.contains("Authorization: Bearer fixed token")); + Assertions.assertTrue(response.contains("Authorization: Bearer fixed token")); api.getApiClient().setBearerToken(() -> "dynamic token"); response = api.testAuthHttpBearer(); - Assert.assertTrue(response.contains("Authorization: Bearer dynamic token")); + Assertions.assertTrue(response.contains("Authorization: Bearer dynamic token")); } } diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/BodyApiTest.java index 352e8e2e19b..ef13f819e63 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/BodyApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -29,7 +29,7 @@ import java.util.Map; /** * API tests for BodyApi */ -@Ignore +@Disabled public class BodyApiTest { private final BodyApi api = new BodyApi(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/FormApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/FormApiTest.java index 1487429390a..a308e36d2c3 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/FormApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/FormApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -28,7 +28,7 @@ import java.util.Map; /** * API tests for FormApi */ -@Ignore +@Disabled public class FormApiTest { private final FormApi api = new FormApi(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java index 989c687cb7f..3f0ec9214bf 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -29,7 +29,7 @@ import java.util.Map; /** * API tests for HeaderApi */ -@Ignore +@Disabled public class HeaderApiTest { private final HeaderApi api = new HeaderApi(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/PathApiTest.java index 5968d6614bd..3759bdee97a 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/PathApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/PathApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -29,7 +29,7 @@ import java.util.Map; /** * API tests for PathApi */ -@Ignore +@Disabled public class PathApiTest { private final PathApi api = new PathApi(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/QueryApiTest.java index 69ae8a22161..069bf4bd326 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/QueryApiTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/api/QueryApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Pet; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -30,7 +30,7 @@ import java.util.Map; /** * API tests for QueryApi */ -@Ignore +@Disabled public class QueryApiTest { private final QueryApi api = new QueryApi(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java index b96bf46b105..05ea72116b8 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdTest.java index ac9a253bb6f..31323a96d3d 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/BirdTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java index 51804e0c14c..e32182d690f 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DataQueryTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DataQueryTest.java index 9b71c406586..7916c47947c 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DataQueryTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DataQueryTest.java @@ -22,9 +22,9 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.Query; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java index 8adf113d6ea..4de417ac032 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java @@ -24,9 +24,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java index 2d9c5b371fe..ccc2e77abc4 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java index 2002d08bf8a..1d5a7048a56 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/QueryTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/QueryTest.java index 266a3cb6739..48e1fbe6af9 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/QueryTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/QueryTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java index 81d7f918ea0..767df43f315 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java index d1d4b9de0d5..5af2a8f54cc 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java index cdb7c02c0fd..d5d0fc51cc1 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestFormObjectMultipartRequestMarker diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java index 1fa7d643c4b..b90b1e4cd20 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java index 82e7035a25a..910af6a663d 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/feign-gson/.github/workflows/maven.yml b/samples/client/echo_api/java/feign-gson/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/feign-gson/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/feign-gson/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/feign-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/feign-gson/gradlew b/samples/client/echo_api/java/feign-gson/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/feign-gson/gradlew +++ b/samples/client/echo_api/java/feign-gson/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/feign-gson/gradlew.bat b/samples/client/echo_api/java/feign-gson/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/feign-gson/gradlew.bat +++ b/samples/client/echo_api/java/feign-gson/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/native/.github/workflows/maven.yml b/samples/client/echo_api/java/native/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/native/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/native/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/native/build.gradle b/samples/client/echo_api/java/native/build.gradle index 4e526cc1e75..751afe8baf4 100644 --- a/samples/client/echo_api/java/native/build.gradle +++ b/samples/client/echo_api/java/native/build.gradle @@ -68,7 +68,7 @@ artifacts { ext { jackson_version = "2.14.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" + junit_version = "5.10.2" httpmime_version = "4.5.13" } @@ -81,7 +81,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/native/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/native/gradlew b/samples/client/echo_api/java/native/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/native/gradlew +++ b/samples/client/echo_api/java/native/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/native/gradlew.bat b/samples/client/echo_api/java/native/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/native/gradlew.bat +++ b/samples/client/echo_api/java/native/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/native/pom.xml b/samples/client/echo_api/java/native/pom.xml index 704df147082..5637e81399a 100644 --- a/samples/client/echo_api/java/native/pom.xml +++ b/samples/client/echo_api/java/native/pom.xml @@ -57,7 +57,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.2.5 conf/log4j.properties @@ -242,8 +242,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -257,7 +257,7 @@ 0.2.6 1.3.5 4.5.14 - 4.13.2 + 5.10.2 2.27.2 diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java index 27a201a86ee..21715b2a07d 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java @@ -453,7 +453,10 @@ public class QueryApi { String localVarQueryParameterBaseName; localVarQueryParameterBaseName = "query_object"; if (queryObject != null) { - localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object")); + String queryString = queryObject.toUrlQueryString("query_object"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } } if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { @@ -546,7 +549,10 @@ public class QueryApi { String localVarQueryParameterBaseName; localVarQueryParameterBaseName = "query_object"; if (queryObject != null) { - localVarQueryStringJoiner.add(queryObject.toUrlQueryString("query_object")); + String queryString = queryObject.toUrlQueryString("query_object"); + if (!queryString.isBlank()) { + localVarQueryStringJoiner.add(queryString); + } } if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java index 0b2a52f9434..9aed8d9bef4 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/CustomTest.java @@ -22,8 +22,8 @@ import java.util.Arrays; import java.util.List; import java.util.Objects; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.openapitools.client.api.BodyApi; import org.openapitools.client.api.FormApi; import org.openapitools.client.api.QueryApi; @@ -60,13 +60,13 @@ public class CustomTest { photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) ); final Pet p = bodyApi.testEchoBodyPet( queryObject ); - Assert.assertNotNull( p ); - Assert.assertEquals( "Hello World", p.getName() ); - Assert.assertEquals( Long.valueOf( 12345L ), p.getId() ); + Assertions.assertNotNull( p ); + Assertions.assertEquals( "Hello World", p.getName() ); + Assertions.assertEquals( Long.valueOf( 12345L ), p.getId() ); // response is empty body final Pet p2 = bodyApi.testEchoBodyPet( null ); - Assert.assertNull( p2 ); + Assertions.assertNull( p2 ); } /** @@ -82,13 +82,13 @@ public class CustomTest { photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) ); final Pet p = bodyApi.testEchoBodyAllOfPet( queryObject ); - Assert.assertNotNull( p ); - Assert.assertEquals( "Hello World", p.getName() ); - Assert.assertEquals( Long.valueOf( 12345L ), p.getId() ); + Assertions.assertNotNull( p ); + Assertions.assertEquals( "Hello World", p.getName() ); + Assertions.assertEquals( Long.valueOf( 12345L ), p.getId() ); // response is empty body final Pet p2 = bodyApi.testEchoBodyPet( null ); - Assert.assertNull( p2 ); + Assertions.assertNull( p2 ); } /** @@ -105,7 +105,7 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueObject( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( + Assertions.assertEquals( "/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path ); } @@ -125,7 +125,7 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueObjectAllOf( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path ); + Assertions.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path ); } /** @@ -140,13 +140,13 @@ public class CustomTest { final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ). photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) ); - Assert.assertEquals( + Assertions.assertEquals( "query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", queryObject.toUrlQueryString( "query_object" ) ); final String response = api.testQueryStyleDeepObjectExplodeTrueObject( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( + Assertions.assertEquals( "/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path ); } @@ -164,12 +164,12 @@ public class CustomTest { 12345L ).name( "Hello World" ). color( "red" ).size( "small" ); - Assert.assertEquals( "query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", + Assertions.assertEquals( "query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", queryObject.toUrlQueryString( "query_object" ) ); final String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf( queryObject ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( + Assertions.assertEquals( "/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path ); } @@ -188,45 +188,45 @@ public class CustomTest { final String response = api.testQueryStyleFormExplodeTrueArrayString( q ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path ); + Assertions.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path ); } @Test public void testArrayDefaultValues() { // test array default values final DefaultValue d = new DefaultValue(); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); - Assert.assertEquals( d.getArrayStringDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertNull( d.getArrayStringExtensionNullable() ); - Assert.assertEquals( d.getArrayString(), List.of() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertNull( d.getArrayStringExtensionNullable() ); + Assertions.assertEquals( d.getArrayString(), List.of() ); // test addItem d.addArrayStringEnumDefaultItem( DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 3 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); d.addArrayStringDefaultItem( "new item" ); - Assert.assertEquals( d.getArrayStringDefault().size(), 3 ); - Assert.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" ); d.addArrayIntegerDefaultItem( 5 ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 3 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 3 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) ); } @Test @@ -238,27 +238,27 @@ public class CustomTest { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() { } ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE ); - Assert.assertEquals( d.getArrayStringDefault().size(), 2 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertNull( d.getArrayStringExtensionNullable() ); - Assert.assertEquals( d.getArrayString(), List.of() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertNull( d.getArrayStringExtensionNullable() ); + Assertions.assertEquals( d.getArrayString(), List.of() ); - Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), + Assertions.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}" ); } @@ -271,24 +271,24 @@ public class CustomTest { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() { } ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringEnumDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); + Assertions.assertEquals( d.getArrayStringEnumDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED ); - Assert.assertEquals( d.getArrayStringDefault().size(), 1 ); - Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); + Assertions.assertEquals( d.getArrayStringDefault().size(), 1 ); + Assertions.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" ); - Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); - Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().size(), 2 ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) ); + Assertions.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) ); - Assert.assertNull( d.getArrayStringNullable() ); - Assert.assertNull( d.getArrayStringExtensionNullable() ); - Assert.assertEquals( d.getArrayString(), List.of() ); + Assertions.assertNull( d.getArrayStringNullable() ); + Assertions.assertNull( d.getArrayStringExtensionNullable() ); + Assertions.assertEquals( d.getArrayString(), List.of() ); - Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), + Assertions.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}" ); } @@ -301,9 +301,9 @@ public class CustomTest { try { final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() { } ); - Assert.assertTrue( false ); // the test should not reach this line + Assertions.assertTrue( false ); // the test should not reach this line } catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) { - Assert.assertEquals( e.getMessage(), + Assertions.assertEquals( e.getMessage(), "Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" + " at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])" ); } @@ -324,8 +324,8 @@ public class CustomTest { final String stringForm = "Hello World"; final String response = formApi.testFormIntegerBooleanString( integerForm, booleanForm, stringForm ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/form/integer/boolean/string", p.path ); - Assert.assertEquals( "3b\ninteger_form=1337&boolean_form=true&string_form=Hello+World\n0\n\n", p.body ); + Assertions.assertEquals( "/form/integer/boolean/string", p.path ); + Assertions.assertEquals( "3b\ninteger_form=1337&boolean_form=true&string_form=Hello+World\n0\n\n", p.body ); } @Test @@ -336,8 +336,8 @@ public class CustomTest { final Boolean form4 = true; final String response = formApi.testFormOneof( form1, form2, form3, form4, null, null ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/form/oneof", p.path ); - Assert.assertEquals( "3c\nform1=form1_example&form2=56&form3=form3++example&form4=true\n0\n\n", p.body ); + Assertions.assertEquals( "/form/oneof", p.path ); + Assertions.assertEquals( "3c\nform1=form1_example&form2=56&form3=form3++example&form4=true\n0\n\n", p.body ); } @Test @@ -348,12 +348,12 @@ public class CustomTest { final String response = bodyApi.testBodyMultipartFormdataArrayOfBinary( List.of( file1, file2 ) ); final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response ); - Assert.assertEquals( "/body/application/octetstream/array_of_binary", p.path ); + Assertions.assertEquals( "/body/application/octetstream/array_of_binary", p.path ); - Assert.assertTrue( p.body.contains( file1.getName() ) ); - Assert.assertTrue( p.body.contains( "Hello" ) ); - Assert.assertTrue( p.body.contains( file2.getName() ) ); - Assert.assertTrue( p.body.contains( "World" ) ); + Assertions.assertTrue( p.body.contains( file1.getName() ) ); + Assertions.assertTrue( p.body.contains( "Hello" ) ); + Assertions.assertTrue( p.body.contains( file2.getName() ) ); + Assertions.assertTrue( p.body.contains( "World" ) ); } private File getFile( final String content ) { diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/AuthApiTest.java index 35d1b0316c7..0efd63dfdd6 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/AuthApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -13,21 +13,15 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for AuthApi */ -@Ignore +@Disabled public class AuthApiTest { private final AuthApi api = new AuthApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/BodyApiTest.java index fc14326e06a..04bcdb16a4a 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/BodyApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -13,22 +13,16 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for BodyApi */ -@Ignore +@Disabled public class BodyApiTest { private final BodyApi api = new BodyApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/FormApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/FormApiTest.java index 701f505c91d..c9fd883d79a 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/FormApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/FormApiTest.java @@ -13,21 +13,15 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for FormApi */ -@Ignore +@Disabled public class FormApiTest { private final FormApi api = new FormApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/HeaderApiTest.java index 61b3dc5c0a7..844eb5b3320 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/HeaderApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/HeaderApiTest.java @@ -13,22 +13,16 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for HeaderApi */ -@Ignore +@Disabled public class HeaderApiTest { private final HeaderApi api = new HeaderApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/PathApiTest.java index 1b71c16a2c4..b0b834a71d2 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/PathApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/PathApiTest.java @@ -13,22 +13,16 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for PathApi */ -@Ignore +@Disabled public class PathApiTest { private final PathApi api = new PathApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/QueryApiTest.java index 5ee9ec290b2..13332bb48e8 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/QueryApiTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/api/QueryApiTest.java @@ -13,22 +13,16 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; /** * API tests for QueryApi */ -@Ignore +@Disabled public class QueryApiTest { private final QueryApi api = new QueryApi(); diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java index b96bf46b105..22e6d18b513 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdAndCategoryTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdTest.java index ac9a253bb6f..87bd92ba563 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/BirdTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java index 34ead48f650..f97a4c0d43f 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DataQueryTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DataQueryTest.java index 9b71c406586..29ffada7a6e 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DataQueryTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DataQueryTest.java @@ -13,18 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Query; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DefaultValueTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DefaultValueTest.java index 809a14bb008..79dd6be90b7 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DefaultValueTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/DefaultValueTest.java @@ -13,20 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/EnumStringRefTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/EnumStringRefTest.java index 3621b1d0af5..019d6f24133 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/EnumStringRefTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/EnumStringRefTest.java @@ -13,9 +13,7 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java index 2d9c5b371fe..69479f24a76 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -13,15 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/PetTest.java index 918a3b16921..d537ddc510a 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/PetTest.java @@ -13,18 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/QueryTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/QueryTest.java index 266a3cb6739..ff1ddefbf5d 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/QueryTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/QueryTest.java @@ -13,16 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/StringEnumRefTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/StringEnumRefTest.java index 81d7f918ea0..933cc143850 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/StringEnumRefTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/StringEnumRefTest.java @@ -13,9 +13,7 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TagTest.java index 342e15ae49d..050e9a3a167 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TagTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java index f4dc3543e6c..e1bb4f420c4 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java @@ -13,15 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for TestFormObjectMultipartRequestMarker diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java index 29cfa46182a..8214380df37 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java index 4d1e8e89d49..555aaba7e52 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java @@ -13,16 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameterTest.java b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameterTest.java index c620d9aa9cc..95892feacec 100644 --- a/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/native/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueObjectAllOfQueryObjectParameterTest.java @@ -13,14 +13,7 @@ package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.github/workflows/maven.yml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.github/workflows/maven.yml new file mode 100644 index 00000000000..460f78bfd1b --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.gitignore b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore rename to samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator-ignore diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/FILES b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/FILES new file mode 100644 index 00000000000..d4b634f6f4e --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +api/openapi.yaml +build.gradle +build.sbt +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApiDocumentation.md +docs/StoreApiDocumentation.md +docs/Tag.md +docs/User.md +docs/UserApiDocumentation.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +info.md +modelCopy/Category.java +modelCopy/ModelApiResponse.java +modelCopy/Order.java +modelCopy/Pet.java +modelCopy/Tag.java +modelCopy/User.java +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/VERSION b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.travis.yml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/api/openapi.yaml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/api/openapi.yaml new file mode 100644 index 00000000000..cd0be0cc180 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/api/openapi.yaml @@ -0,0 +1,870 @@ +openapi: 3.0.0 +info: + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + - application/xml + put: + description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: + - application/json + - application/xml + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: + - application/json + - application/xml + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: + - application/json + - application/xml + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: + - application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /store/order/{orderId}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: orderId + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: orderId + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - api_key: [] + summary: Delete user + tags: + - user + x-accepts: + - application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + security: + - api_key: [] + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle new file mode 100644 index 00000000000..ba29ee2b2f7 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle @@ -0,0 +1,169 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'java' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} +sourceSets { + main.java.srcDirs = ['src/main/java'] +} + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task) + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'openapi-java-client' + from components.java + } + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jakarta_annotation_version = "1.3.5" +} + +dependencies { + implementation 'io.swagger:swagger-annotations:1.6.8' + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + implementation 'com.google.code.gson:gson:2.9.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'javax.ws.rs:jsr311-api:1.1.1' + implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'org.openapitools:jackson-databind-nullable:0.2.6' + implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.mockito:mockito-core:3.12.4' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + + removeUnusedImports() + importOrder() + } +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt new file mode 100644 index 00000000000..cef996ca186 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt @@ -0,0 +1,29 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "openapi-java-client", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.6.5", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", + "com.google.code.gson" % "gson" % "2.9.1", + "org.apache.commons" % "commons-lang3" % "3.12.0", + "javax.ws.rs" % "jsr311-api" % "1.1.1", + "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", + "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test", + "org.mockito" % "mockito-core" % "3.12.4" % "test" + ) + ) diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Category.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Category.md new file mode 100644 index 00000000000..a7fc939d252 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Category.md @@ -0,0 +1,15 @@ + + +# Category + +A category for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/ModelApiResponse.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/ModelApiResponse.md new file mode 100644 index 00000000000..cd7e3c400be --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/ModelApiResponse.md @@ -0,0 +1,16 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Order.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Order.md new file mode 100644 index 00000000000..0c33059b8b6 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Order.md @@ -0,0 +1,29 @@ + + +# Order + +An order for a pets from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Pet.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Pet.md new file mode 100644 index 00000000000..8bb36330123 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Pet.md @@ -0,0 +1,29 @@ + + +# Pet + +A pet for sale in the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **List<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/PetApiDocumentation.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/PetApiDocumentation.md new file mode 100644 index 00000000000..f395ba3f6f1 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/PetApiDocumentation.md @@ -0,0 +1,570 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +# **addPet** +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.addPet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**List<String>**](String.md)| Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +# **updatePet** +> Pet updatePet(pet) + +Update an existing pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.updatePet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/StoreApiDocumentation.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/StoreApiDocumentation.md new file mode 100644 index 00000000000..af54298ffc2 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/StoreApiDocumentation.md @@ -0,0 +1,266 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Tag.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Tag.md new file mode 100644 index 00000000000..abfde4afb50 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/Tag.md @@ -0,0 +1,15 @@ + + +# Tag + +A tag for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/User.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/User.md new file mode 100644 index 00000000000..426845227bd --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/User.md @@ -0,0 +1,21 @@ + + +# User + +A User who is purchasing from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/UserApiDocumentation.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/UserApiDocumentation.md new file mode 100644 index 00000000000..4c338a42137 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/docs/UserApiDocumentation.md @@ -0,0 +1,553 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +null (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle.properties b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew.bat b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/info.md b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/info.md new file mode 100644 index 00000000000..79b65800b0a --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/info.md @@ -0,0 +1,184 @@ +# openapi-java-client + +OpenAPI Petstore +- API version: 1.0.0 + - Generator version: 8.0.0-SNAPSHOT + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.8+ +2. Maven (3.8.3+)/Gradle (7.2+) + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:openapi-java-client:1.0.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.0.0.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.addPet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [Category](docs/Category.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [Order](docs/Order.md) + - [Pet](docs/Pet.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Category.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Category.java new file mode 100644 index 00000000000..6ec7a3cf48c --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Category.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Category + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category { + public Category() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Category + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/ModelApiResponse.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/ModelApiResponse.java new file mode 100644 index 00000000000..38a67fbd14e --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/ModelApiResponse.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * ModelApiResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelApiResponse { + public ModelApiResponse() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelApiResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelApiResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Order.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Order.java new file mode 100644 index 00000000000..70e2676c4e0 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Order.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Order + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Order { + public Order() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Order + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Order.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Pet.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Pet.java new file mode 100644 index 00000000000..f7a3ed81d8e --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Pet.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Pet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet { + public Pet() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Pet + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Tag.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Tag.java new file mode 100644 index 00000000000..76c04ff9174 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/Tag.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Tag + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag { + public Tag() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Tag + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/User.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/User.java new file mode 100644 index 00000000000..81bf3bd496d --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/modelCopy/User.java @@ -0,0 +1,151 @@ +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * User + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class User { + public User() { + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml new file mode 100644 index 00000000000..6d7d759f353 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml @@ -0,0 +1,349 @@ + + 4.0.0 + org.openapitools + openapi-java-client + jar + openapi-java-client + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + 10 + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + 3.6.1 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.5.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.squareup.okhttp3 + okhttp + ${okhttp-version} + + + com.squareup.okhttp3 + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.2 + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + javax.ws.rs + jsr311-api + ${jsr311-api-version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api-version} + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.9.0 + 4.11.0 + 2.10.1 + 3.14.0 + 0.2.6 + 1.3.5 + 5.10.2 + 1.10.0 + 2.1.1 + 1.1.1 + UTF-8 + 2.43.0 + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/settings.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/settings.gradle new file mode 100644 index 00000000000..369ba54a9e0 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/AndroidManifest.xml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiCallback.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiCallback.java new file mode 100644 index 00000000000..e818a511443 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..a524171d7e1 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,1660 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.OAuth; +import org.openapitools.client.auth.RetryingOAuth; +import org.openapitools.client.auth.OAuthFlow; + +/** + *

    ApiClient class.

    + */ +public class ApiClient { + + private String basePath = "http://petstore.swagger.io/v2"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private Map defaultCookieMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("petstore_auth", new OAuth()); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("petstore_auth", new OAuth()); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID + * + * @param clientId client ID + */ + public ApiClient(String clientId) { + this(clientId, null, null); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters + * + * @param clientId client ID + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, Map parameters) { + this(clientId, null, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters + * + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String clientId, String clientSecret, Map parameters) { + this(null, clientId, clientSecret, parameters); + } + + /** + * Constructor for ApiClient to support access token retry on 401/403 configured with base path, client ID, secret, and additional parameters + * + * @param basePath base path + * @param clientId client ID + * @param clientSecret client secret + * @param parameters a {@link java.util.Map} of parameters + */ + public ApiClient(String basePath, String clientId, String clientSecret, Map parameters) { + init(); + if (basePath != null) { + this.basePath = basePath; + } + + String tokenUrl = ""; + if (!"".equals(tokenUrl) && !URI.create(tokenUrl).isAbsolute()) { + URI uri = URI.create(getBasePath()); + tokenUrl = uri.getScheme() + ":" + + (uri.getAuthority() != null ? "//" + uri.getAuthority() : "") + + tokenUrl; + if (!URI.create(tokenUrl).isAbsolute()) { + throw new IllegalArgumentException("OAuth2 token URL must be an absolute URL"); + } + } + RetryingOAuth retryingOAuth = new RetryingOAuth(tokenUrl, clientId, OAuthFlow.IMPLICIT, clientSecret, parameters); + authentications.put( + "petstore_auth", + retryingOAuth + ); + initHttpClient(Collections.singletonList(retryingOAuth)); + // Setup authentications (key: authentication name, value: authentication). + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.emptyList()); + } + + private void initHttpClient(List interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://petstore.swagger.io/v2 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field keyManagers.

    + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + *

    Getter for the field dateFormat.

    + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + *

    Setter for the field dateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + *

    Set SqlDateFormat.

    + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + *

    Set OffsetDateTimeFormat.

    + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + *

    Set LocalDateFormat.

    + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + *

    Set LenientOnJson.

    + * + * @param lenientOnJson a boolean + * @return a {@link org.openapitools.client.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * + * @return Token request builder + */ + public TokenRequestBuilder getTokenEndPoint() { + for (Authentication apiAuth : authentications.values()) { + if (apiAuth instanceof RetryingOAuth) { + RetryingOAuth retryingOAuth = (RetryingOAuth) apiAuth; + return retryingOAuth.getTokenRequestBuilder(); + } + } + return null; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws org.openapitools.client.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws org.openapitools.client.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws org.openapitools.client.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws org.openapitools.client.ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws org.openapitools.client.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws org.openapitools.client.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { + // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams + List allQueryParams = new ArrayList(queryParams); + allQueryParams.addAll(collectionQueryParams); + + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + // update parameters with authentication settings + updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(baseUrl).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map cookieParams, Request.Builder reqBuilder) { + for (Entry param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws org.openapitools.client.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws org.openapitools.client.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiException.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 00000000000..7ab672dda00 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,167 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + + +/** + *

    ApiException class.

    + */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + /** + *

    Constructor for ApiException.

    + */ + public ApiException() {} + + /** + *

    Constructor for ApiException.

    + * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + *

    Constructor for ApiException.

    + * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..189537deb54 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + *

    Constructor for ApiResponse.

    + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + *

    Get the status code.

    + * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + *

    Get the headers.

    + * + * @return a {@link java.util.Map} of headers + */ + public Map> getHeaders() { + return headers; + } + + /** + *

    Get the data.

    + * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Configuration.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 00000000000..d926d3e048a --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Configuration { + public static final String VERSION = "1.0.0"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/GzipRequestInterceptor.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/GzipRequestInterceptor.java new file mode 100644 index 00000000000..69ea613c837 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/JSON.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 00000000000..ad2d26cbfbb --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,413 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; +import java.util.TimeZone; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + private static final StdDateFormat sdf = new StdDateFormat() + .withTimeZone(TimeZone.getTimeZone(ZoneId.systemDefault())) + .withColonInTimeZone(true); + private static final DateTimeFormatter dtf = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Category.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ModelApiResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(sdf.parse(date).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, DateTimeFormatter will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toInstant().atOffset(ZoneOffset.UTC).format(dtf); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return sdf.parse(date); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Pair.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..5eb72d172c9 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressRequestBody.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressRequestBody.java new file mode 100644 index 00000000000..673ffc4cbb7 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressResponseBody.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressResponseBody.java new file mode 100644 index 00000000000..10eeda6a297 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..ca5c3724482 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..00d527328c7 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..fbe3a149847 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..2c57d0c17dc --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,1155 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PetApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PetApi() { + this(Configuration.getDefaultApiClient()); + } + + public PetApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addPet + * @param pet Pet object that needs to be added to the store (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details +
    {{name}}{{baseName}} {{#datatype}}{{dataType}}{{/datatype}} {{dataFormat}} {{description}}
    + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public okhttp3.Call addPetCall(Pet pet, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = pet; + + // create path and map variables + String localVarPath = "/pet"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/xml" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); + } + + return addPetCall(pet, _callback); + + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public Pet addPet(Pet pet) throws ApiException { + ApiResponse localVarResp = addPetWithHttpInfo(pet); + return localVarResp.getData(); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add a new pet to the store (asynchronously) + * + * @param pet Pet object that needs to be added to the store (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public okhttp3.Call addPetAsync(Pet pet, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addPetValidateBeforeCall(pet, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deletePet + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (apiKey != null) { + localVarHeaderParams.put("api_key", localVarApiClient.parameterToString(apiKey)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); + } + + return deletePetCall(petId, apiKey, _callback); + + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public void deletePet(Long petId, String apiKey) throws ApiException { + deletePetWithHttpInfo(petId, apiKey); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Deletes a pet (asynchronously) + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Invalid pet value -
    + */ + public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePetValidateBeforeCall(petId, apiKey, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for findPetsByStatus + * @param status Status values that need to be considered for filter (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/findByStatus"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (status != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "status", status)); + } + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call findPetsByStatusValidateBeforeCall(List status, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); + } + + return findPetsByStatusCall(status, _callback); + + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public List findPetsByStatus(List status) throws ApiException { + ApiResponse> localVarResp = findPetsByStatusWithHttpInfo(status); + return localVarResp.getData(); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { + okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Finds Pets by status (asynchronously) + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for findPetsByTags + * @param tags Tags to filter by (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/findByTags"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (tags != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "tags", tags)); + } + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); + } + + return findPetsByTagsCall(tags, _callback); + + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public List findPetsByTags(List tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + return localVarResp.getData(); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Finds Pets by tags (asynchronously) + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPetById + * @param petId ID of pet to return (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); + } + + return getPetByIdCall(petId, _callback); + + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public Pet getPetById(Long petId) throws ApiException { + ApiResponse localVarResp = getPetByIdWithHttpInfo(petId); + return localVarResp.getData(); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Find pet by ID (asynchronously) + * Returns a single pet + * @param petId ID of pet to return (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public okhttp3.Call getPetByIdAsync(Long petId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePet + * @param pet Pet object that needs to be added to the store (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + */ + public okhttp3.Call updatePetCall(Pet pet, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = pet; + + // create path and map variables + String localVarPath = "/pet"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/xml" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); + } + + return updatePetCall(pet, _callback); + + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return Pet + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + */ + public Pet updatePet(Pet pet) throws ApiException { + ApiResponse localVarResp = updatePetWithHttpInfo(pet); + return localVarResp.getData(); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Pet> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + */ + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an existing pet (asynchronously) + * + * @param pet Pet object that needs to be added to the store (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + * API documentation for the updatePet operation + * @see Update an existing pet Documentation + */ + public okhttp3.Call updatePetAsync(Pet pet, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePetValidateBeforeCall(pet, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePetWithForm + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (name != null) { + localVarFormParams.put("name", name); + } + + if (status != null) { + localVarFormParams.put("status", status); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); + } + + return updatePetWithFormCall(petId, name, status, _callback); + + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Updates a pet in the store with form data (asynchronously) + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePetWithFormValidateBeforeCall(petId, name, status, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for uploadFile + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/pet/{petId}/uploadImage" + .replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (additionalMetadata != null) { + localVarFormParams.put("additionalMetadata", additionalMetadata); + } + + if (_file != null) { + localVarFormParams.put("file", _file); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); + } + + return uploadFileCall(petId, additionalMetadata, _file, _callback); + + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException { + ApiResponse localVarResp = uploadFileWithHttpInfo(petId, additionalMetadata, _file); + return localVarResp.getData(); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * uploads an image (asynchronously) + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, _file, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..df8db739366 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,570 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.Order; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class StoreApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public StoreApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoreApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for deleteOrder + * @param orderId ID of the order that needs to be deleted (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/order/{orderId}" + .replace("{" + "orderId" + "}", localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); + } + + return deleteOrderCall(orderId, _callback); + + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public void deleteOrder(String orderId) throws ApiException { + deleteOrderWithHttpInfo(orderId); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { + okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete purchase order by ID (asynchronously) + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrderValidateBeforeCall(orderId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getInventory + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/inventory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getInventoryCall(_callback); + + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map<String, Integer> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Map getInventory() throws ApiException { + ApiResponse> localVarResp = getInventoryWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns pet inventories by status (asynchronously) + * Returns a map of status codes to quantities + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public okhttp3.Call getInventoryAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getInventoryValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrderById + * @param orderId ID of pet that needs to be fetched (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/order/{orderId}" + .replace("{" + "orderId" + "}", localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); + } + + return getOrderByIdCall(orderId, _callback); + + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public Order getOrderById(Long orderId) throws ApiException { + ApiResponse localVarResp = getOrderByIdWithHttpInfo(orderId); + return localVarResp.getData(); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Find purchase order by ID (asynchronously) + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public okhttp3.Call getOrderByIdAsync(Long orderId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for placeOrder + * @param order order placed for purchasing the pet (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public okhttp3.Call placeOrderCall(Order order, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = order; + + // create path and map variables + String localVarPath = "/store/order"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); + } + + return placeOrderCall(order, _callback); + + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public Order placeOrder(Order order) throws ApiException { + ApiResponse localVarResp = placeOrderWithHttpInfo(order); + return localVarResp.getData(); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Place an order for a pet (asynchronously) + * + * @param order order placed for purchasing the pet (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public okhttp3.Call placeOrderAsync(Order order, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..7b8cb5c3dcb --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,1068 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createUser + * @param user Created user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUserCall(User user, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); + } + + return createUserCall(user, _callback); + + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create user (asynchronously) + * This can only be done by the logged in user. + * @param user Created user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUserAsync(User user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUserValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for createUsersWithArrayInput + * @param user List of user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithArrayInputCall(List user, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/createWithArray"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)"); + } + + return createUsersWithArrayInputCall(user, _callback); + + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates list of users with given input array (asynchronously) + * + * @param user List of user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithArrayInputAsync(List user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUsersWithArrayInputValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for createUsersWithListInput + * @param user List of user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithListInputCall(List user, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/createWithList"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUsersWithListInputValidateBeforeCall(List user, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)"); + } + + return createUsersWithListInputCall(user, _callback); + + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates list of users with given input array (asynchronously) + * + * @param user List of user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call createUsersWithListInputAsync(List user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createUsersWithListInputValidateBeforeCall(user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteUser + * @param username The name that needs to be deleted (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/{username}" + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); + } + + return deleteUserCall(username, _callback); + + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public void deleteUser(String username) throws ApiException { + deleteUserWithHttpInfo(username); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete user (asynchronously) + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call deleteUserAsync(String username, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteUserValidateBeforeCall(username, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getUserByName + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/{username}" + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); + } + + return getUserByNameCall(username, _callback); + + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public User getUserByName(String username) throws ApiException { + ApiResponse localVarResp = getUserByNameWithHttpInfo(username); + return localVarResp.getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { + okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get user by user name (asynchronously) + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public okhttp3.Call getUserByNameAsync(String username, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for loginUser + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/login"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (password != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("password", password)); + } + + final String[] localVarAccepts = { + "application/xml", + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); + } + + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); + } + + return loginUserCall(username, password, _callback); + + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public String loginUser(String username, String password) throws ApiException { + ApiResponse localVarResp = loginUserWithHttpInfo(username, password); + return localVarResp.getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { + okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Logs user into the system (asynchronously) + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public okhttp3.Call loginUserAsync(String username, String password, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for logoutUser + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/logout"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return logoutUserCall(_callback); + + } + + /** + * Logs out current logged in user session + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void logoutUser() throws ApiException { + logoutUserWithHttpInfo(); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = logoutUserValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Logs out current logged in user session (asynchronously) + * + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public okhttp3.Call logoutUserAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = logoutUserValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateUser + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public okhttp3.Call updateUserCall(String username, User user, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = user; + + // create path and map variables + String localVarPath = "/user/{username}" + .replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "api_key" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); + } + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); + } + + return updateUserCall(username, user, _callback); + + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Updated user (asynchronously) + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public okhttp3.Call updateUserAsync(String username, User user, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateUserValidateBeforeCall(username, user, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..45fd5ffb5f9 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..6424dc10e12 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f40a47ba215 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..1eaee745000 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 00000000000..a4227d00c50 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; +import org.openapitools.client.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 00000000000..ba716907969 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,25 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +/** + * OAuth flows that are supported by this client + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public enum OAuthFlow { + ACCESS_CODE, //called authorizationCode in OpenAPI 3.0 + IMPLICIT, + PASSWORD, + APPLICATION //called clientCredentials in OpenAPI 3.0 +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java new file mode 100644 index 00000000000..d266db0e95a --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java @@ -0,0 +1,69 @@ +package org.openapitools.client.auth; + +import okhttp3.OkHttpClient; +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.HttpClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthClientResponse; +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; + +public class OAuthOkHttpClient implements HttpClient { + private OkHttpClient client; + + public OAuthOkHttpClient() { + this.client = new OkHttpClient(); + } + + public OAuthOkHttpClient(OkHttpClient client) { + this.client = client; + } + + @Override + public T execute(OAuthClientRequest request, Map headers, + String requestMethod, Class responseClass) + throws OAuthSystemException, OAuthProblemException { + + MediaType mediaType = MediaType.parse("application/json"); + Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); + + if(headers != null) { + for (Entry entry : headers.entrySet()) { + if (entry.getKey().equalsIgnoreCase("Content-Type")) { + mediaType = MediaType.parse(entry.getValue()); + } else { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + } + } + + RequestBody body = request.getBody() != null ? RequestBody.create(request.getBody(), mediaType) : null; + requestBuilder.method(requestMethod, body); + + try { + Response response = client.newCall(requestBuilder.build()).execute(); + return OAuthClientResponseFactory.createCustomResponse( + response.body().string(), + response.body().contentType().toString(), + response.code(), + response.headers().toMultimap(), + responseClass); + } catch (IOException e) { + throw new OAuthSystemException(e); + } + } + + @Override + public void shutdown() { + // Nothing to do here + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/RetryingOAuth.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/RetryingOAuth.java new file mode 100644 index 00000000000..8cbe8f9e743 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/auth/RetryingOAuth.java @@ -0,0 +1,210 @@ +package org.openapitools.client.auth; + +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; + +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.types.GrantType; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class RetryingOAuth extends OAuth implements Interceptor { + private OAuthClient oAuthClient; + + private TokenRequestBuilder tokenRequestBuilder; + + /** + * @param client An OkHttp client + * @param tokenRequestBuilder A token request builder + */ + public RetryingOAuth(OkHttpClient client, TokenRequestBuilder tokenRequestBuilder) { + this.oAuthClient = new OAuthClient(new OAuthOkHttpClient(client)); + this.tokenRequestBuilder = tokenRequestBuilder; + } + + /** + * @param tokenRequestBuilder A token request builder + */ + public RetryingOAuth(TokenRequestBuilder tokenRequestBuilder) { + this(new OkHttpClient(), tokenRequestBuilder); + } + + /** + * @param tokenUrl The token URL to be used for this OAuth2 flow. + * Applicable to the following OAuth2 flows: "password", "clientCredentials" and "authorizationCode". + * The value must be an absolute URL. + * @param clientId The OAuth2 client ID for the "clientCredentials" flow. + * @param flow OAuth flow. + * @param clientSecret The OAuth2 client secret for the "clientCredentials" flow. + * @param parameters A map of string. + */ + public RetryingOAuth( + String tokenUrl, + String clientId, + OAuthFlow flow, + String clientSecret, + Map parameters + ) { + this(OAuthClientRequest.tokenLocation(tokenUrl) + .setClientId(clientId) + .setClientSecret(clientSecret)); + setFlow(flow); + if (parameters != null) { + for (Map.Entry entry : parameters.entrySet()) { + tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue()); + } + } + } + + /** + * Set the OAuth flow + * + * @param flow The OAuth flow. + */ + public void setFlow(OAuthFlow flow) { + switch(flow) { + case ACCESS_CODE: + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); + break; + case IMPLICIT: + tokenRequestBuilder.setGrantType(GrantType.IMPLICIT); + break; + case PASSWORD: + tokenRequestBuilder.setGrantType(GrantType.PASSWORD); + break; + case APPLICATION: + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); + break; + default: + break; + } + } + + @Override + public Response intercept(Chain chain) throws IOException { + return retryingIntercept(chain, true); + } + + private Response retryingIntercept(Chain chain, boolean updateTokenAndRetryOnAuthorizationFailure) throws IOException { + Request request = chain.request(); + + // If the request already has an authorization (e.g. Basic auth), proceed with the request as is + if (request.header("Authorization") != null) { + return chain.proceed(request); + } + + // Get the token if it has not yet been acquired + if (getAccessToken() == null) { + updateAccessToken(null); + } + + OAuthClientRequest oAuthRequest; + if (getAccessToken() != null) { + // Build the request + Request.Builder requestBuilder = request.newBuilder(); + + String requestAccessToken = getAccessToken(); + try { + oAuthRequest = + new OAuthBearerClientRequest(request.url().toString()). + setAccessToken(requestAccessToken). + buildHeaderMessage(); + } catch (OAuthSystemException e) { + throw new IOException(e); + } + + Map headers = oAuthRequest.getHeaders(); + for (Map.Entry entry : headers.entrySet()) { + requestBuilder.addHeader(entry.getKey(), entry.getValue()); + } + requestBuilder.url(oAuthRequest.getLocationUri()); + + // Execute the request + Response response = chain.proceed(requestBuilder.build()); + + // 401/403 response codes most likely indicate an expired access token, unless it happens two times in a row + if ( + response != null && + ( response.code() == HttpURLConnection.HTTP_UNAUTHORIZED || + response.code() == HttpURLConnection.HTTP_FORBIDDEN ) && + updateTokenAndRetryOnAuthorizationFailure + ) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body().close(); + return retryingIntercept(chain, false); + } + } catch (Exception e) { + response.body().close(); + throw e; + } + } + return response; + } + else { + return chain.proceed(chain.request()); + } + } + + /** + * Returns true if the access token has been updated + * + * @param requestAccessToken the request access token + * @return True if the update is successful + * @throws java.io.IOException If fail to update the access token + */ + public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + try { + OAuthJSONAccessTokenResponse accessTokenResponse = + oAuthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken()); + } + } catch (OAuthSystemException | OAuthProblemException e) { + throw new IOException(e); + } + } + return getAccessToken() == null || !getAccessToken().equals(requestAccessToken); + } + + /** + * Gets the token request builder + * + * @return A token request builder + */ + public TokenRequestBuilder getTokenRequestBuilder() { + return tokenRequestBuilder; + } + + /** + * Sets the token request builder + * + * @param tokenRequestBuilder Token request builder + */ + public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { + this.tokenRequestBuilder = tokenRequestBuilder; + } + + // Applying authorization to parameters is performed in the retryingIntercept method + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + // No implementation necessary + } +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 00000000000..987568e3781 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..08671d8fa16 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,232 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A category for a pet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public Category() { + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Category + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Category.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Category.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Category' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Category.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Category value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Category read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..b7a4beed721 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Describes the result of uploading an image resource + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelApiResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private Integer code; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ModelApiResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ModelApiResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelApiResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelApiResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelApiResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelApiResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelApiResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Order.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..e0e897a85c8 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,395 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * An order for a pets from the pet store + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Order { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_PET_ID = "petId"; + @SerializedName(SERIALIZED_NAME_PET_ID) + private Long petId; + + public static final String SERIALIZED_NAME_QUANTITY = "quantity"; + @SerializedName(SERIALIZED_NAME_QUANTITY) + private Integer quantity; + + public static final String SERIALIZED_NAME_SHIP_DATE = "shipDate"; + @SerializedName(SERIALIZED_NAME_SHIP_DATE) + private OffsetDateTime shipDate; + + /** + * Order Status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_COMPLETE = "complete"; + @SerializedName(SERIALIZED_NAME_COMPLETE) + private Boolean complete = false; + + public Order() { + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @javax.annotation.Nullable + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @javax.annotation.Nullable + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @javax.annotation.Nullable + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @javax.annotation.Nullable + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("petId"); + openapiFields.add("quantity"); + openapiFields.add("shipDate"); + openapiFields.add("status"); + openapiFields.add("complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Order + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Order.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Order.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Order' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Order.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Order value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Order read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..1d16b4d8399 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,455 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A pet for sale in the pet store + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private Category category; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; + @SerializedName(SERIALIZED_NAME_PHOTO_URLS) + private List photoUrls = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList<>(); + + /** + * pet status in the store + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @Deprecated + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public Pet() { + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @javax.annotation.Nonnull + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nullable + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + + @Deprecated + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + **/ + @Deprecated + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + @Deprecated + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Pet + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Pet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `category` + if (jsonObj.get("category") != null && !jsonObj.get("category").isJsonNull()) { + Category.validateJsonElement(jsonObj.get("category")); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the required json array is present + if (jsonObj.get("photoUrls") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("photoUrls").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString())); + } + if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) { + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + if (jsonArraytags != null) { + // ensure the json data is an array + if (!jsonObj.get("tags").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `tags` to be an array in the JSON string but got `%s`", jsonObj.get("tags").toString())); + } + + // validate the optional field `tags` (array) + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonElement(jsonArraytags.get(i)); + }; + } + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pet.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pet' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pet.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pet value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pet read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..57ada692df9 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,232 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A tag for a pet + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public Tag() { + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Tag + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Tag.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Tag.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Tag' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Tag.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Tag value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Tag read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/User.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..352227391e0 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,403 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * A User who is purchasing from the pet store + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class User { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + private String username; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + public static final String SERIALIZED_NAME_USER_STATUS = "userStatus"; + @SerializedName(SERIALIZED_NAME_USER_STATUS) + private Integer userStatus; + + public User() { + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @javax.annotation.Nullable + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("username"); + openapiFields.add("firstName"); + openapiFields.add("lastName"); + openapiFields.add("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + openapiFields.add("userStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString())); + } + if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) && !jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!User.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'User' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(User.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, User value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public User read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..44e74f1cf98 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PetApi + */ +@Disabled +public class PetApiTest { + + private final PetApi api = new PetApi(); + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + Pet pet = null; + Pet response = api.addPet(pet); + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet pet = null; + Pet response = api.updatePet(pet); + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File _file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + // TODO: test validations + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..3ca20d0b210 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Order; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StoreApi + */ +@Disabled +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order order = null; + Order response = api.placeOrder(order); + // TODO: test validations + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..a46743c4435 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +@Disabled +public class UserApiTest { + + private final UserApi api = new UserApi(); + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User user = null; + api.createUser(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List user = null; + api.createUsersWithArrayInput(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List user = null; + api.createUsersWithListInput(user); + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + api.logoutUser(); + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + api.updateUser(username, user); + // TODO: test validations + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..0609d116a38 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..6018546d053 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..bde30a7233d --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..1dbb74a230c --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..0a89a2bc6f4 --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..42c042309ce --- /dev/null +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/echo_api/java/okhttp-gson/.github/workflows/maven.yml b/samples/client/echo_api/java/okhttp-gson/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/okhttp-gson/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/okhttp-gson/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/okhttp-gson/build.gradle b/samples/client/echo_api/java/okhttp-gson/build.gradle index 38a181fc21f..3d38f68764d 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson/build.gradle @@ -117,9 +117,9 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/echo_api/java/okhttp-gson/build.sbt b/samples/client/echo_api/java/okhttp-gson/build.sbt index 55b2479519f..7ea5b0cb560 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson/build.sbt @@ -21,7 +21,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/okhttp-gson/gradlew b/samples/client/echo_api/java/okhttp-gson/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/okhttp-gson/gradlew +++ b/samples/client/echo_api/java/okhttp-gson/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/okhttp-gson/gradlew.bat b/samples/client/echo_api/java/okhttp-gson/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/okhttp-gson/gradlew.bat +++ b/samples/client/echo_api/java/okhttp-gson/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/okhttp-gson/pom.xml b/samples/client/echo_api/java/okhttp-gson/pom.xml index 00a6896416f..3c3aaad6fb5 100644 --- a/samples/client/echo_api/java/okhttp-gson/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson/pom.xml @@ -334,7 +334,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/CustomTest.java index e7787c995ff..29855179b56 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/CustomTest.java @@ -13,7 +13,7 @@ package org.openapitools.client; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.openapitools.client.ApiException; import org.openapitools.client.api.*; import org.openapitools.client.model.*; @@ -46,13 +46,13 @@ public class CustomTest { photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category")); Pet p = bodyApi.testEchoBodyPet(queryObject); - Assert.assertNotNull(p); - Assert.assertEquals("Hello World", p.getName()); - Assert.assertEquals(Long.valueOf(12345L), p.getId()); + Assertions.assertNotNull(p); + Assertions.assertEquals("Hello World", p.getName()); + Assertions.assertEquals(Long.valueOf(12345L), p.getId()); // response is empty body Pet p2 = bodyApi.testEchoBodyPet(null); - Assert.assertNull(p2); + Assertions.assertNull(p2); } /** @@ -70,7 +70,7 @@ public class CustomTest { String response = api.testQueryStyleFormExplodeTrueObject(queryObject); org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response); - Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path); + Assertions.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path); } /** @@ -88,7 +88,7 @@ public class CustomTest { String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response); - Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path); + Assertions.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path); } /** @@ -106,7 +106,7 @@ public class CustomTest { String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response); - Assert.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path); + Assertions.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path); } /** @@ -124,6 +124,6 @@ public class CustomTest { String response = api.testQueryStyleFormExplodeTrueArrayString(q); org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response); - Assert.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path); + Assertions.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path); } } diff --git a/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java index 69083155b5a..dcf4ae34da4 100644 --- a/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java +++ b/samples/client/echo_api/java/okhttp-gson/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -13,7 +13,7 @@ package org.openapitools.client.api; -import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions; import org.openapitools.client.ApiException; import org.junit.jupiter.api.Disabled; diff --git a/samples/client/echo_api/java/restclient/.github/workflows/maven.yml b/samples/client/echo_api/java/restclient/.github/workflows/maven.yml new file mode 100644 index 00000000000..543a3007900 --- /dev/null +++ b/samples/client/echo_api/java/restclient/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Echo Server API + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/echo_api/java/restclient/.gitignore b/samples/client/echo_api/java/restclient/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/echo_api/java/restclient/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore b/samples/client/echo_api/java/restclient/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore rename to samples/client/echo_api/java/restclient/.openapi-generator-ignore diff --git a/samples/client/echo_api/java/restclient/.openapi-generator/FILES b/samples/client/echo_api/java/restclient/.openapi-generator/FILES new file mode 100644 index 00000000000..045decee44e --- /dev/null +++ b/samples/client/echo_api/java/restclient/.openapi-generator/FILES @@ -0,0 +1,62 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AuthApi.md +docs/Bird.md +docs/BodyApi.md +docs/Category.md +docs/DataQuery.md +docs/DefaultValue.md +docs/FormApi.md +docs/HeaderApi.md +docs/NumberPropertiesOnly.md +docs/PathApi.md +docs/Pet.md +docs/Query.md +docs/QueryApi.md +docs/StringEnumRef.md +docs/Tag.md +docs/TestFormObjectMultipartRequestMarker.md +docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md +docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AuthApi.java +src/main/java/org/openapitools/client/api/BodyApi.java +src/main/java/org/openapitools/client/api/FormApi.java +src/main/java/org/openapitools/client/api/HeaderApi.java +src/main/java/org/openapitools/client/api/PathApi.java +src/main/java/org/openapitools/client/api/QueryApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/Bird.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/DataQuery.java +src/main/java/org/openapitools/client/model/DefaultValue.java +src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Query.java +src/main/java/org/openapitools/client/model/StringEnumRef.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java diff --git a/samples/client/echo_api/java/restclient/.openapi-generator/VERSION b/samples/client/echo_api/java/restclient/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/echo_api/java/restclient/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/echo_api/java/restclient/.travis.yml b/samples/client/echo_api/java/restclient/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/echo_api/java/restclient/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/echo_api/java/restclient/README.md b/samples/client/echo_api/java/restclient/README.md new file mode 100644 index 00000000000..9d87421d95a --- /dev/null +++ b/samples/client/echo_api/java/restclient/README.md @@ -0,0 +1,192 @@ +# echo-api-native + +Echo Server API + +- API version: 0.1.0 + +- Generator version: 8.0.0-SNAPSHOT + +Echo Server API + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + echo-api-native + 0.1.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'echo-api-native' jar has been published to maven central. + mavenLocal() // Needed if the 'echo-api-native' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:echo-api-native:0.1.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/echo-api-native-0.1.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AuthApi; + +public class AuthApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + // Configure HTTP basic authorization: http_auth + HttpBasicAuth http_auth = (HttpBasicAuth) defaultClient.getAuthentication("http_auth"); + http_auth.setUsername("YOUR USERNAME"); + http_auth.setPassword("YOUR PASSWORD"); + + AuthApi apiInstance = new AuthApi(defaultClient); + try { + String result = apiInstance.testAuthHttpBasic(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#testAuthHttpBasic"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthApi* | [**testAuthHttpBasic**](docs/AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication +*AuthApi* | [**testAuthHttpBearer**](docs/AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication +*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body +*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) +*BodyApi* | [**testBodyMultipartFormdataArrayOfBinary**](docs/BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime +*BodyApi* | [**testBodyMultipartFormdataSingleBinary**](docs/BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime +*BodyApi* | [**testEchoBodyAllOfPet**](docs/BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) +*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object +*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) +*BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body +*BodyApi* | [**testEchoBodyStringEnum**](docs/BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body +*BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) +*FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) +*FormApi* | [**testFormObjectMultipart**](docs/FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema +*FormApi* | [**testFormOneof**](docs/FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema +*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) +*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) +*QueryApi* | [**testEnumRefString**](docs/QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s) +*QueryApi* | [**testQueryDatetimeDateString**](docs/QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s) +*QueryApi* | [**testQueryIntegerBooleanString**](docs/QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) +*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) +*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeFalseArrayInteger**](docs/QueryApi.md#testQueryStyleFormExplodeFalseArrayInteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeFalseArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeFalseArrayString) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) + + +## Documentation for Models + + - [Bird](docs/Bird.md) + - [Category](docs/Category.md) + - [DataQuery](docs/DataQuery.md) + - [DefaultValue](docs/DefaultValue.md) + - [NumberPropertiesOnly](docs/NumberPropertiesOnly.md) + - [Pet](docs/Pet.md) + - [Query](docs/Query.md) + - [StringEnumRef](docs/StringEnumRef.md) + - [Tag](docs/Tag.md) + - [TestFormObjectMultipartRequestMarker](docs/TestFormObjectMultipartRequestMarker.md) + - [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md) + - [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### http_auth + + +- **Type**: HTTP basic authentication + + +### http_bearer_auth + + +- **Type**: HTTP Bearer Token authentication + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +team@openapitools.org + diff --git a/samples/client/echo_api/java/restclient/api/openapi.yaml b/samples/client/echo_api/java/restclient/api/openapi.yaml new file mode 100644 index 00000000000..1e66b39f9be --- /dev/null +++ b/samples/client/echo_api/java/restclient/api/openapi.yaml @@ -0,0 +1,1004 @@ +openapi: 3.0.3 +info: + contact: + email: team@openapitools.org + description: Echo Server API + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: Echo Server API + version: 0.1.0 +servers: +- url: http://localhost:3000/ +paths: + /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}: + get: + description: Test path parameter(s) + operationId: "tests/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}" + parameters: + - explode: false + in: path + name: path_string + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: path_integer + required: true + schema: + type: integer + style: simple + - explode: false + in: path + name: enum_nonref_string_path + required: true + schema: + enum: + - success + - failure + - unclassified + type: string + style: simple + - explode: false + in: path + name: enum_ref_string_path + required: true + schema: + $ref: '#/components/schemas/StringEnumRef' + style: simple + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test path parameter(s) + tags: + - path + x-accepts: + - text/plain + /form/integer/boolean/string: + post: + description: Test form parameter(s) + operationId: test/form/integer/boolean/string + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/test_form_integer_boolean_string_request' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test form parameter(s) + tags: + - form + x-content-type: application/x-www-form-urlencoded + x-accepts: + - text/plain + /form/oneof: + post: + description: Test form parameter(s) for oneOf schema + operationId: test/form/oneof + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/test_form_oneof_request' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test form parameter(s) for oneOf schema + tags: + - form + x-content-type: application/x-www-form-urlencoded + x-accepts: + - text/plain + /form/object/multipart: + post: + description: Test form parameter(s) for multipart schema + operationId: test/form/object/multipart + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/test_form_object_multipart_request' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test form parameter(s) for multipart schema + tags: + - form + x-content-type: multipart/form-data + x-accepts: + - text/plain + /header/integer/boolean/string/enums: + get: + description: Test header parameter(s) + operationId: test/header/integer/boolean/string/enums + parameters: + - explode: true + in: header + name: integer_header + required: false + schema: + type: integer + style: form + - explode: true + in: header + name: boolean_header + required: false + schema: + type: boolean + style: form + - explode: true + in: header + name: string_header + required: false + schema: + type: string + style: form + - explode: true + in: header + name: enum_nonref_string_header + required: false + schema: + enum: + - success + - failure + - unclassified + type: string + style: form + - explode: true + in: header + name: enum_ref_string_header + required: false + schema: + $ref: '#/components/schemas/StringEnumRef' + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test header parameter(s) + tags: + - header + x-accepts: + - text/plain + /query/enum_ref_string: + get: + description: Test query parameter(s) + operationId: test/enum_ref_string + parameters: + - explode: true + in: query + name: enum_nonref_string_query + required: false + schema: + enum: + - success + - failure + - unclassified + type: string + style: form + - explode: true + in: query + name: enum_ref_string_query + required: false + schema: + $ref: '#/components/schemas/StringEnumRef' + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/datetime/date/string: + get: + description: Test query parameter(s) + operationId: test/query/datetime/date/string + parameters: + - explode: true + in: query + name: datetime_query + required: false + schema: + format: date-time + type: string + style: form + - explode: true + in: query + name: date_query + required: false + schema: + format: date + type: string + style: form + - explode: true + in: query + name: string_query + required: false + schema: + type: string + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/integer/boolean/string: + get: + description: Test query parameter(s) + operationId: test/query/integer/boolean/string + parameters: + - explode: true + in: query + name: integer_query + required: false + schema: + type: integer + style: form + - explode: true + in: query + name: boolean_query + required: false + schema: + type: boolean + style: form + - explode: true + in: query + name: string_query + required: false + schema: + type: string + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_form/explode_true/array_string: + get: + description: Test query parameter(s) + operationId: test/query/style_form/explode_true/array_string + parameters: + - explode: true + in: query + name: query_object + required: false + schema: + $ref: '#/components/schemas/test_query_style_form_explode_true_array_string_query_object_parameter' + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_form/explode_false/array_integer: + get: + description: Test query parameter(s) + operationId: test/query/style_form/explode_false/array_integer + parameters: + - explode: false + in: query + name: query_object + required: false + schema: + items: + type: integer + type: array + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_form/explode_false/array_string: + get: + description: Test query parameter(s) + operationId: test/query/style_form/explode_false/array_string + parameters: + - explode: false + in: query + name: query_object + required: false + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_form/explode_true/object: + get: + description: Test query parameter(s) + operationId: test/query/style_form/explode_true/object + parameters: + - explode: true + in: query + name: query_object + required: false + schema: + $ref: '#/components/schemas/Pet' + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_form/explode_true/object/allOf: + get: + description: Test query parameter(s) + operationId: test/query/style_form/explode_true/object/allOf + parameters: + - explode: true + in: query + name: query_object + required: false + schema: + $ref: '#/components/schemas/DataQuery' + style: form + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_deepObject/explode_true/object: + get: + description: Test query parameter(s) + operationId: test/query/style_deepObject/explode_true/object + parameters: + - explode: true + in: query + name: query_object + required: false + schema: + $ref: '#/components/schemas/Pet' + style: deepObject + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /query/style_deepObject/explode_true/object/allOf: + get: + description: Test query parameter(s) + operationId: test/query/style_deepObject/explode_true/object/allOf + parameters: + - explode: true + in: query + name: query_object + required: false + schema: + $ref: '#/components/schemas/test_query_style_deepObject_explode_true_object_allOf_query_object_parameter' + style: deepObject + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test query parameter(s) + tags: + - query + x-accepts: + - text/plain + /body/application/octetstream/binary: + post: + description: Test body parameter(s) + operationId: test/body/application/octetstream/binary + requestBody: + content: + application/octet-stream: + schema: + format: binary + type: string + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test body parameter(s) + tags: + - body + x-content-type: application/octet-stream + x-accepts: + - text/plain + /echo/body/Pet: + post: + description: Test body parameter(s) + operationId: test/echo/body/Pet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: Successful operation + summary: Test body parameter(s) + tags: + - body + x-content-type: application/json + x-accepts: + - application/json + /echo/body/allOf/Pet: + post: + description: Test body parameter(s) + operationId: test/echo/body/allOf/Pet + requestBody: + $ref: '#/components/requestBodies/AllOfPet' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: Successful operation + summary: Test body parameter(s) + tags: + - body + x-content-type: application/json + x-accepts: + - application/json + /echo/body/Pet/response_string: + post: + description: Test empty response body + operationId: test/echo/body/Pet/response_string + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test empty response body + tags: + - body + x-content-type: application/json + x-accepts: + - text/plain + /echo/body/Tag/response_string: + post: + description: Test empty json (request body) + operationId: test/echo/body/Tag/response_string + requestBody: + $ref: '#/components/requestBodies/Tag' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test empty json (request body) + tags: + - body + x-content-type: application/json + x-accepts: + - text/plain + /echo/body/FreeFormObject/response_string: + post: + description: Test free form object + operationId: test/echo/body/FreeFormObject/response_string + requestBody: + content: + application/json: + schema: + type: object + description: Free form object + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test free form object + tags: + - body + x-content-type: application/json + x-accepts: + - text/plain + /echo/body/string_enum: + post: + description: Test string enum response body + operationId: test/echo/body/string_enum + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnumRef' + description: String enum + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StringEnumRef' + description: Successful operation + summary: Test string enum response body + tags: + - body + x-content-type: application/json + x-accepts: + - application/json + /binary/gif: + post: + description: Test binary (gif) response body + operationId: test/binary/gif + responses: + "200": + content: + image/gif: + schema: + format: binary + type: string + description: Successful operation + summary: Test binary (gif) response body + tags: + - body + x-accepts: + - image/gif + /body/application/octetstream/single_binary: + post: + description: Test single binary in multipart mime + operationId: test/body/multipart/formdata/single_binary + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/test_body_multipart_formdata_single_binary_request' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test single binary in multipart mime + tags: + - body + x-content-type: multipart/form-data + x-accepts: + - text/plain + /body/application/octetstream/array_of_binary: + post: + description: Test array of binary in multipart mime + operationId: test/body/multipart/formdata/array_of_binary + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/test_body_multipart_formdata_array_of_binary_request' + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + summary: Test array of binary in multipart mime + tags: + - body + x-content-type: multipart/form-data + x-accepts: + - text/plain + /auth/http/basic: + post: + description: To test HTTP basic authentication + operationId: test/auth/http/basic + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + security: + - http_auth: [] + summary: To test HTTP basic authentication + tags: + - auth + x-accepts: + - text/plain + /auth/http/bearer: + post: + description: To test HTTP bearer authentication + operationId: test/auth/http/bearer + responses: + "200": + content: + text/plain: + schema: + type: string + description: Successful operation + security: + - http_bearer_auth: [] + summary: To test HTTP bearer authentication + tags: + - auth + x-accepts: + - text/plain +components: + requestBodies: + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + AllOfPet: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + Tag: + content: + application/json: + schema: + $ref: '#/components/schemas/Tag' + description: Tag object + schemas: + Category: + example: + name: Dogs + id: 1 + properties: + id: + example: 1 + format: int64 + type: integer + name: + example: Dogs + type: string + type: object + xml: + name: category + Tag: + example: + name: name + id: 0 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 10 + category: + name: Dogs + id: 1 + tags: + - name: name + id: 0 + - name: name + id: 0 + status: available + properties: + id: + example: 10 + format: int64 + type: integer + name: + example: doggie + type: string + category: + $ref: '#/components/schemas/Category' + photoUrls: + items: + type: string + xml: + name: photoUrl + type: array + xml: + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: pet + StringEnumRef: + enum: + - success + - failure + - unclassified + type: string + DefaultValue: + description: to test the default value of properties + properties: + array_string_enum_ref_default: + default: + - success + - failure + items: + $ref: '#/components/schemas/StringEnumRef' + type: array + array_string_enum_default: + default: + - success + - failure + items: + enum: + - success + - failure + - unclassified + type: string + type: array + array_string_default: + default: + - failure + - skipped + items: + type: string + type: array + array_integer_default: + default: + - 1 + - 3 + items: + type: integer + type: array + array_string: + items: + type: string + type: array + array_string_nullable: + items: + type: string + nullable: true + type: array + array_string_extension_nullable: + items: + type: string + type: array + x-nullable: true + string_nullable: + nullable: true + type: string + type: object + Bird: + properties: + size: + type: string + color: + type: string + type: object + Query: + properties: + id: + description: Query + format: int64 + type: integer + outcomes: + default: + - SUCCESS + - FAILURE + items: + enum: + - SUCCESS + - FAILURE + - SKIPPED + type: string + type: array + type: object + x-parent: true + DataQuery: + allOf: + - properties: + suffix: + description: test suffix + type: string + text: + description: Some text containing white spaces + example: Some text + type: string + date: + description: A date + format: date-time + type: string + type: object + - $ref: '#/components/schemas/Query' + NumberPropertiesOnly: + properties: + number: + type: number + float: + format: float + type: number + double: + format: double + maximum: 50.2 + minimum: 0.8 + type: number + type: object + test_form_integer_boolean_string_request: + properties: + integer_form: + type: integer + boolean_form: + type: boolean + string_form: + type: string + type: object + test_form_oneof_request_oneOf: + properties: + form1: + type: string + form2: + type: integer + type: object + test_form_oneof_request_oneOf_1: + properties: + form3: + type: string + form4: + type: boolean + type: object + test_form_oneof_request: + oneOf: + - $ref: '#/components/schemas/test_form_oneof_request_oneOf' + - $ref: '#/components/schemas/test_form_oneof_request_oneOf_1' + - $ref: '#/components/schemas/Tag' + type: object + test_form_object_multipart_request_marker: + properties: + name: + type: string + type: object + test_form_object_multipart_request: + properties: + marker: + $ref: '#/components/schemas/test_form_object_multipart_request_marker' + required: + - marker + type: object + test_query_style_form_explode_true_array_string_query_object_parameter: + properties: + values: + items: + type: string + type: array + type: object + test_query_style_deepObject_explode_true_object_allOf_query_object_parameter: + allOf: + - $ref: '#/components/schemas/Bird' + - $ref: '#/components/schemas/Category' + test_body_multipart_formdata_single_binary_request: + properties: + my-file: + format: binary + type: string + type: object + test_body_multipart_formdata_array_of_binary_request: + properties: + files: + items: + format: binary + type: string + type: array + required: + - files + type: object + securitySchemes: + http_auth: + scheme: basic + type: http + http_bearer_auth: + scheme: bearer + type: http + diff --git a/samples/client/echo_api/java/restclient/build.gradle b/samples/client/echo_api/java/restclient/build.gradle new file mode 100644 index 00000000000..dac8486322f --- /dev/null +++ b/samples/client/echo_api/java/restclient/build.gradle @@ -0,0 +1,136 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '0.1.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'echo-api-native' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/echo_api/java/restclient/build.sbt b/samples/client/echo_api/java/restclient/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/echo_api/java/restclient/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/echo_api/java/restclient/docs/AuthApi.md b/samples/client/echo_api/java/restclient/docs/AuthApi.md new file mode 100644 index 00000000000..de3353d43a2 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/AuthApi.md @@ -0,0 +1,145 @@ +# AuthApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testAuthHttpBasic**](AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication | +| [**testAuthHttpBearer**](AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication | + + + +## testAuthHttpBasic + +> String testAuthHttpBasic() + +To test HTTP basic authentication + +To test HTTP basic authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + // Configure HTTP basic authorization: http_auth + HttpBasicAuth http_auth = (HttpBasicAuth) defaultClient.getAuthentication("http_auth"); + http_auth.setUsername("YOUR USERNAME"); + http_auth.setPassword("YOUR PASSWORD"); + + AuthApi apiInstance = new AuthApi(defaultClient); + try { + String result = apiInstance.testAuthHttpBasic(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#testAuthHttpBasic"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[http_auth](../README.md#http_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testAuthHttpBearer + +> String testAuthHttpBearer() + +To test HTTP bearer authentication + +To test HTTP bearer authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AuthApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + // Configure HTTP bearer authorization: http_bearer_auth + HttpBearerAuth http_bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("http_bearer_auth"); + http_bearer_auth.setBearerToken("BEARER TOKEN"); + + AuthApi apiInstance = new AuthApi(defaultClient); + try { + String result = apiInstance.testAuthHttpBearer(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AuthApi#testAuthHttpBearer"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[http_bearer_auth](../README.md#http_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/Bird.md b/samples/client/echo_api/java/restclient/docs/Bird.md new file mode 100644 index 00000000000..2a6f8a660d6 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/Bird.md @@ -0,0 +1,14 @@ + + +# Bird + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**size** | **String** | | [optional] | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/BodyApi.md b/samples/client/echo_api/java/restclient/docs/BodyApi.md new file mode 100644 index 00000000000..06c7864137b --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/BodyApi.md @@ -0,0 +1,674 @@ +# BodyApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body | +| [**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) | +| [**testBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime | +| [**testBodyMultipartFormdataSingleBinary**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime | +| [**testEchoBodyAllOfPet**](BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) | +| [**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object | +| [**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) | +| [**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body | +| [**testEchoBodyStringEnum**](BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body | +| [**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | + + + +## testBinaryGif + +> File testBinaryGif() + +Test binary (gif) response body + +Test binary (gif) response body + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + try { + File result = apiInstance.testBinaryGif(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBinaryGif"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/gif + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testBodyApplicationOctetstreamBinary + +> String testBodyApplicationOctetstreamBinary(body) + +Test body parameter(s) + +Test body parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + File body = new File("/path/to/file"); // File | + try { + String result = apiInstance.testBodyApplicationOctetstreamBinary(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBodyApplicationOctetstreamBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testBodyMultipartFormdataArrayOfBinary + +> String testBodyMultipartFormdataArrayOfBinary(files) + +Test array of binary in multipart mime + +Test array of binary in multipart mime + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + List files = Arrays.asList(); // List | + try { + String result = apiInstance.testBodyMultipartFormdataArrayOfBinary(files); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBodyMultipartFormdataArrayOfBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **files** | **List<File>**| | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testBodyMultipartFormdataSingleBinary + +> String testBodyMultipartFormdataSingleBinary(myFile) + +Test single binary in multipart mime + +Test single binary in multipart mime + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + File myFile = new File("/path/to/file"); // File | + try { + String result = apiInstance.testBodyMultipartFormdataSingleBinary(myFile); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testBodyMultipartFormdataSingleBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **myFile** | **File**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyAllOfPet + +> Pet testEchoBodyAllOfPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.testEchoBodyAllOfPet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyAllOfPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyFreeFormObjectResponseString + +> String testEchoBodyFreeFormObjectResponseString(body) + +Test free form object + +Test free form object + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + Object body = null; // Object | Free form object + try { + String result = apiInstance.testEchoBodyFreeFormObjectResponseString(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyFreeFormObjectResponseString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Object**| Free form object | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyPet + +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.testEchoBodyPet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyPetResponseString + +> String testEchoBodyPetResponseString(pet) + +Test empty response body + +Test empty response body + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + String result = apiInstance.testEchoBodyPetResponseString(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyPetResponseString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyStringEnum + +> StringEnumRef testEchoBodyStringEnum(body) + +Test string enum response body + +Test string enum response body + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + String body = "body_example"; // String | String enum + try { + StringEnumRef result = apiInstance.testEchoBodyStringEnum(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyStringEnum"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| String enum | [optional] | + +### Return type + +[**StringEnumRef**](StringEnumRef.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testEchoBodyTagResponseString + +> String testEchoBodyTagResponseString(tag) + +Test empty json (request body) + +Test empty json (request body) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.BodyApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + BodyApi apiInstance = new BodyApi(defaultClient); + Tag tag = new Tag(); // Tag | Tag object + try { + String result = apiInstance.testEchoBodyTagResponseString(tag); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BodyApi#testEchoBodyTagResponseString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tag** | [**Tag**](Tag.md)| Tag object | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/Category.md b/samples/client/echo_api/java/restclient/docs/Category.md new file mode 100644 index 00000000000..7289ebf585b --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/DataQuery.md b/samples/client/echo_api/java/restclient/docs/DataQuery.md new file mode 100644 index 00000000000..d61a881571c --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/DataQuery.md @@ -0,0 +1,15 @@ + + +# DataQuery + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**suffix** | **String** | test suffix | [optional] | +|**text** | **String** | Some text containing white spaces | [optional] | +|**date** | **Instant** | A date | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/DefaultValue.md b/samples/client/echo_api/java/restclient/docs/DefaultValue.md new file mode 100644 index 00000000000..20a9b8ee250 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/DefaultValue.md @@ -0,0 +1,31 @@ + + +# DefaultValue + +to test the default value of properties + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayStringEnumRefDefault** | **List<StringEnumRef>** | | [optional] | +|**arrayStringEnumDefault** | [**List<ArrayStringEnumDefaultEnum>**](#List<ArrayStringEnumDefaultEnum>) | | [optional] | +|**arrayStringDefault** | **List<String>** | | [optional] | +|**arrayIntegerDefault** | **List<Integer>** | | [optional] | +|**arrayString** | **List<String>** | | [optional] | +|**arrayStringNullable** | **List<String>** | | [optional] | +|**arrayStringExtensionNullable** | **List<String>** | | [optional] | +|**stringNullable** | **String** | | [optional] | + + + +## Enum: List<ArrayStringEnumDefaultEnum> + +| Name | Value | +|---- | -----| +| SUCCESS | "success" | +| FAILURE | "failure" | +| UNCLASSIFIED | "unclassified" | + + + diff --git a/samples/client/echo_api/java/restclient/docs/FormApi.md b/samples/client/echo_api/java/restclient/docs/FormApi.md new file mode 100644 index 00000000000..a9b7132b732 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/FormApi.md @@ -0,0 +1,223 @@ +# FormApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) | +| [**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema | +| [**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | + + + +## testFormIntegerBooleanString + +> String testFormIntegerBooleanString(integerForm, booleanForm, stringForm) + +Test form parameter(s) + +Test form parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FormApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + FormApi apiInstance = new FormApi(defaultClient); + Integer integerForm = 56; // Integer | + Boolean booleanForm = true; // Boolean | + String stringForm = "stringForm_example"; // String | + try { + String result = apiInstance.testFormIntegerBooleanString(integerForm, booleanForm, stringForm); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FormApi#testFormIntegerBooleanString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integerForm** | **Integer**| | [optional] | +| **booleanForm** | **Boolean**| | [optional] | +| **stringForm** | **String**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testFormObjectMultipart + +> String testFormObjectMultipart(marker) + +Test form parameter(s) for multipart schema + +Test form parameter(s) for multipart schema + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FormApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + FormApi apiInstance = new FormApi(defaultClient); + TestFormObjectMultipartRequestMarker marker = new TestFormObjectMultipartRequestMarker(); // TestFormObjectMultipartRequestMarker | + try { + String result = apiInstance.testFormObjectMultipart(marker); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FormApi#testFormObjectMultipart"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **marker** | [**TestFormObjectMultipartRequestMarker**](TestFormObjectMultipartRequestMarker.md)| | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testFormOneof + +> String testFormOneof(form1, form2, form3, form4, id, name) + +Test form parameter(s) for oneOf schema + +Test form parameter(s) for oneOf schema + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FormApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + FormApi apiInstance = new FormApi(defaultClient); + String form1 = "form1_example"; // String | + Integer form2 = 56; // Integer | + String form3 = "form3_example"; // String | + Boolean form4 = true; // Boolean | + Long id = 56L; // Long | + String name = "name_example"; // String | + try { + String result = apiInstance.testFormOneof(form1, form2, form3, form4, id, name); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FormApi#testFormOneof"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **form1** | **String**| | [optional] | +| **form2** | **Integer**| | [optional] | +| **form3** | **String**| | [optional] | +| **form4** | **Boolean**| | [optional] | +| **id** | **Long**| | [optional] | +| **name** | **String**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/HeaderApi.md b/samples/client/echo_api/java/restclient/docs/HeaderApi.md new file mode 100644 index 00000000000..e30880043fa --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/HeaderApi.md @@ -0,0 +1,83 @@ +# HeaderApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | + + + +## testHeaderIntegerBooleanStringEnums + +> String testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) + +Test header parameter(s) + +Test header parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.HeaderApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + HeaderApi apiInstance = new HeaderApi(defaultClient); + Integer integerHeader = 56; // Integer | + Boolean booleanHeader = true; // Boolean | + String stringHeader = "stringHeader_example"; // String | + String enumNonrefStringHeader = "success"; // String | + StringEnumRef enumRefStringHeader = StringEnumRef.fromValue("success"); // StringEnumRef | + try { + String result = apiInstance.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling HeaderApi#testHeaderIntegerBooleanStringEnums"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integerHeader** | **Integer**| | [optional] | +| **booleanHeader** | **Boolean**| | [optional] | +| **stringHeader** | **String**| | [optional] | +| **enumNonrefStringHeader** | **String**| | [optional] [enum: success, failure, unclassified] | +| **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/NumberPropertiesOnly.md b/samples/client/echo_api/java/restclient/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..7e153538475 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/NumberPropertiesOnly.md @@ -0,0 +1,15 @@ + + +# NumberPropertiesOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**number** | **BigDecimal** | | [optional] | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/PathApi.md b/samples/client/echo_api/java/restclient/docs/PathApi.md new file mode 100644 index 00000000000..e9a539e8c3e --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/PathApi.md @@ -0,0 +1,81 @@ +# PathApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) | + + + +## testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath + +> String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) + +Test path parameter(s) + +Test path parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PathApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + PathApi apiInstance = new PathApi(defaultClient); + String pathString = "pathString_example"; // String | + Integer pathInteger = 56; // Integer | + String enumNonrefStringPath = "success"; // String | + StringEnumRef enumRefStringPath = StringEnumRef.fromValue("success"); // StringEnumRef | + try { + String result = apiInstance.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PathApi#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pathString** | **String**| | | +| **pathInteger** | **Integer**| | | +| **enumNonrefStringPath** | **String**| | [enum: success, failure, unclassified] | +| **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/Pet.md b/samples/client/echo_api/java/restclient/docs/Pet.md new file mode 100644 index 00000000000..82aa8a25ed7 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | +|**category** | [**Category**](Category.md) | | [optional] | +|**photoUrls** | **List<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/echo_api/java/restclient/docs/Query.md b/samples/client/echo_api/java/restclient/docs/Query.md new file mode 100644 index 00000000000..99c6fd6faa5 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/Query.md @@ -0,0 +1,24 @@ + + +# Query + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | Query | [optional] | +|**outcomes** | [**List<OutcomesEnum>**](#List<OutcomesEnum>) | | [optional] | + + + +## Enum: List<OutcomesEnum> + +| Name | Value | +|---- | -----| +| SUCCESS | "SUCCESS" | +| FAILURE | "FAILURE" | +| SKIPPED | "SKIPPED" | + + + diff --git a/samples/client/echo_api/java/restclient/docs/QueryApi.md b/samples/client/echo_api/java/restclient/docs/QueryApi.md new file mode 100644 index 00000000000..cf13bcbda57 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/QueryApi.md @@ -0,0 +1,688 @@ +# QueryApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testEnumRefString**](QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s) | +| [**testQueryDatetimeDateString**](QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s) | +| [**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) | +| [**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) | +| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) | +| [**testQueryStyleFormExplodeFalseArrayInteger**](QueryApi.md#testQueryStyleFormExplodeFalseArrayInteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s) | +| [**testQueryStyleFormExplodeFalseArrayString**](QueryApi.md#testQueryStyleFormExplodeFalseArrayString) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s) | +| [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) | +| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) | +| [**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) | + + + +## testEnumRefString + +> String testEnumRefString(enumNonrefStringQuery, enumRefStringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + String enumNonrefStringQuery = "success"; // String | + StringEnumRef enumRefStringQuery = StringEnumRef.fromValue("success"); // StringEnumRef | + try { + String result = apiInstance.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testEnumRefString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumNonrefStringQuery** | **String**| | [optional] [enum: success, failure, unclassified] | +| **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryDatetimeDateString + +> String testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + Instant datetimeQuery = new Instant(); // Instant | + LocalDate dateQuery = LocalDate.now(); // LocalDate | + String stringQuery = "stringQuery_example"; // String | + try { + String result = apiInstance.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryDatetimeDateString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **datetimeQuery** | **Instant**| | [optional] | +| **dateQuery** | **LocalDate**| | [optional] | +| **stringQuery** | **String**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryIntegerBooleanString + +> String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + Integer integerQuery = 56; // Integer | + Boolean booleanQuery = true; // Boolean | + String stringQuery = "stringQuery_example"; // String | + try { + String result = apiInstance.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryIntegerBooleanString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **integerQuery** | **Integer**| | [optional] | +| **booleanQuery** | **Boolean**| | [optional] | +| **stringQuery** | **String**| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleDeepObjectExplodeTrueObject + +> String testQueryStyleDeepObjectExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + Pet queryObject = new Pet(); // Pet | + try { + String result = apiInstance.testQueryStyleDeepObjectExplodeTrueObject(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleDeepObjectExplodeTrueObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**Pet**](.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleDeepObjectExplodeTrueObjectAllOf + +> String testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(); // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter | + try { + String result = apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleDeepObjectExplodeTrueObjectAllOf"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter**](.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleFormExplodeFalseArrayInteger + +> String testQueryStyleFormExplodeFalseArrayInteger(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + List queryObject = Arrays.asList(); // List | + try { + String result = apiInstance.testQueryStyleFormExplodeFalseArrayInteger(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeFalseArrayInteger"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**List<Integer>**](Integer.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleFormExplodeFalseArrayString + +> String testQueryStyleFormExplodeFalseArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + List queryObject = Arrays.asList(); // List | + try { + String result = apiInstance.testQueryStyleFormExplodeFalseArrayString(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeFalseArrayString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**List<String>**](String.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleFormExplodeTrueArrayString + +> String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(); // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + try { + String result = apiInstance.testQueryStyleFormExplodeTrueArrayString(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueArrayString"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleFormExplodeTrueObject + +> String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + Pet queryObject = new Pet(); // Pet | + try { + String result = apiInstance.testQueryStyleFormExplodeTrueObject(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObject"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**Pet**](.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + + +## testQueryStyleFormExplodeTrueObjectAllOf + +> String testQueryStyleFormExplodeTrueObjectAllOf(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.QueryApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost:3000"); + + QueryApi apiInstance = new QueryApi(defaultClient); + DataQuery queryObject = new DataQuery(); // DataQuery | + try { + String result = apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling QueryApi#testQueryStyleFormExplodeTrueObjectAllOf"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **queryObject** | [**DataQuery**](.md)| | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/echo_api/java/restclient/docs/StringEnumRef.md b/samples/client/echo_api/java/restclient/docs/StringEnumRef.md new file mode 100644 index 00000000000..dff22ecf074 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/StringEnumRef.md @@ -0,0 +1,15 @@ + + +# StringEnumRef + +## Enum + + +* `SUCCESS` (value: `"success"`) + +* `FAILURE` (value: `"failure"`) + +* `UNCLASSIFIED` (value: `"unclassified"`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Tag.md b/samples/client/echo_api/java/restclient/docs/Tag.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Tag.md rename to samples/client/echo_api/java/restclient/docs/Tag.md diff --git a/samples/client/echo_api/java/restclient/docs/TestFormObjectMultipartRequestMarker.md b/samples/client/echo_api/java/restclient/docs/TestFormObjectMultipartRequestMarker.md new file mode 100644 index 00000000000..3e67574f36d --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/TestFormObjectMultipartRequestMarker.md @@ -0,0 +1,13 @@ + + +# TestFormObjectMultipartRequestMarker + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md b/samples/client/echo_api/java/restclient/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md new file mode 100644 index 00000000000..a756a343e8a --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md @@ -0,0 +1,16 @@ + + +# TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**size** | **String** | | [optional] | +|**color** | **String** | | [optional] | +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/java/restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 00000000000..9235e80fb82 --- /dev/null +++ b/samples/client/echo_api/java/restclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,13 @@ + + +# TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**values** | **List<String>** | | [optional] | + + + diff --git a/samples/client/echo_api/java/restclient/git_push.sh b/samples/client/echo_api/java/restclient/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/echo_api/java/restclient/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/echo_api/java/restclient/gradle.properties b/samples/client/echo_api/java/restclient/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/echo_api/java/restclient/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/echo_api/java/restclient/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/restclient/gradlew b/samples/client/echo_api/java/restclient/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/echo_api/java/restclient/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/restclient/gradlew.bat b/samples/client/echo_api/java/restclient/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/echo_api/java/restclient/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/echo_api/java/restclient/pom.xml b/samples/client/echo_api/java/restclient/pom.xml new file mode 100644 index 00000000000..828b6ef4ea2 --- /dev/null +++ b/samples/client/echo_api/java/restclient/pom.xml @@ -0,0 +1,291 @@ + + 4.0.0 + org.openapitools + echo-api-native + jar + echo-api-native + 0.1.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 6.1.6 + 2.15.2 + 2.15.2 + 0.2.6 + 2.1.1 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/echo_api/java/restclient/settings.gradle b/samples/client/echo_api/java/restclient/settings.gradle new file mode 100644 index 00000000000..8544855474a --- /dev/null +++ b/samples/client/echo_api/java/restclient/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "echo-api-native" \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/main/AndroidManifest.xml b/samples/client/echo_api/java/restclient/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..f11ee1eb8cb --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,709 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import jakarta.annotation.Nullable; + +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "http://localhost:3000"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + authentications.put("http_auth", new HttpBasicAuth()); + authentications.put("http_bearer_auth", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/GifHttpMessageConverter.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/GifHttpMessageConverter.java new file mode 100644 index 00000000000..1e244560d84 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/GifHttpMessageConverter.java @@ -0,0 +1,49 @@ +package org.openapitools.client; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.Collections; +import java.util.List; +import org.springframework.http.HttpInputMessage; +import org.springframework.http.HttpOutputMessage; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; + +public class GifHttpMessageConverter implements HttpMessageConverter { + + @Override + public boolean canRead(Class clazz, MediaType mediaType) { + return clazz == File.class && mediaType.includes(MediaType.IMAGE_GIF); + } + + @Override + public boolean canWrite(Class clazz, MediaType mediaType) { + return false; + } + + @Override + public List getSupportedMediaTypes() { + return Collections.singletonList(MediaType.IMAGE_GIF); + } + + @Override + public File read(Class clazz, HttpInputMessage inputMessage) throws IOException { + File tempFile = Files.createTempFile("downloaded", ".gif").toFile(); + try (InputStream in = inputMessage.getBody(); FileOutputStream out = new FileOutputStream(tempFile)) { + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = in.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + } + return tempFile; + } + + @Override + public void write(File file, MediaType contentType, HttpOutputMessage outputMessage) throws IOException { + throw new UnsupportedOperationException("This converter is only for reading"); + } +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..68461c784c2 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/OctetStreamHttpMessageConverter.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/OctetStreamHttpMessageConverter.java new file mode 100644 index 00000000000..7c8e83998cb --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/OctetStreamHttpMessageConverter.java @@ -0,0 +1,53 @@ +package org.openapitools.client; + +import org.springframework.http.HttpInputMessage; +import org.springframework.http.HttpOutputMessage; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.Collections; +import java.util.List; + +public class OctetStreamHttpMessageConverter implements HttpMessageConverter { + + @Override + public boolean canRead(Class clazz, MediaType mediaType) { + return clazz == File.class && mediaType.includes(MediaType.APPLICATION_OCTET_STREAM); + } + + @Override + public boolean canWrite(Class clazz, MediaType mediaType) { + return clazz == File.class + && (mediaType == null || mediaType.includes(MediaType.APPLICATION_OCTET_STREAM)); + } + + @Override + public List getSupportedMediaTypes() { + return Collections.singletonList(MediaType.APPLICATION_OCTET_STREAM); + } + + @Override + public File read(Class clazz, HttpInputMessage inputMessage) throws IOException { + File tempFile = Files.createTempFile("downloaded", ".bin").toFile(); + try (InputStream in = inputMessage.getBody(); + FileOutputStream out = new FileOutputStream(tempFile)) { + byte[] buffer = new byte[1024]; + int bytesRead; + while ((bytesRead = in.read(buffer)) != -1) { + out.write(buffer, 0, bytesRead); + } + } + return tempFile; + } + + @Override + public void write(File file, MediaType contentType, HttpOutputMessage outputMessage) + throws IOException { + Files.copy(file.toPath(), outputMessage.getBody()); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..a494a0742ea --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..4c47f2b1971 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..60a0eed94d5 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..68336951d76 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/AuthApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/AuthApi.java new file mode 100644 index 00000000000..d35010b6979 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/AuthApi.java @@ -0,0 +1,174 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AuthApi { + private ApiClient apiClient; + + public AuthApi() { + this(new ApiClient()); + } + + @Autowired + public AuthApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test HTTP basic authentication + * To test HTTP basic authentication + *

    200 - Successful operation + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testAuthHttpBasicRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/auth/http/basic", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test HTTP basic authentication + * To test HTTP basic authentication + *

    200 - Successful operation + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testAuthHttpBasic() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAuthHttpBasicRequestCreation().body(localVarReturnType); + } + + /** + * To test HTTP basic authentication + * To test HTTP basic authentication + *

    200 - Successful operation + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testAuthHttpBasicWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAuthHttpBasicRequestCreation().toEntity(localVarReturnType); + } + + /** + * To test HTTP basic authentication + * To test HTTP basic authentication + *

    200 - Successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testAuthHttpBasicWithResponseSpec() throws RestClientResponseException { + return testAuthHttpBasicRequestCreation(); + } + /** + * To test HTTP bearer authentication + * To test HTTP bearer authentication + *

    200 - Successful operation + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testAuthHttpBearerRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_bearer_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/auth/http/bearer", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test HTTP bearer authentication + * To test HTTP bearer authentication + *

    200 - Successful operation + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testAuthHttpBearer() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAuthHttpBearerRequestCreation().body(localVarReturnType); + } + + /** + * To test HTTP bearer authentication + * To test HTTP bearer authentication + *

    200 - Successful operation + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testAuthHttpBearerWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAuthHttpBearerRequestCreation().toEntity(localVarReturnType); + } + + /** + * To test HTTP bearer authentication + * To test HTTP bearer authentication + *

    200 - Successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testAuthHttpBearerWithResponseSpec() throws RestClientResponseException { + return testAuthHttpBearerRequestCreation(); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/BodyApi.java new file mode 100644 index 00000000000..cacf883b42a --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/BodyApi.java @@ -0,0 +1,754 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.io.File; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.client.model.Tag; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class BodyApi { + private ApiClient apiClient; + + public BodyApi() { + this(new ApiClient()); + } + + @Autowired + public BodyApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + *

    200 - Successful operation + * @return File + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBinaryGifRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "image/gif" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/binary/gif", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + *

    200 - Successful operation + * @return File + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public File testBinaryGif() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBinaryGifRequestCreation().body(localVarReturnType); + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + *

    200 - Successful operation + * @return ResponseEntity<File> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBinaryGifWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBinaryGifRequestCreation().toEntity(localVarReturnType); + } + + /** + * Test binary (gif) response body + * Test binary (gif) response body + *

    200 - Successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBinaryGifWithResponseSpec() throws RestClientResponseException { + return testBinaryGifRequestCreation(); + } + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param body The body parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyApplicationOctetstreamBinaryRequestCreation(File body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/octet-stream" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/body/application/octetstream/binary", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param body The body parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testBodyApplicationOctetstreamBinary(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyApplicationOctetstreamBinaryRequestCreation(body).body(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param body The body parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyApplicationOctetstreamBinaryWithHttpInfo(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyApplicationOctetstreamBinaryRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param body The body parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyApplicationOctetstreamBinaryWithResponseSpec(File body) throws RestClientResponseException { + return testBodyApplicationOctetstreamBinaryRequestCreation(body); + } + /** + * Test array of binary in multipart mime + * Test array of binary in multipart mime + *

    200 - Successful operation + * @param files The files parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyMultipartFormdataArrayOfBinaryRequestCreation(List files) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'files' is set + if (files == null) { + throw new RestClientResponseException("Missing the required parameter 'files' when calling testBodyMultipartFormdataArrayOfBinary", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (files != null) + formParams.addAll("files", files.stream().map(FileSystemResource::new).collect(Collectors.toList())); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/body/application/octetstream/array_of_binary", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test array of binary in multipart mime + * Test array of binary in multipart mime + *

    200 - Successful operation + * @param files The files parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testBodyMultipartFormdataArrayOfBinary(List files) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyMultipartFormdataArrayOfBinaryRequestCreation(files).body(localVarReturnType); + } + + /** + * Test array of binary in multipart mime + * Test array of binary in multipart mime + *

    200 - Successful operation + * @param files The files parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(List files) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyMultipartFormdataArrayOfBinaryRequestCreation(files).toEntity(localVarReturnType); + } + + /** + * Test array of binary in multipart mime + * Test array of binary in multipart mime + *

    200 - Successful operation + * @param files The files parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyMultipartFormdataArrayOfBinaryWithResponseSpec(List files) throws RestClientResponseException { + return testBodyMultipartFormdataArrayOfBinaryRequestCreation(files); + } + /** + * Test single binary in multipart mime + * Test single binary in multipart mime + *

    200 - Successful operation + * @param myFile The myFile parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyMultipartFormdataSingleBinaryRequestCreation(File myFile) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (myFile != null) + formParams.add("my-file", new FileSystemResource(myFile)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/body/application/octetstream/single_binary", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test single binary in multipart mime + * Test single binary in multipart mime + *

    200 - Successful operation + * @param myFile The myFile parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testBodyMultipartFormdataSingleBinary(File myFile) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyMultipartFormdataSingleBinaryRequestCreation(myFile).body(localVarReturnType); + } + + /** + * Test single binary in multipart mime + * Test single binary in multipart mime + *

    200 - Successful operation + * @param myFile The myFile parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyMultipartFormdataSingleBinaryWithHttpInfo(File myFile) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyMultipartFormdataSingleBinaryRequestCreation(myFile).toEntity(localVarReturnType); + } + + /** + * Test single binary in multipart mime + * Test single binary in multipart mime + *

    200 - Successful operation + * @param myFile The myFile parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyMultipartFormdataSingleBinaryWithResponseSpec(File myFile) throws RestClientResponseException { + return testBodyMultipartFormdataSingleBinaryRequestCreation(myFile); + } + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyAllOfPetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/allOf/Pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Pet testEchoBodyAllOfPet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyAllOfPetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseEntity<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyAllOfPetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyAllOfPetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyAllOfPetWithResponseSpec(Pet pet) throws RestClientResponseException { + return testEchoBodyAllOfPetRequestCreation(pet); + } + /** + * Test free form object + * Test free form object + *

    200 - Successful operation + * @param body Free form object + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyFreeFormObjectResponseStringRequestCreation(Object body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/FreeFormObject/response_string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test free form object + * Test free form object + *

    200 - Successful operation + * @param body Free form object + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testEchoBodyFreeFormObjectResponseString(Object body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyFreeFormObjectResponseStringRequestCreation(body).body(localVarReturnType); + } + + /** + * Test free form object + * Test free form object + *

    200 - Successful operation + * @param body Free form object + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyFreeFormObjectResponseStringRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * Test free form object + * Test free form object + *

    200 - Successful operation + * @param body Free form object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyFreeFormObjectResponseStringWithResponseSpec(Object body) throws RestClientResponseException { + return testEchoBodyFreeFormObjectResponseStringRequestCreation(body); + } + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyPetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/Pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Pet testEchoBodyPet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyPetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseEntity<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyPetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyPetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Test body parameter(s) + * Test body parameter(s) + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyPetWithResponseSpec(Pet pet) throws RestClientResponseException { + return testEchoBodyPetRequestCreation(pet); + } + /** + * Test empty response body + * Test empty response body + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyPetResponseStringRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/Pet/response_string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test empty response body + * Test empty response body + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testEchoBodyPetResponseString(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyPetResponseStringRequestCreation(pet).body(localVarReturnType); + } + + /** + * Test empty response body + * Test empty response body + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyPetResponseStringWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyPetResponseStringRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Test empty response body + * Test empty response body + *

    200 - Successful operation + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyPetResponseStringWithResponseSpec(Pet pet) throws RestClientResponseException { + return testEchoBodyPetResponseStringRequestCreation(pet); + } + /** + * Test string enum response body + * Test string enum response body + *

    200 - Successful operation + * @param body String enum + * @return StringEnumRef + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyStringEnumRequestCreation(String body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/string_enum", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test string enum response body + * Test string enum response body + *

    200 - Successful operation + * @param body String enum + * @return StringEnumRef + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public StringEnumRef testEchoBodyStringEnum(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyStringEnumRequestCreation(body).body(localVarReturnType); + } + + /** + * Test string enum response body + * Test string enum response body + *

    200 - Successful operation + * @param body String enum + * @return ResponseEntity<StringEnumRef> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyStringEnumWithHttpInfo(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyStringEnumRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * Test string enum response body + * Test string enum response body + *

    200 - Successful operation + * @param body String enum + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyStringEnumWithResponseSpec(String body) throws RestClientResponseException { + return testEchoBodyStringEnumRequestCreation(body); + } + /** + * Test empty json (request body) + * Test empty json (request body) + *

    200 - Successful operation + * @param tag Tag object + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEchoBodyTagResponseStringRequestCreation(Tag tag) throws RestClientResponseException { + Object postBody = tag; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/echo/body/Tag/response_string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test empty json (request body) + * Test empty json (request body) + *

    200 - Successful operation + * @param tag Tag object + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testEchoBodyTagResponseString(Tag tag) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyTagResponseStringRequestCreation(tag).body(localVarReturnType); + } + + /** + * Test empty json (request body) + * Test empty json (request body) + *

    200 - Successful operation + * @param tag Tag object + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEchoBodyTagResponseStringWithHttpInfo(Tag tag) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEchoBodyTagResponseStringRequestCreation(tag).toEntity(localVarReturnType); + } + + /** + * Test empty json (request body) + * Test empty json (request body) + *

    200 - Successful operation + * @param tag Tag object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEchoBodyTagResponseStringWithResponseSpec(Tag tag) throws RestClientResponseException { + return testEchoBodyTagResponseStringRequestCreation(tag); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/FormApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/FormApi.java new file mode 100644 index 00000000000..326867a2dd0 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/FormApi.java @@ -0,0 +1,312 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FormApi { + private ApiClient apiClient; + + public FormApi() { + this(new ApiClient()); + } + + @Autowired + public FormApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Test form parameter(s) + * Test form parameter(s) + *

    200 - Successful operation + * @param integerForm The integerForm parameter + * @param booleanForm The booleanForm parameter + * @param stringForm The stringForm parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testFormIntegerBooleanStringRequestCreation(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (integerForm != null) + formParams.add("integer_form", integerForm); + if (booleanForm != null) + formParams.add("boolean_form", booleanForm); + if (stringForm != null) + formParams.add("string_form", stringForm); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/form/integer/boolean/string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test form parameter(s) + * Test form parameter(s) + *

    200 - Successful operation + * @param integerForm The integerForm parameter + * @param booleanForm The booleanForm parameter + * @param stringForm The stringForm parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormIntegerBooleanStringRequestCreation(integerForm, booleanForm, stringForm).body(localVarReturnType); + } + + /** + * Test form parameter(s) + * Test form parameter(s) + *

    200 - Successful operation + * @param integerForm The integerForm parameter + * @param booleanForm The booleanForm parameter + * @param stringForm The stringForm parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testFormIntegerBooleanStringWithHttpInfo(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormIntegerBooleanStringRequestCreation(integerForm, booleanForm, stringForm).toEntity(localVarReturnType); + } + + /** + * Test form parameter(s) + * Test form parameter(s) + *

    200 - Successful operation + * @param integerForm The integerForm parameter + * @param booleanForm The booleanForm parameter + * @param stringForm The stringForm parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testFormIntegerBooleanStringWithResponseSpec(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientResponseException { + return testFormIntegerBooleanStringRequestCreation(integerForm, booleanForm, stringForm); + } + /** + * Test form parameter(s) for multipart schema + * Test form parameter(s) for multipart schema + *

    200 - Successful operation + * @param marker The marker parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testFormObjectMultipartRequestCreation(TestFormObjectMultipartRequestMarker marker) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'marker' is set + if (marker == null) { + throw new RestClientResponseException("Missing the required parameter 'marker' when calling testFormObjectMultipart", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (marker != null) + formParams.add("marker", marker); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/form/object/multipart", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test form parameter(s) for multipart schema + * Test form parameter(s) for multipart schema + *

    200 - Successful operation + * @param marker The marker parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testFormObjectMultipart(TestFormObjectMultipartRequestMarker marker) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormObjectMultipartRequestCreation(marker).body(localVarReturnType); + } + + /** + * Test form parameter(s) for multipart schema + * Test form parameter(s) for multipart schema + *

    200 - Successful operation + * @param marker The marker parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testFormObjectMultipartWithHttpInfo(TestFormObjectMultipartRequestMarker marker) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormObjectMultipartRequestCreation(marker).toEntity(localVarReturnType); + } + + /** + * Test form parameter(s) for multipart schema + * Test form parameter(s) for multipart schema + *

    200 - Successful operation + * @param marker The marker parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testFormObjectMultipartWithResponseSpec(TestFormObjectMultipartRequestMarker marker) throws RestClientResponseException { + return testFormObjectMultipartRequestCreation(marker); + } + /** + * Test form parameter(s) for oneOf schema + * Test form parameter(s) for oneOf schema + *

    200 - Successful operation + * @param form1 The form1 parameter + * @param form2 The form2 parameter + * @param form3 The form3 parameter + * @param form4 The form4 parameter + * @param id The id parameter + * @param name The name parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testFormOneofRequestCreation(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (form1 != null) + formParams.add("form1", form1); + if (form2 != null) + formParams.add("form2", form2); + if (form3 != null) + formParams.add("form3", form3); + if (form4 != null) + formParams.add("form4", form4); + if (id != null) + formParams.add("id", id); + if (name != null) + formParams.add("name", name); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/form/oneof", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test form parameter(s) for oneOf schema + * Test form parameter(s) for oneOf schema + *

    200 - Successful operation + * @param form1 The form1 parameter + * @param form2 The form2 parameter + * @param form3 The form3 parameter + * @param form4 The form4 parameter + * @param id The id parameter + * @param name The name parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testFormOneof(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormOneofRequestCreation(form1, form2, form3, form4, id, name).body(localVarReturnType); + } + + /** + * Test form parameter(s) for oneOf schema + * Test form parameter(s) for oneOf schema + *

    200 - Successful operation + * @param form1 The form1 parameter + * @param form2 The form2 parameter + * @param form3 The form3 parameter + * @param form4 The form4 parameter + * @param id The id parameter + * @param name The name parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testFormOneofWithHttpInfo(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testFormOneofRequestCreation(form1, form2, form3, form4, id, name).toEntity(localVarReturnType); + } + + /** + * Test form parameter(s) for oneOf schema + * Test form parameter(s) for oneOf schema + *

    200 - Successful operation + * @param form1 The form1 parameter + * @param form2 The form2 parameter + * @param form3 The form3 parameter + * @param form4 The form4 parameter + * @param id The id parameter + * @param name The name parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testFormOneofWithResponseSpec(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientResponseException { + return testFormOneofRequestCreation(form1, form2, form3, form4, id, name); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/HeaderApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/HeaderApi.java new file mode 100644 index 00000000000..bbfb45c04d8 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/HeaderApi.java @@ -0,0 +1,142 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.StringEnumRef; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HeaderApi { + private ApiClient apiClient; + + public HeaderApi() { + this(new ApiClient()); + } + + @Autowired + public HeaderApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Test header parameter(s) + * Test header parameter(s) + *

    200 - Successful operation + * @param integerHeader The integerHeader parameter + * @param booleanHeader The booleanHeader parameter + * @param stringHeader The stringHeader parameter + * @param enumNonrefStringHeader The enumNonrefStringHeader parameter + * @param enumRefStringHeader The enumRefStringHeader parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testHeaderIntegerBooleanStringEnumsRequestCreation(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + + if (integerHeader != null) + headerParams.add("integer_header", apiClient.parameterToString(integerHeader)); + if (booleanHeader != null) + headerParams.add("boolean_header", apiClient.parameterToString(booleanHeader)); + if (stringHeader != null) + headerParams.add("string_header", apiClient.parameterToString(stringHeader)); + if (enumNonrefStringHeader != null) + headerParams.add("enum_nonref_string_header", apiClient.parameterToString(enumNonrefStringHeader)); + if (enumRefStringHeader != null) + headerParams.add("enum_ref_string_header", apiClient.parameterToString(enumRefStringHeader)); + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/header/integer/boolean/string/enums", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test header parameter(s) + * Test header parameter(s) + *

    200 - Successful operation + * @param integerHeader The integerHeader parameter + * @param booleanHeader The booleanHeader parameter + * @param stringHeader The stringHeader parameter + * @param enumNonrefStringHeader The enumNonrefStringHeader parameter + * @param enumRefStringHeader The enumRefStringHeader parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testHeaderIntegerBooleanStringEnums(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testHeaderIntegerBooleanStringEnumsRequestCreation(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader).body(localVarReturnType); + } + + /** + * Test header parameter(s) + * Test header parameter(s) + *

    200 - Successful operation + * @param integerHeader The integerHeader parameter + * @param booleanHeader The booleanHeader parameter + * @param stringHeader The stringHeader parameter + * @param enumNonrefStringHeader The enumNonrefStringHeader parameter + * @param enumRefStringHeader The enumRefStringHeader parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testHeaderIntegerBooleanStringEnumsWithHttpInfo(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testHeaderIntegerBooleanStringEnumsRequestCreation(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader).toEntity(localVarReturnType); + } + + /** + * Test header parameter(s) + * Test header parameter(s) + *

    200 - Successful operation + * @param integerHeader The integerHeader parameter + * @param booleanHeader The booleanHeader parameter + * @param stringHeader The stringHeader parameter + * @param enumNonrefStringHeader The enumNonrefStringHeader parameter + * @param enumRefStringHeader The enumRefStringHeader parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testHeaderIntegerBooleanStringEnumsWithResponseSpec(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientResponseException { + return testHeaderIntegerBooleanStringEnumsRequestCreation(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/PathApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/PathApi.java new file mode 100644 index 00000000000..766df28f7b0 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/PathApi.java @@ -0,0 +1,148 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.StringEnumRef; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class PathApi { + private ApiClient apiClient; + + public PathApi() { + this(new ApiClient()); + } + + @Autowired + public PathApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Test path parameter(s) + * Test path parameter(s) + *

    200 - Successful operation + * @param pathString The pathString parameter + * @param pathInteger The pathInteger parameter + * @param enumNonrefStringPath The enumNonrefStringPath parameter + * @param enumRefStringPath The enumRefStringPath parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestCreation(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'pathString' is set + if (pathString == null) { + throw new RestClientResponseException("Missing the required parameter 'pathString' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'pathInteger' is set + if (pathInteger == null) { + throw new RestClientResponseException("Missing the required parameter 'pathInteger' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'enumNonrefStringPath' is set + if (enumNonrefStringPath == null) { + throw new RestClientResponseException("Missing the required parameter 'enumNonrefStringPath' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'enumRefStringPath' is set + if (enumRefStringPath == null) { + throw new RestClientResponseException("Missing the required parameter 'enumRefStringPath' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("path_string", pathString); + pathParams.put("path_integer", pathInteger); + pathParams.put("enum_nonref_string_path", enumNonrefStringPath); + pathParams.put("enum_ref_string_path", enumRefStringPath); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test path parameter(s) + * Test path parameter(s) + *

    200 - Successful operation + * @param pathString The pathString parameter + * @param pathInteger The pathInteger parameter + * @param enumNonrefStringPath The enumNonrefStringPath parameter + * @param enumRefStringPath The enumRefStringPath parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestCreation(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).body(localVarReturnType); + } + + /** + * Test path parameter(s) + * Test path parameter(s) + *

    200 - Successful operation + * @param pathString The pathString parameter + * @param pathInteger The pathInteger parameter + * @param enumNonrefStringPath The enumNonrefStringPath parameter + * @param enumRefStringPath The enumRefStringPath parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestCreation(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).toEntity(localVarReturnType); + } + + /** + * Test path parameter(s) + * Test path parameter(s) + *

    200 - Successful operation + * @param pathString The pathString parameter + * @param pathInteger The pathInteger parameter + * @param enumNonrefStringPath The enumNonrefStringPath parameter + * @param enumRefStringPath The enumRefStringPath parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithResponseSpec(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws RestClientResponseException { + return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestCreation(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/QueryApi.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/QueryApi.java new file mode 100644 index 00000000000..c0b7162168d --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/api/QueryApi.java @@ -0,0 +1,788 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.DataQuery; +import java.time.LocalDate; +import java.time.Instant; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter; +import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class QueryApi { + private ApiClient apiClient; + + public QueryApi() { + this(new ApiClient()); + } + + @Autowired + public QueryApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param enumNonrefStringQuery The enumNonrefStringQuery parameter + * @param enumRefStringQuery The enumRefStringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEnumRefStringRequestCreation(String enumNonrefStringQuery, StringEnumRef enumRefStringQuery) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_nonref_string_query", enumNonrefStringQuery)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_ref_string_query", enumRefStringQuery)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/enum_ref_string", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param enumNonrefStringQuery The enumNonrefStringQuery parameter + * @param enumRefStringQuery The enumRefStringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testEnumRefString(String enumNonrefStringQuery, StringEnumRef enumRefStringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEnumRefStringRequestCreation(enumNonrefStringQuery, enumRefStringQuery).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param enumNonrefStringQuery The enumNonrefStringQuery parameter + * @param enumRefStringQuery The enumRefStringQuery parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEnumRefStringWithHttpInfo(String enumNonrefStringQuery, StringEnumRef enumRefStringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEnumRefStringRequestCreation(enumNonrefStringQuery, enumRefStringQuery).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param enumNonrefStringQuery The enumNonrefStringQuery parameter + * @param enumRefStringQuery The enumRefStringQuery parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEnumRefStringWithResponseSpec(String enumNonrefStringQuery, StringEnumRef enumRefStringQuery) throws RestClientResponseException { + return testEnumRefStringRequestCreation(enumNonrefStringQuery, enumRefStringQuery); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param datetimeQuery The datetimeQuery parameter + * @param dateQuery The dateQuery parameter + * @param stringQuery The stringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryDatetimeDateStringRequestCreation(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "datetime_query", datetimeQuery)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "date_query", dateQuery)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_query", stringQuery)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/datetime/date/string", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param datetimeQuery The datetimeQuery parameter + * @param dateQuery The dateQuery parameter + * @param stringQuery The stringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryDatetimeDateString(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryDatetimeDateStringRequestCreation(datetimeQuery, dateQuery, stringQuery).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param datetimeQuery The datetimeQuery parameter + * @param dateQuery The dateQuery parameter + * @param stringQuery The stringQuery parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryDatetimeDateStringWithHttpInfo(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryDatetimeDateStringRequestCreation(datetimeQuery, dateQuery, stringQuery).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param datetimeQuery The datetimeQuery parameter + * @param dateQuery The dateQuery parameter + * @param stringQuery The stringQuery parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryDatetimeDateStringWithResponseSpec(Instant datetimeQuery, LocalDate dateQuery, String stringQuery) throws RestClientResponseException { + return testQueryDatetimeDateStringRequestCreation(datetimeQuery, dateQuery, stringQuery); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param integerQuery The integerQuery parameter + * @param booleanQuery The booleanQuery parameter + * @param stringQuery The stringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryIntegerBooleanStringRequestCreation(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "integer_query", integerQuery)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "boolean_query", booleanQuery)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_query", stringQuery)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/integer/boolean/string", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param integerQuery The integerQuery parameter + * @param booleanQuery The booleanQuery parameter + * @param stringQuery The stringQuery parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryIntegerBooleanString(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryIntegerBooleanStringRequestCreation(integerQuery, booleanQuery, stringQuery).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param integerQuery The integerQuery parameter + * @param booleanQuery The booleanQuery parameter + * @param stringQuery The stringQuery parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryIntegerBooleanStringWithHttpInfo(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryIntegerBooleanStringRequestCreation(integerQuery, booleanQuery, stringQuery).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param integerQuery The integerQuery parameter + * @param booleanQuery The booleanQuery parameter + * @param stringQuery The stringQuery parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryIntegerBooleanStringWithResponseSpec(Integer integerQuery, Boolean booleanQuery, String stringQuery) throws RestClientResponseException { + return testQueryIntegerBooleanStringRequestCreation(integerQuery, booleanQuery, stringQuery); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleDeepObjectExplodeTrueObjectRequestCreation(Pet queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", queryObject.getId())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "name", queryObject.getName())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "category", queryObject.getCategory())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "photoUrls", queryObject.getPhotoUrls())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tags", queryObject.getTags())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "status", queryObject.getStatus())); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_deepObject/explode_true/object", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleDeepObjectExplodeTrueObject(Pet queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleDeepObjectExplodeTrueObjectRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(Pet queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleDeepObjectExplodeTrueObjectRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleDeepObjectExplodeTrueObjectWithResponseSpec(Pet queryObject) throws RestClientResponseException { + return testQueryStyleDeepObjectExplodeTrueObjectRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestCreation(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_object", queryObject)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_deepObject/explode_true/object/allOf", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleDeepObjectExplodeTrueObjectAllOfWithResponseSpec(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject) throws RestClientResponseException { + return testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleFormExplodeFalseArrayIntegerRequestCreation(List queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "query_object", queryObject)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_form/explode_false/array_integer", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleFormExplodeFalseArrayInteger(List queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeFalseArrayIntegerRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(List queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeFalseArrayIntegerRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleFormExplodeFalseArrayIntegerWithResponseSpec(List queryObject) throws RestClientResponseException { + return testQueryStyleFormExplodeFalseArrayIntegerRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleFormExplodeFalseArrayStringRequestCreation(List queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "query_object", queryObject)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_form/explode_false/array_string", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleFormExplodeFalseArrayString(List queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeFalseArrayStringRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(List queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeFalseArrayStringRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleFormExplodeFalseArrayStringWithResponseSpec(List queryObject) throws RestClientResponseException { + return testQueryStyleFormExplodeFalseArrayStringRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleFormExplodeTrueArrayStringRequestCreation(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "values", queryObject.getValues())); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_form/explode_true/array_string", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleFormExplodeTrueArrayString(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueArrayStringRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueArrayStringRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleFormExplodeTrueArrayStringWithResponseSpec(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject) throws RestClientResponseException { + return testQueryStyleFormExplodeTrueArrayStringRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleFormExplodeTrueObjectRequestCreation(Pet queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", queryObject.getId())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "name", queryObject.getName())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "category", queryObject.getCategory())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "photoUrls", queryObject.getPhotoUrls())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tags", queryObject.getTags())); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "status", queryObject.getStatus())); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_form/explode_true/object", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleFormExplodeTrueObject(Pet queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueObjectRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleFormExplodeTrueObjectWithHttpInfo(Pet queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueObjectRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleFormExplodeTrueObjectWithResponseSpec(Pet queryObject) throws RestClientResponseException { + return testQueryStyleFormExplodeTrueObjectRequestCreation(queryObject); + } + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryStyleFormExplodeTrueObjectAllOfRequestCreation(DataQuery queryObject) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_object", queryObject)); + + final String[] localVarAccepts = { + "text/plain" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/query/style_form/explode_true/object/allOf", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String testQueryStyleFormExplodeTrueObjectAllOf(DataQuery queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueObjectAllOfRequestCreation(queryObject).body(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(DataQuery queryObject) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryStyleFormExplodeTrueObjectAllOfRequestCreation(queryObject).toEntity(localVarReturnType); + } + + /** + * Test query parameter(s) + * Test query parameter(s) + *

    200 - Successful operation + * @param queryObject The queryObject parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryStyleFormExplodeTrueObjectAllOfWithResponseSpec(DataQuery queryObject) throws RestClientResponseException { + return testQueryStyleFormExplodeTrueObjectAllOfRequestCreation(queryObject); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f2597a71272 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f0afdd6841c --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..75b318e2922 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Bird.java new file mode 100644 index 00000000000..f957b1d19ba --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Bird.java @@ -0,0 +1,134 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Bird + */ +@JsonPropertyOrder({ + Bird.JSON_PROPERTY_SIZE, + Bird.JSON_PROPERTY_COLOR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Bird { + public static final String JSON_PROPERTY_SIZE = "size"; + private String size; + + public static final String JSON_PROPERTY_COLOR = "color"; + private String color; + + public Bird() { + } + + public Bird size(String size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(String size) { + this.size = size; + } + + public Bird color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Bird bird = (Bird) o; + return Objects.equals(this.size, bird.size) && + Objects.equals(this.color, bird.color); + } + + @Override + public int hashCode() { + return Objects.hash(size, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Bird {\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..cdaceb78a82 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,134 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Category() { + } + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DataQuery.java new file mode 100644 index 00000000000..11342dd7f14 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DataQuery.java @@ -0,0 +1,185 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Query; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DataQuery + */ +@JsonPropertyOrder({ + DataQuery.JSON_PROPERTY_SUFFIX, + DataQuery.JSON_PROPERTY_TEXT, + DataQuery.JSON_PROPERTY_DATE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DataQuery extends Query { + public static final String JSON_PROPERTY_SUFFIX = "suffix"; + private String suffix; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public static final String JSON_PROPERTY_DATE = "date"; + private Instant date; + + public DataQuery() { + + } + + public DataQuery suffix(String suffix) { + + this.suffix = suffix; + return this; + } + + /** + * test suffix + * @return suffix + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSuffix() { + return suffix; + } + + + @JsonProperty(JSON_PROPERTY_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSuffix(String suffix) { + this.suffix = suffix; + } + + public DataQuery text(String text) { + + this.text = text; + return this; + } + + /** + * Some text containing white spaces + * @return text + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getText() { + return text; + } + + + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setText(String text) { + this.text = text; + } + + public DataQuery date(Instant date) { + + this.date = date; + return this; + } + + /** + * A date + * @return date + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Instant getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDate(Instant date) { + this.date = date; + } + + @Override + public DataQuery id(Long id) { + this.setId(id); + return this; + } + + @Override + public DataQuery outcomes(List outcomes) { + this.setOutcomes(outcomes); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataQuery dataQuery = (DataQuery) o; + return Objects.equals(this.suffix, dataQuery.suffix) && + Objects.equals(this.text, dataQuery.text) && + Objects.equals(this.date, dataQuery.date) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(suffix, text, date, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataQuery {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DefaultValue.java new file mode 100644 index 00000000000..71d6e7b290e --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -0,0 +1,464 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * to test the default value of properties + */ +@JsonPropertyOrder({ + DefaultValue.JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT, + DefaultValue.JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT, + DefaultValue.JSON_PROPERTY_ARRAY_STRING_DEFAULT, + DefaultValue.JSON_PROPERTY_ARRAY_INTEGER_DEFAULT, + DefaultValue.JSON_PROPERTY_ARRAY_STRING, + DefaultValue.JSON_PROPERTY_ARRAY_STRING_NULLABLE, + DefaultValue.JSON_PROPERTY_ARRAY_STRING_EXTENSION_NULLABLE, + DefaultValue.JSON_PROPERTY_STRING_NULLABLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DefaultValue { + public static final String JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT = "array_string_enum_ref_default"; + private List arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE)); + + /** + * Gets or Sets arrayStringEnumDefault + */ + public enum ArrayStringEnumDefaultEnum { + SUCCESS("success"), + + FAILURE("failure"), + + UNCLASSIFIED("unclassified"); + + private String value; + + ArrayStringEnumDefaultEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayStringEnumDefaultEnum fromValue(String value) { + for (ArrayStringEnumDefaultEnum b : ArrayStringEnumDefaultEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT = "array_string_enum_default"; + private List arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE)); + + public static final String JSON_PROPERTY_ARRAY_STRING_DEFAULT = "array_string_default"; + private List arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped")); + + public static final String JSON_PROPERTY_ARRAY_INTEGER_DEFAULT = "array_integer_default"; + private List arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3)); + + public static final String JSON_PROPERTY_ARRAY_STRING = "array_string"; + private List arrayString = new ArrayList<>(); + + public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable"; + private JsonNullable> arrayStringNullable = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_STRING_EXTENSION_NULLABLE = "array_string_extension_nullable"; + private JsonNullable> arrayStringExtensionNullable = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_STRING_NULLABLE = "string_nullable"; + private JsonNullable stringNullable = JsonNullable.undefined(); + + public DefaultValue() { + } + + public DefaultValue arrayStringEnumRefDefault(List arrayStringEnumRefDefault) { + + this.arrayStringEnumRefDefault = arrayStringEnumRefDefault; + return this; + } + + public DefaultValue addArrayStringEnumRefDefaultItem(StringEnumRef arrayStringEnumRefDefaultItem) { + if (this.arrayStringEnumRefDefault == null) { + this.arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE)); + } + this.arrayStringEnumRefDefault.add(arrayStringEnumRefDefaultItem); + return this; + } + + /** + * Get arrayStringEnumRefDefault + * @return arrayStringEnumRefDefault + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayStringEnumRefDefault() { + return arrayStringEnumRefDefault; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_REF_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayStringEnumRefDefault(List arrayStringEnumRefDefault) { + this.arrayStringEnumRefDefault = arrayStringEnumRefDefault; + } + + public DefaultValue arrayStringEnumDefault(List arrayStringEnumDefault) { + + this.arrayStringEnumDefault = arrayStringEnumDefault; + return this; + } + + public DefaultValue addArrayStringEnumDefaultItem(ArrayStringEnumDefaultEnum arrayStringEnumDefaultItem) { + if (this.arrayStringEnumDefault == null) { + this.arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE)); + } + this.arrayStringEnumDefault.add(arrayStringEnumDefaultItem); + return this; + } + + /** + * Get arrayStringEnumDefault + * @return arrayStringEnumDefault + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayStringEnumDefault() { + return arrayStringEnumDefault; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_ENUM_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayStringEnumDefault(List arrayStringEnumDefault) { + this.arrayStringEnumDefault = arrayStringEnumDefault; + } + + public DefaultValue arrayStringDefault(List arrayStringDefault) { + + this.arrayStringDefault = arrayStringDefault; + return this; + } + + public DefaultValue addArrayStringDefaultItem(String arrayStringDefaultItem) { + if (this.arrayStringDefault == null) { + this.arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped")); + } + this.arrayStringDefault.add(arrayStringDefaultItem); + return this; + } + + /** + * Get arrayStringDefault + * @return arrayStringDefault + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayStringDefault() { + return arrayStringDefault; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayStringDefault(List arrayStringDefault) { + this.arrayStringDefault = arrayStringDefault; + } + + public DefaultValue arrayIntegerDefault(List arrayIntegerDefault) { + + this.arrayIntegerDefault = arrayIntegerDefault; + return this; + } + + public DefaultValue addArrayIntegerDefaultItem(Integer arrayIntegerDefaultItem) { + if (this.arrayIntegerDefault == null) { + this.arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3)); + } + this.arrayIntegerDefault.add(arrayIntegerDefaultItem); + return this; + } + + /** + * Get arrayIntegerDefault + * @return arrayIntegerDefault + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayIntegerDefault() { + return arrayIntegerDefault; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_INTEGER_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayIntegerDefault(List arrayIntegerDefault) { + this.arrayIntegerDefault = arrayIntegerDefault; + } + + public DefaultValue arrayString(List arrayString) { + + this.arrayString = arrayString; + return this; + } + + public DefaultValue addArrayStringItem(String arrayStringItem) { + if (this.arrayString == null) { + this.arrayString = new ArrayList<>(); + } + this.arrayString.add(arrayStringItem); + return this; + } + + /** + * Get arrayString + * @return arrayString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayString() { + return arrayString; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayString(List arrayString) { + this.arrayString = arrayString; + } + + public DefaultValue arrayStringNullable(List arrayStringNullable) { + this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); + + return this; + } + + public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) { + if (this.arrayStringNullable == null || !this.arrayStringNullable.isPresent()) { + this.arrayStringNullable = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayStringNullable.get().add(arrayStringNullableItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayStringNullable + * @return arrayStringNullable + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public List getArrayStringNullable() { + return arrayStringNullable.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayStringNullable_JsonNullable() { + return arrayStringNullable; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_NULLABLE) + public void setArrayStringNullable_JsonNullable(JsonNullable> arrayStringNullable) { + this.arrayStringNullable = arrayStringNullable; + } + + public void setArrayStringNullable(List arrayStringNullable) { + this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); + } + + public DefaultValue arrayStringExtensionNullable(List arrayStringExtensionNullable) { + this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); + + return this; + } + + public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) { + if (this.arrayStringExtensionNullable == null || !this.arrayStringExtensionNullable.isPresent()) { + this.arrayStringExtensionNullable = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayStringExtensionNullable.get().add(arrayStringExtensionNullableItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayStringExtensionNullable + * @return arrayStringExtensionNullable + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public List getArrayStringExtensionNullable() { + return arrayStringExtensionNullable.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_EXTENSION_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayStringExtensionNullable_JsonNullable() { + return arrayStringExtensionNullable; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_STRING_EXTENSION_NULLABLE) + public void setArrayStringExtensionNullable_JsonNullable(JsonNullable> arrayStringExtensionNullable) { + this.arrayStringExtensionNullable = arrayStringExtensionNullable; + } + + public void setArrayStringExtensionNullable(List arrayStringExtensionNullable) { + this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); + } + + public DefaultValue stringNullable(String stringNullable) { + this.stringNullable = JsonNullable.of(stringNullable); + + return this; + } + + /** + * Get stringNullable + * @return stringNullable + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getStringNullable() { + return stringNullable.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRING_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getStringNullable_JsonNullable() { + return stringNullable; + } + + @JsonProperty(JSON_PROPERTY_STRING_NULLABLE) + public void setStringNullable_JsonNullable(JsonNullable stringNullable) { + this.stringNullable = stringNullable; + } + + public void setStringNullable(String stringNullable) { + this.stringNullable = JsonNullable.of(stringNullable); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultValue defaultValue = (DefaultValue) o; + return Objects.equals(this.arrayStringEnumRefDefault, defaultValue.arrayStringEnumRefDefault) && + Objects.equals(this.arrayStringEnumDefault, defaultValue.arrayStringEnumDefault) && + Objects.equals(this.arrayStringDefault, defaultValue.arrayStringDefault) && + Objects.equals(this.arrayIntegerDefault, defaultValue.arrayIntegerDefault) && + Objects.equals(this.arrayString, defaultValue.arrayString) && + equalsNullable(this.arrayStringNullable, defaultValue.arrayStringNullable) && + equalsNullable(this.arrayStringExtensionNullable, defaultValue.arrayStringExtensionNullable) && + equalsNullable(this.stringNullable, defaultValue.stringNullable); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(arrayStringEnumRefDefault, arrayStringEnumDefault, arrayStringDefault, arrayIntegerDefault, arrayString, hashCodeNullable(arrayStringNullable), hashCodeNullable(arrayStringExtensionNullable), hashCodeNullable(stringNullable)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultValue {\n"); + sb.append(" arrayStringEnumRefDefault: ").append(toIndentedString(arrayStringEnumRefDefault)).append("\n"); + sb.append(" arrayStringEnumDefault: ").append(toIndentedString(arrayStringEnumDefault)).append("\n"); + sb.append(" arrayStringDefault: ").append(toIndentedString(arrayStringDefault)).append("\n"); + sb.append(" arrayIntegerDefault: ").append(toIndentedString(arrayIntegerDefault)).append("\n"); + sb.append(" arrayString: ").append(toIndentedString(arrayString)).append("\n"); + sb.append(" arrayStringNullable: ").append(toIndentedString(arrayStringNullable)).append("\n"); + sb.append(" arrayStringExtensionNullable: ").append(toIndentedString(arrayStringExtensionNullable)).append("\n"); + sb.append(" stringNullable: ").append(toIndentedString(stringNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java new file mode 100644 index 00000000000..688551bccf9 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -0,0 +1,168 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberPropertiesOnly + */ +@JsonPropertyOrder({ + NumberPropertiesOnly.JSON_PROPERTY_NUMBER, + NumberPropertiesOnly.JSON_PROPERTY_FLOAT, + NumberPropertiesOnly.JSON_PROPERTY_DOUBLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NumberPropertiesOnly { + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public NumberPropertiesOnly() { + } + + public NumberPropertiesOnly number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + public NumberPropertiesOnly _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * @return _float + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + public NumberPropertiesOnly _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 0.8 + * maximum: 50.2 + * @return _double + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberPropertiesOnly numberPropertiesOnly = (NumberPropertiesOnly) o; + return Objects.equals(this.number, numberPropertiesOnly.number) && + Objects.equals(this._float, numberPropertiesOnly._float) && + Objects.equals(this._double, numberPropertiesOnly._double); + } + + @Override + public int hashCode() { + return Objects.hash(number, _float, _double); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberPropertiesOnly {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..8d44320cab1 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,316 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private List photoUrls = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet() { + } + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Category getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPhotoUrls() { + return photoUrls; + } + + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, category, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Query.java new file mode 100644 index 00000000000..6ebb85c42cf --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Query.java @@ -0,0 +1,182 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Query + */ +@JsonPropertyOrder({ + Query.JSON_PROPERTY_ID, + Query.JSON_PROPERTY_OUTCOMES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Query { + public static final String JSON_PROPERTY_ID = "id"; + protected Long id; + + /** + * Gets or Sets outcomes + */ + public enum OutcomesEnum { + SUCCESS("SUCCESS"), + + FAILURE("FAILURE"), + + SKIPPED("SKIPPED"); + + private String value; + + OutcomesEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OutcomesEnum fromValue(String value) { + for (OutcomesEnum b : OutcomesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; + protected List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); + + public Query() { + } + + public Query id(Long id) { + + this.id = id; + return this; + } + + /** + * Query + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Query outcomes(List outcomes) { + + this.outcomes = outcomes; + return this; + } + + public Query addOutcomesItem(OutcomesEnum outcomesItem) { + if (this.outcomes == null) { + this.outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); + } + this.outcomes.add(outcomesItem); + return this; + } + + /** + * Get outcomes + * @return outcomes + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTCOMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getOutcomes() { + return outcomes; + } + + + @JsonProperty(JSON_PROPERTY_OUTCOMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutcomes(List outcomes) { + this.outcomes = outcomes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Query query = (Query) o; + return Objects.equals(this.id, query.id) && + Objects.equals(this.outcomes, query.outcomes); + } + + @Override + public int hashCode() { + return Objects.hash(id, outcomes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Query {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/StringEnumRef.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/StringEnumRef.java new file mode 100644 index 00000000000..6e706b20d44 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/StringEnumRef.java @@ -0,0 +1,61 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets StringEnumRef + */ +public enum StringEnumRef { + + SUCCESS("success"), + + FAILURE("failure"), + + UNCLASSIFIED("unclassified"); + + private String value; + + StringEnumRef(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StringEnumRef fromValue(String value) { + for (StringEnumRef b : StringEnumRef.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..b70725be92e --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,134 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Tag() { + } + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java new file mode 100644 index 00000000000..62940d684f0 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -0,0 +1,104 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestFormObjectMultipartRequestMarker + */ +@JsonPropertyOrder({ + TestFormObjectMultipartRequestMarker.JSON_PROPERTY_NAME +}) +@JsonTypeName("test_form_object_multipart_request_marker") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestFormObjectMultipartRequestMarker { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TestFormObjectMultipartRequestMarker() { + } + + public TestFormObjectMultipartRequestMarker name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestFormObjectMultipartRequestMarker testFormObjectMultipartRequestMarker = (TestFormObjectMultipartRequestMarker) o; + return Objects.equals(this.name, testFormObjectMultipartRequestMarker.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestFormObjectMultipartRequestMarker {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java new file mode 100644 index 00000000000..4c0e64a52a2 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -0,0 +1,197 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + */ +@JsonPropertyOrder({ + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_SIZE, + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_COLOR, + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_ID, + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_NAME +}) +@JsonTypeName("test_query_style_deepObject_explode_true_object_allOf_query_object_parameter") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter { + public static final String JSON_PROPERTY_SIZE = "size"; + private String size; + + public static final String JSON_PROPERTY_COLOR = "color"; + private String color; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() { + } + + public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter size(String size) { + + this.size = size; + return this; + } + + /** + * Get size + * @return size + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSize() { + return size; + } + + + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSize(String size) { + this.size = size; + } + + public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter = (TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter) o; + return Objects.equals(this.size, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.size) && + Objects.equals(this.color, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.color) && + Objects.equals(this.id, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.id) && + Objects.equals(this.name, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.name); + } + + @Override + public int hashCode() { + return Objects.hash(size, color, id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java new file mode 100644 index 00000000000..568f4dd7d5a --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -0,0 +1,115 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + */ +@JsonPropertyOrder({ + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.JSON_PROPERTY_VALUES +}) +@JsonTypeName("test_query_style_form_explode_true_array_string_query_object_parameter") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter { + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = new ArrayList<>(); + + public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { + } + + public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter values(List values) { + + this.values = values; + return this; + } + + public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Get values + * @return values + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getValues() { + return values; + } + + + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValues(List values) { + this.values = values; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter testQueryStyleFormExplodeTrueArrayStringQueryObjectParameter = (TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter) o; + return Objects.equals(this.values, testQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.values); + } + + @Override + public int hashCode() { + return Objects.hash(values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java new file mode 100644 index 00000000000..e258cc91dbd --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -0,0 +1,62 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.Test; + +/** + * API tests for AuthApi + */ +public class AuthApiTest { + + private final AuthApi api = new AuthApi(); + + /** + * To test HTTP basic authentication + * + *

    To test HTTP basic authentication + */ + @Test + public void testAuthHttpBasicTest() { + // given + api.getApiClient().setUsername("test_user"); + api.getApiClient().setPassword("test_password"); + + // when + String response = api.testAuthHttpBasic(); + + assertThat( + response, + containsString("Authorization: Basic dGVzdF91c2VyOnRlc3RfcGFzc3dvcmQ=")); + } + + /** + * To test HTTP bearer authentication + * + *

    To test HTTP bearer authentication + */ + @Test + public void testAuthHttpBearerTest() { + // given + api.getApiClient().setBearerToken("test_token"); + + // when + String response = api.testAuthHttpBearer(); + + assertThat(response, containsString("Authorization: Bearer test_token")); + } +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java new file mode 100644 index 00000000000..61840f4251b --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -0,0 +1,204 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; +import org.junit.Test; +import org.openapitools.client.ApiClient; +import org.openapitools.client.GifHttpMessageConverter; +import org.openapitools.client.OctetStreamHttpMessageConverter; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.client.model.Tag; + +/** API tests for BodyApi */ +public class BodyApiTest { + + private final BodyApi api = new BodyApi(); + + /** + * Test binary (gif) response body + * + *

    Test binary (gif) response body + */ + @Test + public void testBinaryGifTest() throws IOException { + // given + var restClient = + ApiClient.buildRestClientBuilder() + .messageConverters(converters -> converters.add(new GifHttpMessageConverter())) + .build(); + api.setApiClient(new ApiClient(restClient)); + + // when + File response = api.testBinaryGif(); + + // then + assertThat(response, notNullValue()); + assertThat(response.exists(), is(true)); + assertThat(Files.probeContentType(response.toPath()), is("image/gif")); + } + + /** + * Test body parameter(s) + * + *

    Test body parameter(s) + */ + @Test + public void testBodyApplicationOctetstreamBinaryTest() throws IOException { + // given + var restClient = + ApiClient.buildRestClientBuilder() + .messageConverters(converters -> converters.add(new OctetStreamHttpMessageConverter())) + .build(); + api.setApiClient(new ApiClient(restClient)); + + var tempFile = Files.createTempFile("test", ".txt"); + Files.writeString(tempFile, "test123"); + + File body = tempFile.toFile(); + + // when + String response = api.testBodyApplicationOctetstreamBinary(body); + + // then + assertThat(response, containsString("Content-Type: application/octet-stream")); + assertThat(response, containsString("test123")); + } + + /** + * Test array of binary in multipart mime + * + *

    Test array of binary in multipart mime + */ + @Test + public void testBodyMultipartFormdataArrayOfBinaryTest() throws IOException { + // given + var firstFile = Files.createTempFile("test", ".txt"); + String firstFileContent = "Thanks for using OpenAPI generator :)"; + Files.writeString(firstFile, firstFileContent); + + var secondFile = Files.createTempFile("test2", ".txt"); + String secondFileContent = "Your ad could be here"; + Files.writeString(secondFile, secondFileContent); + + List files = List.of(firstFile.toFile(), secondFile.toFile()); + + // when + String response = api.testBodyMultipartFormdataArrayOfBinary(files); + + // then + assertThat(response, containsString("Content-Type: multipart/form-data")); + assertThat(response, containsString(firstFileContent)); + assertThat(response, containsString(secondFileContent)); + } + + /** + * Test single binary in multipart mime + * + *

    Test single binary in multipart mime + */ + @Test + public void testBodyMultipartFormdataSingleBinaryTest() { + File myFile = null; + String response = api.testBodyMultipartFormdataSingleBinary(myFile); + + // TODO: test validations + } + + /** + * Test body parameter(s) + * + *

    Test body parameter(s) + */ + @Test + public void testEchoBodyAllOfPetTest() { + Pet pet = null; + Pet response = api.testEchoBodyAllOfPet(pet); + + // TODO: test validations + } + + /** + * Test free form object + * + *

    Test free form object + */ + @Test + public void testEchoBodyFreeFormObjectResponseStringTest() { + Object body = null; + String response = api.testEchoBodyFreeFormObjectResponseString(body); + + // TODO: test validations + } + + /** + * Test body parameter(s) + * + *

    Test body parameter(s) + */ + @Test + public void testEchoBodyPetTest() { + Pet pet = null; + Pet response = api.testEchoBodyPet(pet); + + // TODO: test validations + } + + /** + * Test empty response body + * + *

    Test empty response body + */ + @Test + public void testEchoBodyPetResponseStringTest() { + Pet pet = null; + String response = api.testEchoBodyPetResponseString(pet); + + // TODO: test validations + } + + /** + * Test string enum response body + * + *

    Test string enum response body + */ + @Test + public void testEchoBodyStringEnumTest() { + String body = null; + StringEnumRef response = api.testEchoBodyStringEnum(body); + + // TODO: test validations + } + + /** + * Test empty json (request body) + * + *

    Test empty json (request body) + */ + @Test + public void testEchoBodyTagResponseStringTest() { + Tag tag = null; + String response = api.testEchoBodyTagResponseString(tag); + + // TODO: test validations + } +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java new file mode 100644 index 00000000000..2db712c5dd7 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/FormApiTest.java @@ -0,0 +1,81 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.TestFormObjectMultipartRequestMarker; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for FormApi + */ +@Ignore +public class FormApiTest { + + private final FormApi api = new FormApi(); + + + /** + * Test form parameter(s) + * + * Test form parameter(s) + */ + @Test + public void testFormIntegerBooleanStringTest() { + Integer integerForm = null; + Boolean booleanForm = null; + String stringForm = null; + String response = api.testFormIntegerBooleanString(integerForm, booleanForm, stringForm); + + // TODO: test validations + } + + /** + * Test form parameter(s) for multipart schema + * + * Test form parameter(s) for multipart schema + */ + @Test + public void testFormObjectMultipartTest() { + TestFormObjectMultipartRequestMarker marker = null; + String response = api.testFormObjectMultipart(marker); + + // TODO: test validations + } + + /** + * Test form parameter(s) for oneOf schema + * + * Test form parameter(s) for oneOf schema + */ + @Test + public void testFormOneofTest() { + String form1 = null; + Integer form2 = null; + String form3 = null; + Boolean form4 = null; + Long id = null; + String name = null; + String response = api.testFormOneof(form1, form2, form3, form4, id, name); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java new file mode 100644 index 00000000000..bc92762bfc8 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/HeaderApiTest.java @@ -0,0 +1,52 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.StringEnumRef; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for HeaderApi + */ +@Ignore +public class HeaderApiTest { + + private final HeaderApi api = new HeaderApi(); + + + /** + * Test header parameter(s) + * + * Test header parameter(s) + */ + @Test + public void testHeaderIntegerBooleanStringEnumsTest() { + Integer integerHeader = null; + Boolean booleanHeader = null; + String stringHeader = null; + String enumNonrefStringHeader = null; + StringEnumRef enumRefStringHeader = null; + String response = api.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java new file mode 100644 index 00000000000..dfb396727f4 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/PathApiTest.java @@ -0,0 +1,51 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.StringEnumRef; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for PathApi + */ +@Ignore +public class PathApiTest { + + private final PathApi api = new PathApi(); + + + /** + * Test path parameter(s) + * + * Test path parameter(s) + */ + @Test + public void testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathTest() { + String pathString = null; + Integer pathInteger = null; + String enumNonrefStringPath = null; + StringEnumRef enumRefStringPath = null; + String response = api.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java new file mode 100644 index 00000000000..72e47f93f69 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/api/QueryApiTest.java @@ -0,0 +1,176 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.DataQuery; +import java.time.LocalDate; +import java.time.Instant; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter; +import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for QueryApi + */ +@Ignore +public class QueryApiTest { + + private final QueryApi api = new QueryApi(); + + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testEnumRefStringTest() { + String enumNonrefStringQuery = null; + StringEnumRef enumRefStringQuery = null; + String response = api.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryDatetimeDateStringTest() { + Instant datetimeQuery = null; + LocalDate dateQuery = null; + String stringQuery = null; + String response = api.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryIntegerBooleanStringTest() { + Integer integerQuery = null; + Boolean booleanQuery = null; + String stringQuery = null; + String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleDeepObjectExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleDeepObjectExplodeTrueObjectAllOfTest() { + TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = null; + String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayIntegerTest() { + List queryObject = null; + String response = api.testQueryStyleFormExplodeFalseArrayInteger(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeFalseArrayStringTest() { + List queryObject = null; + String response = api.testQueryStyleFormExplodeFalseArrayString(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeTrueArrayStringTest() { + TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = null; + String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeTrueObjectTest() { + Pet queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObject(queryObject); + + // TODO: test validations + } + + /** + * Test query parameter(s) + * + * Test query parameter(s) + */ + @Test + public void testQueryStyleFormExplodeTrueObjectAllOfTest() { + DataQuery queryObject = null; + String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/BirdTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/BirdTest.java new file mode 100644 index 00000000000..ec1f99fb9c7 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/BirdTest.java @@ -0,0 +1,55 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Bird + */ +class BirdTest { + private final Bird model = new Bird(); + + /** + * Model tests for Bird + */ + @Test + void testBird() { + // TODO: test Bird + } + + /** + * Test the property 'size' + */ + @Test + void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..f0d26f9ea16 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,55 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DataQueryTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DataQueryTest.java new file mode 100644 index 00000000000..7ef9ac1c94c --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DataQueryTest.java @@ -0,0 +1,84 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Query; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DataQuery + */ +class DataQueryTest { + private final DataQuery model = new DataQuery(); + + /** + * Model tests for DataQuery + */ + @Test + void testDataQuery() { + // TODO: test DataQuery + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'outcomes' + */ + @Test + void outcomesTest() { + // TODO: test outcomes + } + + /** + * Test the property 'suffix' + */ + @Test + void suffixTest() { + // TODO: test suffix + } + + /** + * Test the property 'text' + */ + @Test + void textTest() { + // TODO: test text + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java new file mode 100644 index 00000000000..c5c50cd558e --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/DefaultValueTest.java @@ -0,0 +1,111 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.StringEnumRef; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DefaultValue + */ +class DefaultValueTest { + private final DefaultValue model = new DefaultValue(); + + /** + * Model tests for DefaultValue + */ + @Test + void testDefaultValue() { + // TODO: test DefaultValue + } + + /** + * Test the property 'arrayStringEnumRefDefault' + */ + @Test + void arrayStringEnumRefDefaultTest() { + // TODO: test arrayStringEnumRefDefault + } + + /** + * Test the property 'arrayStringEnumDefault' + */ + @Test + void arrayStringEnumDefaultTest() { + // TODO: test arrayStringEnumDefault + } + + /** + * Test the property 'arrayStringDefault' + */ + @Test + void arrayStringDefaultTest() { + // TODO: test arrayStringDefault + } + + /** + * Test the property 'arrayIntegerDefault' + */ + @Test + void arrayIntegerDefaultTest() { + // TODO: test arrayIntegerDefault + } + + /** + * Test the property 'arrayString' + */ + @Test + void arrayStringTest() { + // TODO: test arrayString + } + + /** + * Test the property 'arrayStringNullable' + */ + @Test + void arrayStringNullableTest() { + // TODO: test arrayStringNullable + } + + /** + * Test the property 'arrayStringExtensionNullable' + */ + @Test + void arrayStringExtensionNullableTest() { + // TODO: test arrayStringExtensionNullable + } + + /** + * Test the property 'stringNullable' + */ + @Test + void stringNullableTest() { + // TODO: test stringNullable + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java new file mode 100644 index 00000000000..66d88b69519 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -0,0 +1,64 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberPropertiesOnly + */ +class NumberPropertiesOnlyTest { + private final NumberPropertiesOnly model = new NumberPropertiesOnly(); + + /** + * Model tests for NumberPropertiesOnly + */ + @Test + void testNumberPropertiesOnly() { + // TODO: test NumberPropertiesOnly + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..f6536444b01 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,92 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/QueryTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/QueryTest.java new file mode 100644 index 00000000000..fa0bd0293bd --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/QueryTest.java @@ -0,0 +1,58 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Query + */ +class QueryTest { + private final Query model = new Query(); + + /** + * Model tests for Query + */ + @Test + void testQuery() { + // TODO: test Query + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'outcomes' + */ + @Test + void outcomesTest() { + // TODO: test outcomes + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java new file mode 100644 index 00000000000..24bac66784b --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/StringEnumRefTest.java @@ -0,0 +1,32 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for StringEnumRef + */ +class StringEnumRefTest { + /** + * Model tests for StringEnumRef + */ + @Test + void testStringEnumRef() { + // TODO: test StringEnumRef + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..e444ad14095 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,55 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java new file mode 100644 index 00000000000..178d1b8013d --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java @@ -0,0 +1,47 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestFormObjectMultipartRequestMarker + */ +class TestFormObjectMultipartRequestMarkerTest { + private final TestFormObjectMultipartRequestMarker model = new TestFormObjectMultipartRequestMarker(); + + /** + * Model tests for TestFormObjectMultipartRequestMarker + */ + @Test + void testTestFormObjectMultipartRequestMarker() { + // TODO: test TestFormObjectMultipartRequestMarker + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java new file mode 100644 index 00000000000..de68c2a5047 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java @@ -0,0 +1,71 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + */ +class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest { + private final TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter model = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(); + + /** + * Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + */ + @Test + void testTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() { + // TODO: test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter + } + + /** + * Test the property 'size' + */ + @Test + void sizeTest() { + // TODO: test size + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java new file mode 100644 index 00000000000..e85ace64349 --- /dev/null +++ b/samples/client/echo_api/java/restclient/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java @@ -0,0 +1,50 @@ +/* + * Echo Server API + * Echo Server API + * + * The version of the OpenAPI document: 0.1.0 + * Contact: team@openapitools.org + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + */ +class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest { + private final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter model = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(); + + /** + * Model tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + */ + @Test + void testTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() { + // TODO: test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + } + + /** + * Test the property 'values' + */ + @Test + void valuesTest() { + // TODO: test values + } + +} diff --git a/samples/client/echo_api/java/resteasy/.github/workflows/maven.yml b/samples/client/echo_api/java/resteasy/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/resteasy/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/resteasy/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/resteasy/build.gradle b/samples/client/echo_api/java/resteasy/build.gradle index 62d43afabd0..e009dc7c480 100644 --- a/samples/client/echo_api/java/resteasy/build.gradle +++ b/samples/client/echo_api/java/resteasy/build.gradle @@ -104,7 +104,8 @@ ext { jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -120,5 +121,6 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/echo_api/java/resteasy/build.sbt b/samples/client/echo_api/java/resteasy/build.sbt index 0c31d90292c..f68a75caf0e 100644 --- a/samples/client/echo_api/java/resteasy/build.sbt +++ b/samples/client/echo_api/java/resteasy/build.sbt @@ -19,7 +19,8 @@ lazy val root = (project in file(".")). "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/resteasy/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/resteasy/gradlew b/samples/client/echo_api/java/resteasy/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/resteasy/gradlew +++ b/samples/client/echo_api/java/resteasy/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/resteasy/gradlew.bat b/samples/client/echo_api/java/resteasy/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/resteasy/gradlew.bat +++ b/samples/client/echo_api/java/resteasy/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/resteasy/pom.xml b/samples/client/echo_api/java/resteasy/pom.xml index 99657b8eda7..d4708d3830c 100644 --- a/samples/client/echo_api/java/resteasy/pom.xml +++ b/samples/client/echo_api/java/resteasy/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -64,7 +64,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -240,8 +239,14 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -255,6 +260,7 @@ 1.3.5 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Bird.java index 01a81f9a59d..0df0f1d3863 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Bird.java @@ -66,7 +66,6 @@ public class Bird { this.size = size; } - public Bird color(String color) { this.color = color; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index 30fed94b542..afb07767b0f 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DataQuery.java index d4077f48c7b..eee802c691b 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DataQuery.java @@ -76,7 +76,6 @@ public class DataQuery extends Query { this.suffix = suffix; } - public DataQuery text(String text) { this.text = text; @@ -102,7 +101,6 @@ public class DataQuery extends Query { this.text = text; } - public DataQuery date(OffsetDateTime date) { this.date = date; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DefaultValue.java index aab8a63b161..81b9778a076 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -143,7 +143,6 @@ public class DefaultValue { this.arrayStringEnumRefDefault = arrayStringEnumRefDefault; } - public DefaultValue arrayStringEnumDefault(List arrayStringEnumDefault) { this.arrayStringEnumDefault = arrayStringEnumDefault; @@ -177,7 +176,6 @@ public class DefaultValue { this.arrayStringEnumDefault = arrayStringEnumDefault; } - public DefaultValue arrayStringDefault(List arrayStringDefault) { this.arrayStringDefault = arrayStringDefault; @@ -211,7 +209,6 @@ public class DefaultValue { this.arrayStringDefault = arrayStringDefault; } - public DefaultValue arrayIntegerDefault(List arrayIntegerDefault) { this.arrayIntegerDefault = arrayIntegerDefault; @@ -245,7 +242,6 @@ public class DefaultValue { this.arrayIntegerDefault = arrayIntegerDefault; } - public DefaultValue arrayString(List arrayString) { this.arrayString = arrayString; @@ -279,7 +275,6 @@ public class DefaultValue { this.arrayString = arrayString; } - public DefaultValue arrayStringNullable(List arrayStringNullable) { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); @@ -325,7 +320,6 @@ public class DefaultValue { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); } - public DefaultValue arrayStringExtensionNullable(List arrayStringExtensionNullable) { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); @@ -371,7 +365,6 @@ public class DefaultValue { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); } - public DefaultValue stringNullable(String stringNullable) { this.stringNullable = JsonNullable.of(stringNullable); diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 5963fae9fe8..2913c549de0 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -71,7 +71,6 @@ public class NumberPropertiesOnly { this.number = number; } - public NumberPropertiesOnly _float(Float _float) { this._float = _float; @@ -97,7 +96,6 @@ public class NumberPropertiesOnly { this._float = _float; } - public NumberPropertiesOnly _double(Double _double) { this._double = _double; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index b6967086b13..2d17466ca26 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -124,7 +124,6 @@ public class Pet { this.id = id; } - public Pet name(String name) { this.name = name; @@ -150,7 +149,6 @@ public class Pet { this.name = name; } - public Pet category(Category category) { this.category = category; @@ -176,7 +174,6 @@ public class Pet { this.category = category; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -210,7 +207,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -244,7 +240,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Query.java index c328a674e64..767043cacdf 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Query.java @@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Query { public static final String JSON_PROPERTY_ID = "id"; - private Long id; + protected Long id; /** * Gets or Sets outcomes @@ -76,7 +76,7 @@ public class Query { } public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; - private List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); + protected List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); public Query() { } @@ -106,7 +106,6 @@ public class Query { this.id = id; } - public Query outcomes(List outcomes) { this.outcomes = outcomes; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index e3d03bf9472..a94d6f76e51 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index daf5259ea22..b5fb16b3f7a 100644 --- a/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/resteasy/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -75,7 +75,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.size = size; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) { this.color = color; @@ -101,7 +100,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.color = color; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) { this.id = id; @@ -127,7 +125,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.id = id; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/CustomTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/CustomTest.java index 1ffbe4ace09..5f93aab9399 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/CustomTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/CustomTest.java @@ -11,28 +11,18 @@ */ -package org.openapitools.client.api; +package org.openapitools.client; + +import org.junit.jupiter.api.Test; +import org.openapitools.client.api.BodyApi; +import org.openapitools.client.api.EchoServerResponseParser; -import org.openapitools.client.ApiException; import java.io.File; -import org.openapitools.client.model.Pet; -import org.openapitools.client.model.Tag; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; - import java.io.FileWriter; import java.io.IOException; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * API tests @@ -62,12 +52,12 @@ public class CustomTest { api.testBodyMultipartFormdataSingleBinary(myFile); EchoServerResponseParser parser = - new EchoServerResponseParser(response); + new org.openapitools.client.api.EchoServerResponseParser(response); String contentDisposition = parser.headers.get("Content-Disposition"); - assertThat(contentDisposition, containsString( + assertThat(contentDisposition).contains( "form-data; name=\"my-file\"; filename=\"test.txt\"" - )); + ); } } diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/AuthApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/AuthApiTest.java index 17e790b7617..6a7b7a4736c 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/AuthApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/AuthApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/BodyApiTest.java index 3d2102e4643..a8d0edaa3f2 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/BodyApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/BodyApiTest.java @@ -13,26 +13,16 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiException; -import java.io.File; -import org.openapitools.client.model.Pet; -import org.openapitools.client.model.Tag; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.openapitools.client.api.EchoServerResponseParser; +import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * API tests for BodyApi @@ -117,9 +107,9 @@ public class BodyApiTest { String contentDisposition = parser.headers.get("Content-Disposition"); - assertThat(contentDisposition, containsString( + assertThat(contentDisposition).contains( "form-data; name=\"my-file\"; filename=\"test.txt\"" - )); + ); } /** diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/FormApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/FormApiTest.java index df8fae9511d..564f7c35a4e 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/FormApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/FormApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/HeaderApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/HeaderApiTest.java index 9132aeb9b78..1f2b0cbf479 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/HeaderApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/HeaderApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/PathApiTest.java index a48fb9c3bf3..f2f6763b121 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/PathApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/PathApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.StringEnumRef; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/QueryApiTest.java index a2bd6f65721..c6df34a18c8 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/QueryApiTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/api/QueryApiTest.java @@ -21,9 +21,9 @@ import org.openapitools.client.model.Pet; import org.openapitools.client.model.StringEnumRef; import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/BirdTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/BirdTest.java index 3e82e9d7553..487f1889a98 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/BirdTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/BirdTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Bird diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java index 5b6a08fd677..1a53a0d9098 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DataQueryTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DataQueryTest.java index d08082e114e..78b52f08ac7 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DataQueryTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DataQueryTest.java @@ -23,9 +23,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Query; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DataQuery diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DefaultValueTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DefaultValueTest.java index 843a43b28d7..bfbfeaf1dad 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DefaultValueTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/DefaultValueTest.java @@ -26,9 +26,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DefaultValue diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java index 80e515fd707..6cad1033030 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/NumberPropertiesOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberPropertiesOnly diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java index 30e1991c7e3..e56a9b18d6e 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java @@ -23,9 +23,9 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/QueryTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/QueryTest.java index 3ae0ecb7b70..f9affa7e675 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/QueryTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/QueryTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Query diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/StringEnumRefTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/StringEnumRefTest.java index 81bf17732bd..9c9ddedd8ad 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/StringEnumRefTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/StringEnumRefTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for StringEnumRef diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java index 073b7aca33c..d74de216cfa 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java index cdb7c02c0fd..d5d0fc51cc1 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarkerTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestFormObjectMultipartRequestMarker diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java index 8ab39f47d76..d316ca8550e 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter diff --git a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java index f3e020346fa..21cff973e25 100644 --- a/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java +++ b/samples/client/echo_api/java/resteasy/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter diff --git a/samples/client/echo_api/java/resttemplate/.github/workflows/maven.yml b/samples/client/echo_api/java/resttemplate/.github/workflows/maven.yml index 4ff479f4b4f..543a3007900 100644 --- a/samples/client/echo_api/java/resttemplate/.github/workflows/maven.yml +++ b/samples/client/echo_api/java/resttemplate/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/java/resttemplate/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/java/resttemplate/gradlew b/samples/client/echo_api/java/resttemplate/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/echo_api/java/resttemplate/gradlew +++ b/samples/client/echo_api/java/resttemplate/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/java/resttemplate/gradlew.bat b/samples/client/echo_api/java/resttemplate/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/echo_api/java/resttemplate/gradlew.bat +++ b/samples/client/echo_api/java/resttemplate/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java index 01a81f9a59d..0df0f1d3863 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java @@ -66,7 +66,6 @@ public class Bird { this.size = size; } - public Bird color(String color) { this.color = color; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 30fed94b542..afb07767b0f 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java index d4077f48c7b..eee802c691b 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java @@ -76,7 +76,6 @@ public class DataQuery extends Query { this.suffix = suffix; } - public DataQuery text(String text) { this.text = text; @@ -102,7 +101,6 @@ public class DataQuery extends Query { this.text = text; } - public DataQuery date(OffsetDateTime date) { this.date = date; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java index ae05fd898b1..784ec93aea7 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -143,7 +143,6 @@ public class DefaultValue { this.arrayStringEnumRefDefault = arrayStringEnumRefDefault; } - public DefaultValue arrayStringEnumDefault(List arrayStringEnumDefault) { this.arrayStringEnumDefault = arrayStringEnumDefault; @@ -177,7 +176,6 @@ public class DefaultValue { this.arrayStringEnumDefault = arrayStringEnumDefault; } - public DefaultValue arrayStringDefault(List arrayStringDefault) { this.arrayStringDefault = arrayStringDefault; @@ -211,7 +209,6 @@ public class DefaultValue { this.arrayStringDefault = arrayStringDefault; } - public DefaultValue arrayIntegerDefault(List arrayIntegerDefault) { this.arrayIntegerDefault = arrayIntegerDefault; @@ -245,7 +242,6 @@ public class DefaultValue { this.arrayIntegerDefault = arrayIntegerDefault; } - public DefaultValue arrayString(List arrayString) { this.arrayString = arrayString; @@ -279,7 +275,6 @@ public class DefaultValue { this.arrayString = arrayString; } - public DefaultValue arrayStringNullable(List arrayStringNullable) { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); @@ -325,7 +320,6 @@ public class DefaultValue { this.arrayStringNullable = JsonNullable.>of(arrayStringNullable); } - public DefaultValue arrayStringExtensionNullable(List arrayStringExtensionNullable) { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); @@ -371,7 +365,6 @@ public class DefaultValue { this.arrayStringExtensionNullable = JsonNullable.>of(arrayStringExtensionNullable); } - public DefaultValue stringNullable(String stringNullable) { this.stringNullable = JsonNullable.of(stringNullable); diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 5963fae9fe8..2913c549de0 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -71,7 +71,6 @@ public class NumberPropertiesOnly { this.number = number; } - public NumberPropertiesOnly _float(Float _float) { this._float = _float; @@ -97,7 +96,6 @@ public class NumberPropertiesOnly { this._float = _float; } - public NumberPropertiesOnly _double(Double _double) { this._double = _double; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index f6631a81414..0b551082dfb 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -124,7 +124,6 @@ public class Pet { this.id = id; } - public Pet name(String name) { this.name = name; @@ -150,7 +149,6 @@ public class Pet { this.name = name; } - public Pet category(Category category) { this.category = category; @@ -176,7 +174,6 @@ public class Pet { this.category = category; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -210,7 +207,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -244,7 +240,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java index c328a674e64..767043cacdf 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java @@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class Query { public static final String JSON_PROPERTY_ID = "id"; - private Long id; + protected Long id; /** * Gets or Sets outcomes @@ -76,7 +76,7 @@ public class Query { } public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; - private List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); + protected List outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE)); public Query() { } @@ -106,7 +106,6 @@ public class Query { this.id = id; } - public Query outcomes(List outcomes) { this.outcomes = outcomes; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index e3d03bf9472..a94d6f76e51 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index daf5259ea22..b5fb16b3f7a 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -75,7 +75,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.size = size; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) { this.color = color; @@ -101,7 +100,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.color = color; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) { this.id = id; @@ -127,7 +125,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter this.id = id; } - public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) { this.name = name; diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/build.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/build.gradle index 2e7658f2f33..2fc16aeeb5c 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/build.gradle +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - ext.spring_boot_version = "3.2.4" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spring_boot_version = "3.2.5" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew.bat b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew.bat +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/settings.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/settings.gradle index 854d039d418..431927491c3 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/settings.gradle +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-client' diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle index 2e7658f2f33..99192219a9d 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - ext.spring_boot_version = "3.2.4" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spring_boot_version = "3.2.5" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } @@ -59,11 +58,13 @@ kotlin { languageVersion.set(JavaLanguageVersion.of(17)) } } + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0" - implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" + implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" + implementation "io.projectreactor:reactor-core:3.6.5" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle index 854d039d418..431927491c3 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-client' diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt index cc3e26512b0..1b274175268 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt @@ -17,33 +17,37 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.infrastructure.* -class AuthApi(client: RestClient) : ApiClient(client) { +class AuthApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testAuthHttpBasic(): kotlin.String { - val result = testAuthHttpBasicWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testAuthHttpBasic(): Mono { + return testAuthHttpBasicWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testAuthHttpBasicWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testAuthHttpBasicWithHttpInfo(): Mono> { val localVariableConfig = testAuthHttpBasicRequestConfig() return request( localVariableConfig @@ -71,14 +75,14 @@ class AuthApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testAuthHttpBearer(): kotlin.String { - val result = testAuthHttpBearerWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testAuthHttpBearer(): Mono { + return testAuthHttpBearerWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testAuthHttpBearerWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testAuthHttpBearerWithHttpInfo(): Mono> { val localVariableConfig = testAuthHttpBearerRequestConfig() return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt index 44ca769307d..49d9a5840be 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt @@ -17,35 +17,39 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.Pet import org.openapitools.client.models.Tag import org.openapitools.client.infrastructure.* -class BodyApi(client: RestClient) : ApiClient(client) { +class BodyApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testBinaryGif(): java.io.File { - val result = testBinaryGifWithHttpInfo() - return result.body!! + @Throws(WebClientResponseException::class) + fun testBinaryGif(): Mono { + return testBinaryGifWithHttpInfo() + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBinaryGifWithHttpInfo(): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBinaryGifWithHttpInfo(): Mono> { val localVariableConfig = testBinaryGifRequestConfig() return request( localVariableConfig @@ -73,14 +77,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): kotlin.String { - val result = testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): Mono { + return testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyApplicationOctetstreamBinaryWithHttpInfo(body: java.io.File? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyApplicationOctetstreamBinaryWithHttpInfo(body: java.io.File? = null): Mono> { val localVariableConfig = testBodyApplicationOctetstreamBinaryRequestConfig(body = body) return request( localVariableConfig @@ -109,14 +113,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List): kotlin.String { - val result = testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List): Mono { + return testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files: kotlin.collections.List): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files: kotlin.collections.List): Mono> { val localVariableConfig = testBodyMultipartFormdataArrayOfBinaryRequestConfig(files = files) return request>, kotlin.String>( localVariableConfig @@ -145,14 +149,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): kotlin.String { - val result = testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile) - return result.body!! + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): Mono { + return testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile: java.io.File? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile: java.io.File? = null): Mono> { val localVariableConfig = testBodyMultipartFormdataSingleBinaryRequestConfig(myFile = myFile) return request>, kotlin.String>( localVariableConfig @@ -181,14 +185,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): kotlin.String { - val result = testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): Mono { + return testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body: kotlin.Any? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body: kotlin.Any? = null): Mono> { val localVariableConfig = testEchoBodyFreeFormObjectResponseStringRequestConfig(body = body) return request( localVariableConfig @@ -217,14 +221,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyPet(pet: Pet? = null): Pet { - val result = testEchoBodyPetWithHttpInfo(pet = pet) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyPet(pet: Pet? = null): Mono { + return testEchoBodyPetWithHttpInfo(pet = pet) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetWithHttpInfo(pet: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyPetWithHttpInfo(pet: Pet? = null): Mono> { val localVariableConfig = testEchoBodyPetRequestConfig(pet = pet) return request( localVariableConfig @@ -253,14 +257,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetResponseString(pet: Pet? = null): kotlin.String { - val result = testEchoBodyPetResponseStringWithHttpInfo(pet = pet) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyPetResponseString(pet: Pet? = null): Mono { + return testEchoBodyPetResponseStringWithHttpInfo(pet = pet) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyPetResponseStringWithHttpInfo(pet: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyPetResponseStringWithHttpInfo(pet: Pet? = null): Mono> { val localVariableConfig = testEchoBodyPetResponseStringRequestConfig(pet = pet) return request( localVariableConfig @@ -289,14 +293,14 @@ class BodyApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEchoBodyTagResponseString(tag: Tag? = null): kotlin.String { - val result = testEchoBodyTagResponseStringWithHttpInfo(tag = tag) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEchoBodyTagResponseString(tag: Tag? = null): Mono { + return testEchoBodyTagResponseStringWithHttpInfo(tag = tag) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEchoBodyTagResponseStringWithHttpInfo(tag: Tag? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEchoBodyTagResponseStringWithHttpInfo(tag: Tag? = null): Mono> { val localVariableConfig = testEchoBodyTagResponseStringRequestConfig(tag = tag) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt index c45ae1a23b6..7182da46e83 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt @@ -17,33 +17,37 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.infrastructure.* -class FormApi(client: RestClient) : ApiClient(client) { +class FormApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) - @Throws(RestClientResponseException::class) - fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): kotlin.String { - val result = testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) - return result.body!! + @Throws(WebClientResponseException::class) + fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): Mono { + return testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testFormIntegerBooleanStringWithHttpInfo(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testFormIntegerBooleanStringWithHttpInfo(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): Mono> { val localVariableConfig = testFormIntegerBooleanStringRequestConfig(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) return request>, kotlin.String>( localVariableConfig @@ -74,14 +78,14 @@ class FormApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testFormOneof(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): kotlin.String { - val result = testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) - return result.body!! + @Throws(WebClientResponseException::class) + fun testFormOneof(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): Mono { + return testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testFormOneofWithHttpInfo(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testFormOneofWithHttpInfo(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): Mono> { val localVariableConfig = testFormOneofRequestConfig(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) return request>, kotlin.String>( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt index ce7a48355e8..b21a449f903 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt @@ -17,22 +17,26 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.StringEnumRef import org.openapitools.client.infrastructure.* -class HeaderApi(client: RestClient) : ApiClient(client) { +class HeaderApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -46,14 +50,14 @@ class HeaderApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): kotlin.String { - val result = testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) - return result.body!! + @Throws(WebClientResponseException::class) + fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): Mono { + return testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): Mono> { val localVariableConfig = testHeaderIntegerBooleanStringEnumsRequestConfig(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt index f1af5bd244a..062e0a6c403 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -17,22 +17,26 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.StringEnumRef import org.openapitools.client.infrastructure.* -class PathApi(client: RestClient) : ApiClient(client) { +class PathApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -46,14 +50,14 @@ class PathApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): kotlin.String { - val result = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) - return result.body!! + @Throws(WebClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): Mono { + return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): Mono> { val localVariableConfig = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestConfig(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt index 3b2b78ffec9..dc2d0bb902d 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt @@ -17,24 +17,28 @@ package org.openapitools.client.apis import com.fasterxml.jackson.annotation.JsonProperty -import org.springframework.web.client.RestClient -import org.springframework.web.client.RestClientResponseException - -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder import org.springframework.http.ResponseEntity import org.springframework.http.MediaType - +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap import org.openapitools.client.models.Pet import org.openapitools.client.models.StringEnumRef import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter import org.openapitools.client.infrastructure.* -class QueryApi(client: RestClient) : ApiClient(client) { +class QueryApi(client: WebClient) : ApiClient(client) { - constructor(baseUrl: String) : this(RestClient.builder() + constructor(baseUrl: String) : this(WebClient.builder() .baseUrl(baseUrl) - .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } .build() ) @@ -48,14 +52,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): kotlin.String { - val result = testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): Mono { + return testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testEnumRefStringWithHttpInfo(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testEnumRefStringWithHttpInfo(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): Mono> { val localVariableConfig = testEnumRefStringRequestConfig(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) return request( localVariableConfig @@ -91,14 +95,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): kotlin.String { - val result = testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): Mono { + return testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryDatetimeDateStringWithHttpInfo(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryDatetimeDateStringWithHttpInfo(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): Mono> { val localVariableConfig = testQueryDatetimeDateStringRequestConfig(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) return request( localVariableConfig @@ -137,14 +141,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): kotlin.String { - val result = testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): Mono { + return testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryIntegerBooleanStringWithHttpInfo(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryIntegerBooleanStringWithHttpInfo(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): Mono> { val localVariableConfig = testQueryIntegerBooleanStringRequestConfig(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) return request( localVariableConfig @@ -183,14 +187,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): kotlin.String { - val result = testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): Mono { + return testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): Mono> { val localVariableConfig = testQueryStyleDeepObjectExplodeTrueObjectRequestConfig(queryObject = queryObject) return request( localVariableConfig @@ -223,14 +227,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): kotlin.String { - val result = testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): Mono { + return testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): Mono> { val localVariableConfig = testQueryStyleFormExplodeTrueArrayStringRequestConfig(queryObject = queryObject) return request( localVariableConfig @@ -263,14 +267,14 @@ class QueryApi(client: RestClient) : ApiClient(client) { } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): kotlin.String { - val result = testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject) - return result.body!! + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): Mono { + return testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + .map { it.body } } - @Throws(RestClientResponseException::class) - fun testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + @Throws(WebClientResponseException::class) + fun testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): Mono> { val localVariableConfig = testQueryStyleFormExplodeTrueObjectRequestConfig(queryObject = queryObject) return request( localVariableConfig diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 64f843ed93b..b8acccd3de1 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -4,13 +4,14 @@ import org.springframework.core.ParameterizedTypeReference import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod import org.springframework.http.MediaType -import org.springframework.web.client.RestClient +import org.springframework.web.reactive.function.client.WebClient import org.springframework.http.ResponseEntity import org.springframework.util.LinkedMultiValueMap +import reactor.core.publisher.Mono -open class ApiClient(protected val client: RestClient) { +open class ApiClient(protected val client: WebClient) { - protected inline fun request(requestConfig: RequestConfig): ResponseEntity { + protected inline fun request(requestConfig: RequestConfig): Mono> { return prepare(defaults(requestConfig)) .retrieve() .toEntity(object : ParameterizedTypeReference() {}) @@ -20,7 +21,7 @@ open class ApiClient(protected val client: RestClient) { client.method(requestConfig) .uri(requestConfig) .headers(requestConfig) - .nullableBody(requestConfig) + .body(requestConfig) protected fun defaults(requestConfig: RequestConfig) = requestConfig.apply { @@ -32,10 +33,10 @@ open class ApiClient(protected val client: RestClient) { } } - private fun RestClient.method(requestConfig: RequestConfig)= + private fun WebClient.method(requestConfig: RequestConfig)= method(HttpMethod.valueOf(requestConfig.method.name)) - private fun RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig) = + private fun WebClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig) = uri { builder -> builder .path(requestConfig.path) @@ -43,11 +44,11 @@ open class ApiClient(protected val client: RestClient) { .build(requestConfig.params) } - private fun RestClient.RequestBodySpec.headers(requestConfig: RequestConfig) = + private fun WebClient.RequestBodySpec.headers(requestConfig: RequestConfig) = apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } } - private fun RestClient.RequestBodySpec.nullableBody(requestConfig: RequestConfig) = - apply { if (requestConfig.body != null) body(requestConfig.body) } + private fun WebClient.RequestBodySpec.body(requestConfig: RequestConfig) = + apply { if (requestConfig.body != null) bodyValue(requestConfig.body) } } inline fun parseDateToQueryString(value : T): String { diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/build.gradle b/samples/client/echo_api/kotlin-model-prefix-type-mappings/build.gradle index 9c88de984d9..327c406db3c 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/build.gradle +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar and b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew.bat b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew.bat +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/settings.gradle b/samples/client/echo_api/kotlin-model-prefix-type-mappings/settings.gradle index 4b38a2a52a3..e9557672dc8 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/settings.gradle +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-client-prefix-mapping' diff --git a/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php b/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php index b6890329cfb..2eb9c76f6ca 100644 --- a/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php +++ b/samples/client/echo_api/php-nextgen/src/ObjectSerializer.php @@ -539,22 +539,61 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - array|object $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Bird.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Bird.md index 84abb75d24a..e61d8458c97 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Bird.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Bird.md @@ -23,7 +23,7 @@ print(Bird.to_json()) # convert the object into a dict bird_dict = bird_instance.to_dict() # create an instance of Bird from a dict -bird_form_dict = bird.from_dict(bird_dict) +bird_from_dict = Bird.from_dict(bird_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Category.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Category.md index 73b70c88dc5..9a807466f62 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Category.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Category.md @@ -23,7 +23,7 @@ print(Category.to_json()) # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DataQuery.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DataQuery.md index 89fcc0409e5..7ea37bfd23e 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DataQuery.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DataQuery.md @@ -24,7 +24,7 @@ print(DataQuery.to_json()) # convert the object into a dict data_query_dict = data_query_instance.to_dict() # create an instance of DataQuery from a dict -data_query_form_dict = data_query.from_dict(data_query_dict) +data_query_from_dict = DataQuery.from_dict(data_query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DefaultValue.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DefaultValue.md index 818d4ffc745..7c1668c0d6c 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DefaultValue.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/DefaultValue.md @@ -30,7 +30,7 @@ print(DefaultValue.to_json()) # convert the object into a dict default_value_dict = default_value_instance.to_dict() # create an instance of DefaultValue from a dict -default_value_form_dict = default_value.from_dict(default_value_dict) +default_value_from_dict = DefaultValue.from_dict(default_value_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/NumberPropertiesOnly.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/NumberPropertiesOnly.md index 43ed07a191c..1f9cb5a1f63 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/NumberPropertiesOnly.md @@ -24,7 +24,7 @@ print(NumberPropertiesOnly.to_json()) # convert the object into a dict number_properties_only_dict = number_properties_only_instance.to_dict() # create an instance of NumberPropertiesOnly from a dict -number_properties_only_form_dict = number_properties_only.from_dict(number_properties_only_dict) +number_properties_only_from_dict = NumberPropertiesOnly.from_dict(number_properties_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Pet.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Pet.md index be953cc4b96..99b4bf3ab01 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Pet.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Pet.md @@ -27,7 +27,7 @@ print(Pet.to_json()) # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Query.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Query.md index 85298b7c39a..d39693eb5b9 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Query.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Query.md @@ -23,7 +23,7 @@ print(Query.to_json()) # convert the object into a dict query_dict = query_instance.to_dict() # create an instance of Query from a dict -query_form_dict = query.from_dict(query_dict) +query_from_dict = Query.from_dict(query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Tag.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Tag.md index 4026198dc91..21314992cf4 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Tag.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/Tag.md @@ -23,7 +23,7 @@ print(Tag.to_json()) # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestFormObjectMultipartRequestMarker.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestFormObjectMultipartRequestMarker.md index 254c3b6a045..bf4046eb464 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestFormObjectMultipartRequestMarker.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestFormObjectMultipartRequestMarker.md @@ -22,7 +22,7 @@ print(TestFormObjectMultipartRequestMarker.to_json()) # convert the object into a dict test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict() # create an instance of TestFormObjectMultipartRequestMarker from a dict -test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict) +test_form_object_multipart_request_marker_from_dict = TestFormObjectMultipartRequestMarker.from_dict(test_form_object_multipart_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md index 0814a8129e6..96c36ca12e0 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md @@ -25,7 +25,7 @@ print(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.to_json # convert the object into a dict test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter from a dict -test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_form_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) +test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_from_dict = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index e80d8cfbe1b..846a0941a09 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -22,7 +22,7 @@ print(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.to_json()) # convert the object into a dict test_query_style_form_explode_true_array_string_query_object_parameter_dict = test_query_style_form_explode_true_array_string_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from a dict -test_query_style_form_explode_true_array_string_query_object_parameter_form_dict = test_query_style_form_explode_true_array_string_query_object_parameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) +test_query_style_form_explode_true_array_string_query_object_parameter_from_dict = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/Bird.md b/samples/client/echo_api/python-pydantic-v1/docs/Bird.md index f1ad71c2150..ae753e9c671 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/Bird.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/Bird.md @@ -22,7 +22,7 @@ print Bird.to_json() # convert the object into a dict bird_dict = bird_instance.to_dict() # create an instance of Bird from a dict -bird_form_dict = bird.from_dict(bird_dict) +bird_from_dict = Bird.from_dict(bird_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/Category.md b/samples/client/echo_api/python-pydantic-v1/docs/Category.md index bf23e3b044d..860b6b6bcb1 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/Category.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/Category.md @@ -22,7 +22,7 @@ print Category.to_json() # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/DataQuery.md b/samples/client/echo_api/python-pydantic-v1/docs/DataQuery.md index bac43a6cc70..58c08242aa0 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/DataQuery.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/DataQuery.md @@ -23,7 +23,7 @@ print DataQuery.to_json() # convert the object into a dict data_query_dict = data_query_instance.to_dict() # create an instance of DataQuery from a dict -data_query_form_dict = data_query.from_dict(data_query_dict) +data_query_from_dict = DataQuery.from_dict(data_query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/DefaultValue.md b/samples/client/echo_api/python-pydantic-v1/docs/DefaultValue.md index fcdbebf0e0a..b2a8cdfd621 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/DefaultValue.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/DefaultValue.md @@ -29,7 +29,7 @@ print DefaultValue.to_json() # convert the object into a dict default_value_dict = default_value_instance.to_dict() # create an instance of DefaultValue from a dict -default_value_form_dict = default_value.from_dict(default_value_dict) +default_value_from_dict = DefaultValue.from_dict(default_value_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/NumberPropertiesOnly.md b/samples/client/echo_api/python-pydantic-v1/docs/NumberPropertiesOnly.md index e35fad694e7..202d7f71735 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/NumberPropertiesOnly.md @@ -23,7 +23,7 @@ print NumberPropertiesOnly.to_json() # convert the object into a dict number_properties_only_dict = number_properties_only_instance.to_dict() # create an instance of NumberPropertiesOnly from a dict -number_properties_only_form_dict = number_properties_only.from_dict(number_properties_only_dict) +number_properties_only_from_dict = NumberPropertiesOnly.from_dict(number_properties_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/Pet.md b/samples/client/echo_api/python-pydantic-v1/docs/Pet.md index bd578ba9a50..82135416b79 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/Pet.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/Pet.md @@ -26,7 +26,7 @@ print Pet.to_json() # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/Query.md b/samples/client/echo_api/python-pydantic-v1/docs/Query.md index 8a346212089..ff05faf9586 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/Query.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/Query.md @@ -22,7 +22,7 @@ print Query.to_json() # convert the object into a dict query_dict = query_instance.to_dict() # create an instance of Query from a dict -query_form_dict = query.from_dict(query_dict) +query_from_dict = Query.from_dict(query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/Tag.md b/samples/client/echo_api/python-pydantic-v1/docs/Tag.md index febb268b144..6789bb7aa1d 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/Tag.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/Tag.md @@ -22,7 +22,7 @@ print Tag.to_json() # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/TestFormObjectMultipartRequestMarker.md b/samples/client/echo_api/python-pydantic-v1/docs/TestFormObjectMultipartRequestMarker.md index bccc9a9405f..b436e8945ba 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/TestFormObjectMultipartRequestMarker.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/TestFormObjectMultipartRequestMarker.md @@ -21,7 +21,7 @@ print TestFormObjectMultipartRequestMarker.to_json() # convert the object into a dict test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict() # create an instance of TestFormObjectMultipartRequestMarker from a dict -test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict) +test_form_object_multipart_request_marker_from_dict = TestFormObjectMultipartRequestMarker.from_dict(test_form_object_multipart_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md b/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md index 3b0a87b71c5..3ed6e704f6f 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md @@ -24,7 +24,7 @@ print TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.to_json # convert the object into a dict test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter from a dict -test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_form_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) +test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_from_dict = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index c741b723f00..b087d3a3774 100644 --- a/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/python-pydantic-v1/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -21,7 +21,7 @@ print TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.to_json() # convert the object into a dict test_query_style_form_explode_true_array_string_query_object_parameter_dict = test_query_style_form_explode_true_array_string_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from a dict -test_query_style_form_explode_true_array_string_query_object_parameter_form_dict = test_query_style_form_explode_true_array_string_query_object_parameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) +test_query_style_form_explode_true_array_string_query_object_parameter_from_dict = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/Bird.md b/samples/client/echo_api/python/docs/Bird.md index 84abb75d24a..e61d8458c97 100644 --- a/samples/client/echo_api/python/docs/Bird.md +++ b/samples/client/echo_api/python/docs/Bird.md @@ -23,7 +23,7 @@ print(Bird.to_json()) # convert the object into a dict bird_dict = bird_instance.to_dict() # create an instance of Bird from a dict -bird_form_dict = bird.from_dict(bird_dict) +bird_from_dict = Bird.from_dict(bird_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/Category.md b/samples/client/echo_api/python/docs/Category.md index 73b70c88dc5..9a807466f62 100644 --- a/samples/client/echo_api/python/docs/Category.md +++ b/samples/client/echo_api/python/docs/Category.md @@ -23,7 +23,7 @@ print(Category.to_json()) # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/DataQuery.md b/samples/client/echo_api/python/docs/DataQuery.md index 89fcc0409e5..7ea37bfd23e 100644 --- a/samples/client/echo_api/python/docs/DataQuery.md +++ b/samples/client/echo_api/python/docs/DataQuery.md @@ -24,7 +24,7 @@ print(DataQuery.to_json()) # convert the object into a dict data_query_dict = data_query_instance.to_dict() # create an instance of DataQuery from a dict -data_query_form_dict = data_query.from_dict(data_query_dict) +data_query_from_dict = DataQuery.from_dict(data_query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/DefaultValue.md b/samples/client/echo_api/python/docs/DefaultValue.md index 818d4ffc745..7c1668c0d6c 100644 --- a/samples/client/echo_api/python/docs/DefaultValue.md +++ b/samples/client/echo_api/python/docs/DefaultValue.md @@ -30,7 +30,7 @@ print(DefaultValue.to_json()) # convert the object into a dict default_value_dict = default_value_instance.to_dict() # create an instance of DefaultValue from a dict -default_value_form_dict = default_value.from_dict(default_value_dict) +default_value_from_dict = DefaultValue.from_dict(default_value_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/NumberPropertiesOnly.md b/samples/client/echo_api/python/docs/NumberPropertiesOnly.md index 43ed07a191c..1f9cb5a1f63 100644 --- a/samples/client/echo_api/python/docs/NumberPropertiesOnly.md +++ b/samples/client/echo_api/python/docs/NumberPropertiesOnly.md @@ -24,7 +24,7 @@ print(NumberPropertiesOnly.to_json()) # convert the object into a dict number_properties_only_dict = number_properties_only_instance.to_dict() # create an instance of NumberPropertiesOnly from a dict -number_properties_only_form_dict = number_properties_only.from_dict(number_properties_only_dict) +number_properties_only_from_dict = NumberPropertiesOnly.from_dict(number_properties_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/Pet.md b/samples/client/echo_api/python/docs/Pet.md index be953cc4b96..99b4bf3ab01 100644 --- a/samples/client/echo_api/python/docs/Pet.md +++ b/samples/client/echo_api/python/docs/Pet.md @@ -27,7 +27,7 @@ print(Pet.to_json()) # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/Query.md b/samples/client/echo_api/python/docs/Query.md index 85298b7c39a..d39693eb5b9 100644 --- a/samples/client/echo_api/python/docs/Query.md +++ b/samples/client/echo_api/python/docs/Query.md @@ -23,7 +23,7 @@ print(Query.to_json()) # convert the object into a dict query_dict = query_instance.to_dict() # create an instance of Query from a dict -query_form_dict = query.from_dict(query_dict) +query_from_dict = Query.from_dict(query_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/Tag.md b/samples/client/echo_api/python/docs/Tag.md index 4026198dc91..21314992cf4 100644 --- a/samples/client/echo_api/python/docs/Tag.md +++ b/samples/client/echo_api/python/docs/Tag.md @@ -23,7 +23,7 @@ print(Tag.to_json()) # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/TestFormObjectMultipartRequestMarker.md b/samples/client/echo_api/python/docs/TestFormObjectMultipartRequestMarker.md index 254c3b6a045..bf4046eb464 100644 --- a/samples/client/echo_api/python/docs/TestFormObjectMultipartRequestMarker.md +++ b/samples/client/echo_api/python/docs/TestFormObjectMultipartRequestMarker.md @@ -22,7 +22,7 @@ print(TestFormObjectMultipartRequestMarker.to_json()) # convert the object into a dict test_form_object_multipart_request_marker_dict = test_form_object_multipart_request_marker_instance.to_dict() # create an instance of TestFormObjectMultipartRequestMarker from a dict -test_form_object_multipart_request_marker_form_dict = test_form_object_multipart_request_marker.from_dict(test_form_object_multipart_request_marker_dict) +test_form_object_multipart_request_marker_from_dict = TestFormObjectMultipartRequestMarker.from_dict(test_form_object_multipart_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md b/samples/client/echo_api/python/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md index 0814a8129e6..96c36ca12e0 100644 --- a/samples/client/echo_api/python/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md +++ b/samples/client/echo_api/python/docs/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md @@ -25,7 +25,7 @@ print(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.to_json # convert the object into a dict test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter from a dict -test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_form_dict = test_query_style_deep_object_explode_true_object_all_of_query_object_parameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) +test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_from_dict = TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.from_dict(test_query_style_deep_object_explode_true_object_all_of_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/python/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/python/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md index e80d8cfbe1b..846a0941a09 100644 --- a/samples/client/echo_api/python/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +++ b/samples/client/echo_api/python/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -22,7 +22,7 @@ print(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.to_json()) # convert the object into a dict test_query_style_form_explode_true_array_string_query_object_parameter_dict = test_query_style_form_explode_true_array_string_query_object_parameter_instance.to_dict() # create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from a dict -test_query_style_form_explode_true_array_string_query_object_parameter_form_dict = test_query_style_form_explode_true_array_string_query_object_parameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) +test_query_style_form_explode_true_array_string_query_object_parameter_from_dict = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.from_dict(test_query_style_form_explode_true_array_string_query_object_parameter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/echo_api/r/R/data_query.R b/samples/client/echo_api/r/R/data_query.R index 0a749f98d6e..228cd65b846 100644 --- a/samples/client/echo_api/r/R/data_query.R +++ b/samples/client/echo_api/r/R/data_query.R @@ -30,13 +30,13 @@ DataQuery <- R6::R6Class( #' Initialize a new DataQuery class. #' #' @param id Query - #' @param outcomes outcomes. Default to [SUCCESS, FAILURE]. + #' @param outcomes outcomes. Default to ["SUCCESS","FAILURE"]. #' @param suffix test suffix #' @param text Some text containing white spaces #' @param date A date #' @param ... Other optional arguments. #' @export - initialize = function(`id` = NULL, `outcomes` = [SUCCESS, FAILURE], `suffix` = NULL, `text` = NULL, `date` = NULL, ...) { + initialize = function(`id` = NULL, `outcomes` = ["SUCCESS","FAILURE"], `suffix` = NULL, `text` = NULL, `date` = NULL, ...) { if (!is.null(`id`)) { if (!(is.numeric(`id`) && length(`id`) == 1)) { stop(paste("Error! Invalid data for `id`. Must be an integer:", `id`)) diff --git a/samples/client/echo_api/r/docs/DataQuery.md b/samples/client/echo_api/r/docs/DataQuery.md index 097f1885fe5..50015244dc5 100644 --- a/samples/client/echo_api/r/docs/DataQuery.md +++ b/samples/client/echo_api/r/docs/DataQuery.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **integer** | Query | [optional] -**outcomes** | **array[character]** | | [optional] [default to [SUCCESS, FAILURE]] [Enum: ] +**outcomes** | **array[character]** | | [optional] [default to ["SUCCESS","FAILURE"]] [Enum: ] **suffix** | **character** | test suffix | [optional] **text** | **character** | Some text containing white spaces | [optional] **date** | **character** | A date | [optional] diff --git a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api_client.rb b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api_client.rb index 3746375a418..e7b26c1d79a 100644 --- a/samples/client/echo_api/ruby-faraday/lib/openapi_client/api_client.rb +++ b/samples/client/echo_api/ruby-faraday/lib/openapi_client/api_client.rb @@ -249,7 +249,7 @@ module OpenapiClient # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -328,7 +328,7 @@ module OpenapiClient # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api_client.rb b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api_client.rb index d30e8ddbc71..ffc4e983ccb 100644 --- a/samples/client/echo_api/ruby-httpx/lib/openapi_client/api_client.rb +++ b/samples/client/echo_api/ruby-httpx/lib/openapi_client/api_client.rb @@ -188,7 +188,7 @@ module OpenapiClient # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -267,7 +267,7 @@ module OpenapiClient # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api_client.rb b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api_client.rb index e8af88a040b..0b0bc941f5d 100644 --- a/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api_client.rb +++ b/samples/client/echo_api/ruby-typhoeus/lib/openapi_client/api_client.rb @@ -212,7 +212,7 @@ module OpenapiClient # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -291,7 +291,7 @@ module OpenapiClient # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/echo_api/typescript-axios/build/api.ts b/samples/client/echo_api/typescript-axios/build/api.ts index 384ba1cdfc3..f22a7e72cca 100644 --- a/samples/client/echo_api/typescript-axios/build/api.ts +++ b/samples/client/echo_api/typescript-axios/build/api.ts @@ -615,7 +615,7 @@ export const BodyApiAxiosParamCreator = function (configuration?: Configuration) if (files) { files.forEach((element) => { - localVarFormParams.append('files', element as any); + localVarFormParams.append('files', element as any); }) } diff --git a/samples/client/echo_api/typescript-axios/build/common.ts b/samples/client/echo_api/typescript-axios/build/common.ts index c4b85d352ca..fc1881f27b3 100644 --- a/samples/client/echo_api/typescript-axios/build/common.ts +++ b/samples/client/echo_api/typescript-axios/build/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/echo_api/typescript-axios/build/package.json b/samples/client/echo_api/typescript-axios/build/package.json index fc256cc498a..e5d6921f72a 100644 --- a/samples/client/echo_api/typescript-axios/build/package.json +++ b/samples/client/echo_api/typescript-axios/build/package.json @@ -25,7 +25,7 @@ "axios": "^1.6.1" }, "devDependencies": { - "@types/node": "^12.11.5", - "typescript": "^4.0" + "@types/node": "12.11.5 - 12.20.42", + "typescript": "^4.0 || ^5.0" } } diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 5aa9418b32b..3e394392958 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/.gitignore b/samples/client/others/go/allof_multiple_ref_and_discriminator/.gitignore new file mode 100644 index 00000000000..daf913b1b34 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/samples/client/petstore/kotlin-spring-cloud/.openapi-generator-ignore b/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/.openapi-generator-ignore rename to samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator-ignore diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/FILES b/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/FILES new file mode 100644 index 00000000000..a4d184b4dd8 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +client.go +configuration.go +docs/AdditionalData.md +docs/BaseItem.md +docs/FinalItem.md +git_push.sh +go.mod +go.sum +model_additional_data.go +model_base_item.go +model_final_item.go +response.go +utils.go diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/VERSION b/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/.travis.yml b/samples/client/others/go/allof_multiple_ref_and_discriminator/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/README.md b/samples/client/others/go/allof_multiple_ref_and_discriminator/README.md new file mode 100644 index 00000000000..2055ef330e1 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/README.md @@ -0,0 +1,113 @@ +# Go API client for openapi + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```sh +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```go +import openapi "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- + + +## Documentation For Models + + - [AdditionalData](docs/AdditionalData.md) + - [BaseItem](docs/BaseItem.md) + - [FinalItem](docs/FinalItem.md) + + +## Documentation For Authorization + +Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/api/openapi.yaml b/samples/client/others/go/allof_multiple_ref_and_discriminator/api/openapi.yaml new file mode 100644 index 00000000000..e4571723e4e --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/api/openapi.yaml @@ -0,0 +1,56 @@ +openapi: 3.0.0 +info: + title: Test + version: 1.0.0 +servers: +- url: / +paths: {} +components: + schemas: + FinalItem: + allOf: + - $ref: '#/components/schemas/base.item' + - $ref: '#/components/schemas/AdditionalData' + type: object + base.item: + discriminator: + mapping: + FINAL: '#/components/schemas/FinalItem' + propertyName: type + properties: + title: + type: string + type: + enum: + - FINAL + example: FINAL + type: string + required: + - title + - type + type: object + AdditionalData: + properties: + prop1: + type: string + quantity: + example: 1 + format: int32 + minimum: 1 + type: integer + unitPrice: + example: 9.99 + format: double + minimum: 0.0 + type: number + totalPrice: + example: 9.99 + format: double + minimum: 0.0 + type: number + required: + - prop1 + - quantity + - totalPrice + - unitPrice + type: object diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/client.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/client.go new file mode 100644 index 00000000000..7a054ad52eb --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/client.go @@ -0,0 +1,657 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Test API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/configuration.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/configuration.go new file mode 100644 index 00000000000..c3b676ba005 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/configuration.go @@ -0,0 +1,215 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/AdditionalData.md b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/AdditionalData.md new file mode 100644 index 00000000000..5f4bb21a8e5 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/AdditionalData.md @@ -0,0 +1,114 @@ +# AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | +**Quantity** | **int32** | | +**UnitPrice** | **float64** | | +**TotalPrice** | **float64** | | + +## Methods + +### NewAdditionalData + +`func NewAdditionalData(prop1 string, quantity int32, unitPrice float64, totalPrice float64, ) *AdditionalData` + +NewAdditionalData instantiates a new AdditionalData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalDataWithDefaults + +`func NewAdditionalDataWithDefaults() *AdditionalData` + +NewAdditionalDataWithDefaults instantiates a new AdditionalData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProp1 + +`func (o *AdditionalData) GetProp1() string` + +GetProp1 returns the Prop1 field if non-nil, zero value otherwise. + +### GetProp1Ok + +`func (o *AdditionalData) GetProp1Ok() (*string, bool)` + +GetProp1Ok returns a tuple with the Prop1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProp1 + +`func (o *AdditionalData) SetProp1(v string)` + +SetProp1 sets Prop1 field to given value. + + +### GetQuantity + +`func (o *AdditionalData) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *AdditionalData) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *AdditionalData) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + + +### GetUnitPrice + +`func (o *AdditionalData) GetUnitPrice() float64` + +GetUnitPrice returns the UnitPrice field if non-nil, zero value otherwise. + +### GetUnitPriceOk + +`func (o *AdditionalData) GetUnitPriceOk() (*float64, bool)` + +GetUnitPriceOk returns a tuple with the UnitPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitPrice + +`func (o *AdditionalData) SetUnitPrice(v float64)` + +SetUnitPrice sets UnitPrice field to given value. + + +### GetTotalPrice + +`func (o *AdditionalData) GetTotalPrice() float64` + +GetTotalPrice returns the TotalPrice field if non-nil, zero value otherwise. + +### GetTotalPriceOk + +`func (o *AdditionalData) GetTotalPriceOk() (*float64, bool)` + +GetTotalPriceOk returns a tuple with the TotalPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalPrice + +`func (o *AdditionalData) SetTotalPrice(v float64)` + +SetTotalPrice sets TotalPrice field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/BaseItem.md b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/BaseItem.md new file mode 100644 index 00000000000..cccf1390664 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/BaseItem.md @@ -0,0 +1,72 @@ +# BaseItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | | +**Type** | **string** | | + +## Methods + +### NewBaseItem + +`func NewBaseItem(title string, type_ string, ) *BaseItem` + +NewBaseItem instantiates a new BaseItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBaseItemWithDefaults + +`func NewBaseItemWithDefaults() *BaseItem` + +NewBaseItemWithDefaults instantiates a new BaseItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTitle + +`func (o *BaseItem) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *BaseItem) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *BaseItem) SetTitle(v string)` + +SetTitle sets Title field to given value. + + +### GetType + +`func (o *BaseItem) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *BaseItem) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *BaseItem) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/FinalItem.md b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/FinalItem.md new file mode 100644 index 00000000000..9054848df9e --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/docs/FinalItem.md @@ -0,0 +1,114 @@ +# FinalItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prop1** | **string** | | +**Quantity** | **int32** | | +**UnitPrice** | **float64** | | +**TotalPrice** | **float64** | | + +## Methods + +### NewFinalItem + +`func NewFinalItem(prop1 string, quantity int32, unitPrice float64, totalPrice float64, ) *FinalItem` + +NewFinalItem instantiates a new FinalItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFinalItemWithDefaults + +`func NewFinalItemWithDefaults() *FinalItem` + +NewFinalItemWithDefaults instantiates a new FinalItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProp1 + +`func (o *FinalItem) GetProp1() string` + +GetProp1 returns the Prop1 field if non-nil, zero value otherwise. + +### GetProp1Ok + +`func (o *FinalItem) GetProp1Ok() (*string, bool)` + +GetProp1Ok returns a tuple with the Prop1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProp1 + +`func (o *FinalItem) SetProp1(v string)` + +SetProp1 sets Prop1 field to given value. + + +### GetQuantity + +`func (o *FinalItem) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *FinalItem) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *FinalItem) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + + +### GetUnitPrice + +`func (o *FinalItem) GetUnitPrice() float64` + +GetUnitPrice returns the UnitPrice field if non-nil, zero value otherwise. + +### GetUnitPriceOk + +`func (o *FinalItem) GetUnitPriceOk() (*float64, bool)` + +GetUnitPriceOk returns a tuple with the UnitPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitPrice + +`func (o *FinalItem) SetUnitPrice(v float64)` + +SetUnitPrice sets UnitPrice field to given value. + + +### GetTotalPrice + +`func (o *FinalItem) GetTotalPrice() float64` + +GetTotalPrice returns the TotalPrice field if non-nil, zero value otherwise. + +### GetTotalPriceOk + +`func (o *FinalItem) GetTotalPriceOk() (*float64, bool)` + +GetTotalPriceOk returns a tuple with the TotalPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalPrice + +`func (o *FinalItem) SetTotalPrice(v float64)` + +SetTotalPrice sets TotalPrice field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh b/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/go.mod b/samples/client/others/go/allof_multiple_ref_and_discriminator/go.mod new file mode 100644 index 00000000000..7fca7eee925 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/go.mod @@ -0,0 +1,6 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.18 + +require ( +) diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/go.sum b/samples/client/others/go/allof_multiple_ref_and_discriminator/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/model_additional_data.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_additional_data.go new file mode 100644 index 00000000000..a7186d87f51 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_additional_data.go @@ -0,0 +1,242 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the AdditionalData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AdditionalData{} + +// AdditionalData struct for AdditionalData +type AdditionalData struct { + Prop1 string `json:"prop1"` + Quantity int32 `json:"quantity"` + UnitPrice float64 `json:"unitPrice"` + TotalPrice float64 `json:"totalPrice"` +} + +type _AdditionalData AdditionalData + +// NewAdditionalData instantiates a new AdditionalData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalData(prop1 string, quantity int32, unitPrice float64, totalPrice float64) *AdditionalData { + this := AdditionalData{} + this.Prop1 = prop1 + this.Quantity = quantity + this.UnitPrice = unitPrice + this.TotalPrice = totalPrice + return &this +} + +// NewAdditionalDataWithDefaults instantiates a new AdditionalData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalDataWithDefaults() *AdditionalData { + this := AdditionalData{} + return &this +} + +// GetProp1 returns the Prop1 field value +func (o *AdditionalData) GetProp1() string { + if o == nil { + var ret string + return ret + } + + return o.Prop1 +} + +// GetProp1Ok returns a tuple with the Prop1 field value +// and a boolean to check if the value has been set. +func (o *AdditionalData) GetProp1Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prop1, true +} + +// SetProp1 sets field value +func (o *AdditionalData) SetProp1(v string) { + o.Prop1 = v +} + +// GetQuantity returns the Quantity field value +func (o *AdditionalData) GetQuantity() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *AdditionalData) GetQuantityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *AdditionalData) SetQuantity(v int32) { + o.Quantity = v +} + +// GetUnitPrice returns the UnitPrice field value +func (o *AdditionalData) GetUnitPrice() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.UnitPrice +} + +// GetUnitPriceOk returns a tuple with the UnitPrice field value +// and a boolean to check if the value has been set. +func (o *AdditionalData) GetUnitPriceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.UnitPrice, true +} + +// SetUnitPrice sets field value +func (o *AdditionalData) SetUnitPrice(v float64) { + o.UnitPrice = v +} + +// GetTotalPrice returns the TotalPrice field value +func (o *AdditionalData) GetTotalPrice() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.TotalPrice +} + +// GetTotalPriceOk returns a tuple with the TotalPrice field value +// and a boolean to check if the value has been set. +func (o *AdditionalData) GetTotalPriceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.TotalPrice, true +} + +// SetTotalPrice sets field value +func (o *AdditionalData) SetTotalPrice(v float64) { + o.TotalPrice = v +} + +func (o AdditionalData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AdditionalData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prop1"] = o.Prop1 + toSerialize["quantity"] = o.Quantity + toSerialize["unitPrice"] = o.UnitPrice + toSerialize["totalPrice"] = o.TotalPrice + return toSerialize, nil +} + +func (o *AdditionalData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prop1", + "quantity", + "unitPrice", + "totalPrice", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAdditionalData := _AdditionalData{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAdditionalData) + + if err != nil { + return err + } + + *o = AdditionalData(varAdditionalData) + + return err +} + +type NullableAdditionalData struct { + value *AdditionalData + isSet bool +} + +func (v NullableAdditionalData) Get() *AdditionalData { + return v.value +} + +func (v *NullableAdditionalData) Set(val *AdditionalData) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalData) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalData(val *AdditionalData) *NullableAdditionalData { + return &NullableAdditionalData{value: val, isSet: true} +} + +func (v NullableAdditionalData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/model_base_item.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_base_item.go new file mode 100644 index 00000000000..96d4179808c --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_base_item.go @@ -0,0 +1,186 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the BaseItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseItem{} + +// BaseItem struct for BaseItem +type BaseItem struct { + Title string `json:"title"` + Type string `json:"type"` +} + +type _BaseItem BaseItem + +// NewBaseItem instantiates a new BaseItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBaseItem(title string, type_ string) *BaseItem { + this := BaseItem{} + this.Title = title + this.Type = type_ + return &this +} + +// NewBaseItemWithDefaults instantiates a new BaseItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBaseItemWithDefaults() *BaseItem { + this := BaseItem{} + return &this +} + +// GetTitle returns the Title field value +func (o *BaseItem) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *BaseItem) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *BaseItem) SetTitle(v string) { + o.Title = v +} + +// GetType returns the Type field value +func (o *BaseItem) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BaseItem) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BaseItem) SetType(v string) { + o.Type = v +} + +func (o BaseItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BaseItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["title"] = o.Title + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BaseItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "title", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBaseItem := _BaseItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBaseItem) + + if err != nil { + return err + } + + *o = BaseItem(varBaseItem) + + return err +} + +type NullableBaseItem struct { + value *BaseItem + isSet bool +} + +func (v NullableBaseItem) Get() *BaseItem { + return v.value +} + +func (v *NullableBaseItem) Set(val *BaseItem) { + v.value = val + v.isSet = true +} + +func (v NullableBaseItem) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseItem(val *BaseItem) *NullableBaseItem { + return &NullableBaseItem{value: val, isSet: true} +} + +func (v NullableBaseItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/model_final_item.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_final_item.go new file mode 100644 index 00000000000..d3845f84998 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/model_final_item.go @@ -0,0 +1,247 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the FinalItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FinalItem{} + +// FinalItem struct for FinalItem +type FinalItem struct { + BaseItem + Prop1 string `json:"prop1"` + Quantity int32 `json:"quantity"` + UnitPrice float64 `json:"unitPrice"` + TotalPrice float64 `json:"totalPrice"` +} + +type _FinalItem FinalItem + +// NewFinalItem instantiates a new FinalItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFinalItem(prop1 string, quantity int32, unitPrice float64, totalPrice float64, title string, type_ string) *FinalItem { + this := FinalItem{} + this.Title = title + this.Type = type_ + this.Prop1 = prop1 + this.Quantity = quantity + this.UnitPrice = unitPrice + this.TotalPrice = totalPrice + return &this +} + +// NewFinalItemWithDefaults instantiates a new FinalItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFinalItemWithDefaults() *FinalItem { + this := FinalItem{} + return &this +} + +// GetProp1 returns the Prop1 field value +func (o *FinalItem) GetProp1() string { + if o == nil { + var ret string + return ret + } + + return o.Prop1 +} + +// GetProp1Ok returns a tuple with the Prop1 field value +// and a boolean to check if the value has been set. +func (o *FinalItem) GetProp1Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prop1, true +} + +// SetProp1 sets field value +func (o *FinalItem) SetProp1(v string) { + o.Prop1 = v +} + +// GetQuantity returns the Quantity field value +func (o *FinalItem) GetQuantity() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *FinalItem) GetQuantityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *FinalItem) SetQuantity(v int32) { + o.Quantity = v +} + +// GetUnitPrice returns the UnitPrice field value +func (o *FinalItem) GetUnitPrice() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.UnitPrice +} + +// GetUnitPriceOk returns a tuple with the UnitPrice field value +// and a boolean to check if the value has been set. +func (o *FinalItem) GetUnitPriceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.UnitPrice, true +} + +// SetUnitPrice sets field value +func (o *FinalItem) SetUnitPrice(v float64) { + o.UnitPrice = v +} + +// GetTotalPrice returns the TotalPrice field value +func (o *FinalItem) GetTotalPrice() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.TotalPrice +} + +// GetTotalPriceOk returns a tuple with the TotalPrice field value +// and a boolean to check if the value has been set. +func (o *FinalItem) GetTotalPriceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.TotalPrice, true +} + +// SetTotalPrice sets field value +func (o *FinalItem) SetTotalPrice(v float64) { + o.TotalPrice = v +} + +func (o FinalItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FinalItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prop1"] = o.Prop1 + toSerialize["quantity"] = o.Quantity + toSerialize["unitPrice"] = o.UnitPrice + toSerialize["totalPrice"] = o.TotalPrice + return toSerialize, nil +} + +func (o *FinalItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prop1", + "quantity", + "unitPrice", + "totalPrice", + "title", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFinalItem := _FinalItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFinalItem) + + if err != nil { + return err + } + + *o = FinalItem(varFinalItem) + + return err +} + +type NullableFinalItem struct { + value *FinalItem + isSet bool +} + +func (v NullableFinalItem) Get() *FinalItem { + return v.value +} + +func (v *NullableFinalItem) Set(val *FinalItem) { + v.value = val + v.isSet = true +} + +func (v NullableFinalItem) IsSet() bool { + return v.isSet +} + +func (v *NullableFinalItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFinalItem(val *FinalItem) *NullableFinalItem { + return &NullableFinalItem{value: val, isSet: true} +} + +func (v NullableFinalItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFinalItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/pom.xml b/samples/client/others/go/allof_multiple_ref_and_discriminator/pom.xml new file mode 100644 index 00000000000..5a6af72f254 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + org.openapitools + GoAllOfRefWithDiscriminator + pom + 1.0.0 + Go Multiple AllOf Ref with Discriminator test + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-oauth2 + pre-integration-test + + exec + + + go + + get + golang.org/x/oauth2 + + + + + go-get-context + pre-integration-test + + exec + + + go + + get + golang.org/x/net/context + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/response.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/response.go new file mode 100644 index 00000000000..7498f33f6fc --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/response.go @@ -0,0 +1,47 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/client/others/go/allof_multiple_ref_and_discriminator/utils.go b/samples/client/others/go/allof_multiple_ref_and_discriminator/utils.go new file mode 100644 index 00000000000..5bcb2298242 --- /dev/null +++ b/samples/client/others/go/allof_multiple_ref_and_discriminator/utils.go @@ -0,0 +1,347 @@ +/* +Test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/samples/client/others/go/oneof-anyof-required/client.go b/samples/client/others/go/oneof-anyof-required/client.go index f745e46a426..7a054ad52eb 100644 --- a/samples/client/others/go/oneof-anyof-required/client.go +++ b/samples/client/others/go/oneof-anyof-required/client.go @@ -159,7 +159,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/.github/workflows/maven.yml b/samples/client/others/java/jersey2-oneOf-Mixed/.github/workflows/maven.yml index 1dd421c4835..16e07aa898b 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/.github/workflows/maven.yml +++ b/samples/client/others/java/jersey2-oneOf-Mixed/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/jersey2-oneOf-Mixed/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/gradlew b/samples/client/others/java/jersey2-oneOf-Mixed/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/gradlew +++ b/samples/client/others/java/jersey2-oneOf-Mixed/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/gradlew.bat b/samples/client/others/java/jersey2-oneOf-Mixed/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/gradlew.bat +++ b/samples/client/others/java/jersey2-oneOf-Mixed/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/.github/workflows/maven.yml b/samples/client/others/java/jersey2-oneOf-duplicates/.github/workflows/maven.yml index 1dd421c4835..16e07aa898b 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/.github/workflows/maven.yml +++ b/samples/client/others/java/jersey2-oneOf-duplicates/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/jersey2-oneOf-duplicates/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/gradlew b/samples/client/others/java/jersey2-oneOf-duplicates/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/gradlew +++ b/samples/client/others/java/jersey2-oneOf-duplicates/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/gradlew.bat b/samples/client/others/java/jersey2-oneOf-duplicates/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/gradlew.bat +++ b/samples/client/others/java/jersey2-oneOf-duplicates/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/okhttp-gson-oneOf/.github/workflows/maven.yml b/samples/client/others/java/okhttp-gson-oneOf/.github/workflows/maven.yml index 1b4a533253c..08a45f321d1 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/.github/workflows/maven.yml +++ b/samples/client/others/java/okhttp-gson-oneOf/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.gradle b/samples/client/others/java/okhttp-gson-oneOf/build.gradle index 385a98a2074..06b2fd80c4c 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf/build.gradle @@ -117,9 +117,9 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.sbt b/samples/client/others/java/okhttp-gson-oneOf/build.sbt index ee12a918d39..5aea48501a0 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf/build.sbt @@ -21,7 +21,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/okhttp-gson-oneOf/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/okhttp-gson-oneOf/gradlew b/samples/client/others/java/okhttp-gson-oneOf/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/gradlew +++ b/samples/client/others/java/okhttp-gson-oneOf/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/okhttp-gson-oneOf/gradlew.bat b/samples/client/others/java/okhttp-gson-oneOf/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/gradlew.bat +++ b/samples/client/others/java/okhttp-gson-oneOf/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/okhttp-gson-oneOf/pom.xml b/samples/client/others/java/okhttp-gson-oneOf/pom.xml index c69b956b30a..bb8290ae29a 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf/pom.xml @@ -334,7 +334,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/model/MyExamplePostRequest.java b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/model/MyExamplePostRequest.java index e0465eff968..6835bc504e6 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/model/MyExamplePostRequest.java +++ b/samples/client/others/java/okhttp-gson-oneOf/src/main/java/org/openapitools/client/model/MyExamplePostRequest.java @@ -124,7 +124,7 @@ public class MyExamplePostRequest extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public MyExamplePostRequest(String o) { + public MyExamplePostRequest(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml b/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml index 39df19de3cd..e43bb4aa033 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml +++ b/samples/client/others/java/okhttp-gson-streaming/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index 41d81af4dcc..de95fe59eb4 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -117,9 +117,9 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index 2a9184320b6..43dc93b5862 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -21,7 +21,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md b/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md index 70bf3335f7b..d27439c839f 100644 --- a/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md +++ b/samples/client/others/java/okhttp-gson-streaming/docs/SomeObj.md @@ -19,7 +19,7 @@ | Name | Value | |---- | -----| -| SOMEOBJIDENTIFIER | "SomeObjIdentifier" | +| SOME_OBJ_IDENTIFIER | "SomeObjIdentifier" | ## Implemented Interfaces diff --git a/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/okhttp-gson-streaming/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/okhttp-gson-streaming/gradlew b/samples/client/others/java/okhttp-gson-streaming/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/okhttp-gson-streaming/gradlew +++ b/samples/client/others/java/okhttp-gson-streaming/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/okhttp-gson-streaming/gradlew.bat b/samples/client/others/java/okhttp-gson-streaming/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/okhttp-gson-streaming/gradlew.bat +++ b/samples/client/others/java/okhttp-gson-streaming/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 9bb59403345..83e02f07a08 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -334,7 +334,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SimpleOneOf.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SimpleOneOf.java index 8199c2a7d86..7cf0ba6f7db 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SimpleOneOf.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SimpleOneOf.java @@ -146,12 +146,7 @@ public class SimpleOneOf extends AbstractOpenApiSchema implements Serializable { super("oneOf", Boolean.FALSE); } - public SimpleOneOf(Integer o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public SimpleOneOf(String o) { + public SimpleOneOf(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java index 5dc284c3f0c..1828f3bc5ec 100644 --- a/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java +++ b/samples/client/others/java/okhttp-gson-streaming/src/main/java/org/openapitools/client/model/SomeObj.java @@ -59,7 +59,7 @@ public class SomeObj implements Serializable { */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - SOMEOBJIDENTIFIER("SomeObjIdentifier"); + SOME_OBJ_IDENTIFIER("SomeObjIdentifier"); private String value; @@ -106,7 +106,7 @@ public class SomeObj implements Serializable { public static final String SERIALIZED_NAME_$_TYPE = "$_type"; @SerializedName(SERIALIZED_NAME_$_TYPE) - private TypeEnum $type = TypeEnum.SOMEOBJIDENTIFIER; + private TypeEnum $type = TypeEnum.SOME_OBJ_IDENTIFIER; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/.github/workflows/maven.yml b/samples/client/others/java/restclient-useAbstractionForFiles/.github/workflows/maven.yml new file mode 100644 index 00000000000..8b6f7a6aef0 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Response file abstraction test + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/.gitignore b/samples/client/others/java/restclient-useAbstractionForFiles/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore b/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore rename to samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator-ignore diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/FILES b/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/FILES new file mode 100644 index 00000000000..611375d94d7 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/ResourceApi.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/ResourceApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/VERSION b/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/.travis.yml b/samples/client/others/java/restclient-useAbstractionForFiles/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/README.md b/samples/client/others/java/restclient-useAbstractionForFiles/README.md new file mode 100644 index 00000000000..89942d1c287 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/README.md @@ -0,0 +1,137 @@ +# file-restclient + +Response file abstraction test + +- API version: 1.0.0 + +- Generator version: 8.0.0-SNAPSHOT + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + file-restclient + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'file-restclient' jar has been published to maven central. + mavenLocal() // Needed if the 'file-restclient' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:file-restclient:1.0.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/file-restclient-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.ResourceApi; + +public class ResourceApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ResourceApi apiInstance = new ResourceApi(defaultClient); + try { + File result = apiInstance.resourceInResponse(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ResourceApi#resourceInResponse"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ResourceApi* | [**resourceInResponse**](docs/ResourceApi.md#resourceInResponse) | **GET** /resource | + + +## Documentation for Models + + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/api/openapi.yaml b/samples/client/others/java/restclient-useAbstractionForFiles/api/openapi.yaml new file mode 100644 index 00000000000..cb0b7e18d3e --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/api/openapi.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.1 +info: + title: Response file abstraction test + version: 1.0.0 +servers: +- url: / +paths: + /resource: + get: + description: Response file abstraction + operationId: resourceInResponse + responses: + "200": + content: + application/octet-stream: + schema: + format: binary + type: string + description: Successful operation + tags: + - resource + x-accepts: + - application/octet-stream +components: + schemas: {} + diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle new file mode 100644 index 00000000000..7f1376a230b --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/build.gradle @@ -0,0 +1,136 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'file-restclient' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/build.sbt b/samples/client/others/java/restclient-useAbstractionForFiles/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/docs/ResourceApi.md b/samples/client/others/java/restclient-useAbstractionForFiles/docs/ResourceApi.md new file mode 100644 index 00000000000..6d6f54178cc --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/docs/ResourceApi.md @@ -0,0 +1,71 @@ +# ResourceApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**resourceInResponse**](ResourceApi.md#resourceInResponse) | **GET** /resource | | + + + +## resourceInResponse + +> File resourceInResponse() + + + +Response file abstraction + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ResourceApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ResourceApi apiInstance = new ResourceApi(defaultClient); + try { + File result = apiInstance.resourceInResponse(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ResourceApi#resourceInResponse"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | + diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh b/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/gradle.properties b/samples/client/others/java/restclient-useAbstractionForFiles/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/gradlew b/samples/client/others/java/restclient-useAbstractionForFiles/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/gradlew.bat b/samples/client/others/java/restclient-useAbstractionForFiles/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml b/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml new file mode 100644 index 00000000000..645a79f1e82 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/pom.xml @@ -0,0 +1,291 @@ + + 4.0.0 + org.openapitools + file-restclient + jar + file-restclient + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 6.1.6 + 2.15.2 + 2.15.2 + 0.2.6 + 2.1.1 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/settings.gradle b/samples/client/others/java/restclient-useAbstractionForFiles/settings.gradle new file mode 100644 index 00000000000..b35dd549d6c --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "file-restclient" \ No newline at end of file diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/AndroidManifest.xml b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..b8b55b2cefb --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,707 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import jakarta.annotation.Nullable; + +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "http://localhost"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..737b406a108 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Response file abstraction test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..b78b780cf67 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * Response file abstraction test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..4c47f2b1971 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..60a0eed94d5 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..5459f3e115b --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Response file abstraction test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/api/ResourceApi.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/api/ResourceApi.java new file mode 100644 index 00000000000..b209aa200da --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/api/ResourceApi.java @@ -0,0 +1,111 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.io.File; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ResourceApi { + private ApiClient apiClient; + + public ResourceApi() { + this(new ApiClient()); + } + + @Autowired + public ResourceApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * Response file abstraction + *

    200 - Successful operation + * @return File + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec resourceInResponseRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/octet-stream" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/resource", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Response file abstraction + *

    200 - Successful operation + * @return File + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public org.springframework.core.io.Resource resourceInResponse() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return resourceInResponseRequestCreation().body(localVarReturnType); + } + + /** + * + * Response file abstraction + *

    200 - Successful operation + * @return ResponseEntity<File> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity resourceInResponseWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return resourceInResponseRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * Response file abstraction + *

    200 - Successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec resourceInResponseWithResponseSpec() throws RestClientResponseException { + return resourceInResponseRequestCreation(); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f2597a71272 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f0afdd6841c --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..75b318e2922 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java new file mode 100644 index 00000000000..fee02b33f14 --- /dev/null +++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java @@ -0,0 +1,47 @@ +/* + * Response file abstraction test + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for ResourceApi + */ +@Ignore +public class ResourceApiTest { + + private final ResourceApi api = new ResourceApi(); + + + /** + * + * + * Response file abstraction + */ + @Test + public void resourceInResponseTest() { + org.springframework.core.io.Resource response = api.resourceInResponse(); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/others/java/resttemplate-list-schema-validation/.github/workflows/maven.yml b/samples/client/others/java/resttemplate-list-schema-validation/.github/workflows/maven.yml new file mode 100644 index 00000000000..ffb9556cba2 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build issue-17485 + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/others/java/resttemplate-list-schema-validation/.gitignore b/samples/client/others/java/resttemplate-list-schema-validation/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore b/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator-ignore similarity index 100% rename from samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore rename to samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator-ignore diff --git a/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/FILES b/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/FILES new file mode 100644 index 00000000000..04dcaaa7bc6 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/UserApi.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/BaseApi.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java diff --git a/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/VERSION b/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/others/java/resttemplate-list-schema-validation/.travis.yml b/samples/client/others/java/resttemplate-list-schema-validation/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/others/java/resttemplate-list-schema-validation/README.md b/samples/client/others/java/resttemplate-list-schema-validation/README.md new file mode 100644 index 00000000000..6419cfd819c --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/README.md @@ -0,0 +1,137 @@ +# java-resttemplate-list-schema-validation + +issue-17485 + +- API version: 0.1.0 + +- Generator version: 8.0.0-SNAPSHOT + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.8+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + java-resttemplate-list-schema-validation + 0.1.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'java-resttemplate-list-schema-validation' jar has been published to maven central. + mavenLocal() // Needed if the 'java-resttemplate-list-schema-validation' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:java-resttemplate-list-schema-validation:0.1.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/java-resttemplate-list-schema-validation-0.1.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.UserApi; + +public class UserApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://api.example.xyz/v1"); + + UserApi apiInstance = new UserApi(defaultClient); + List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> username = Arrays.asList(); // List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> | The name of the user + try { + apiInstance.userGet(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#userGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://api.example.xyz/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*UserApi* | [**userGet**](docs/UserApi.md#userGet) | **GET** /user | + + +## Documentation for Models + + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/others/java/resttemplate-list-schema-validation/api/openapi.yaml b/samples/client/others/java/resttemplate-list-schema-validation/api/openapi.yaml new file mode 100644 index 00000000000..f2ec5f2c7a1 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/api/openapi.yaml @@ -0,0 +1,31 @@ +openapi: 3.1.0 +info: + title: issue-17485 + version: 0.1.0 +servers: +- url: http://api.example.xyz/v1 +paths: + /user: + get: + parameters: + - description: The name of the user + explode: false + in: path + name: username + required: true + schema: + items: + pattern: "^[a-zA-Z0-9]$" + type: string + type: array + style: simple + responses: + "200": + description: OK + tags: + - user + x-accepts: + - application/json +components: + schemas: {} + diff --git a/samples/client/others/java/resttemplate-list-schema-validation/build.gradle b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle new file mode 100644 index 00000000000..be0c4deb2e2 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/build.gradle @@ -0,0 +1,136 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '0.1.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'java-resttemplate-list-schema-validation' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "5.3.33" + jakarta_annotation_version = "1.3.5" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/build.sbt b/samples/client/others/java/resttemplate-list-schema-validation/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/others/java/resttemplate-list-schema-validation/docs/UserApi.md b/samples/client/others/java/resttemplate-list-schema-validation/docs/UserApi.md new file mode 100644 index 00000000000..e1f7d0b7aa6 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/docs/UserApi.md @@ -0,0 +1,72 @@ +# UserApi + +All URIs are relative to *http://api.example.xyz/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**userGet**](UserApi.md#userGet) | **GET** /user | | + + + +## userGet + +> userGet(username) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://api.example.xyz/v1"); + + UserApi apiInstance = new UserApi(defaultClient); + List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> username = Arrays.asList(); // List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> | The name of the user + try { + apiInstance.userGet(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#userGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | [**List<@Pattern(regexp = "^[a-zA-Z0-9]$")String>**](String.md)| The name of the user | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | + diff --git a/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh b/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh new file mode 100644 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/others/java/resttemplate-list-schema-validation/gradle.properties b/samples/client/others/java/resttemplate-list-schema-validation/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/others/java/resttemplate-list-schema-validation/gradlew b/samples/client/others/java/resttemplate-list-schema-validation/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/resttemplate-list-schema-validation/gradlew.bat b/samples/client/others/java/resttemplate-list-schema-validation/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/others/java/resttemplate-list-schema-validation/pom.xml b/samples/client/others/java/resttemplate-list-schema-validation/pom.xml new file mode 100644 index 00000000000..7e87e58c74d --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/pom.xml @@ -0,0 +1,299 @@ + + 4.0.0 + org.openapitools + java-resttemplate-list-schema-validation + jar + java-resttemplate-list-schema-validation + 0.1.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 5.3.33 + 2.15.2 + 2.15.2 + 0.2.6 + 1.3.5 + 3.0.2 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/others/java/resttemplate-list-schema-validation/settings.gradle b/samples/client/others/java/resttemplate-list-schema-validation/settings.gradle new file mode 100644 index 00000000000..8e520b5beea --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "java-resttemplate-list-schema-validation" \ No newline at end of file diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/AndroidManifest.xml b/samples/client/others/java/resttemplate-list-schema-validation/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..c4cb885076f --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,801 @@ +package org.openapitools.client; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpRequest; +import org.springframework.http.HttpStatus; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; +import org.springframework.http.RequestEntity; +import org.springframework.http.RequestEntity.BodyBuilder; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.BufferingClientHttpRequestFactory; +import org.springframework.http.client.ClientHttpRequestExecution; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.http.client.ClientHttpResponse; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.util.DefaultUriBuilderFactory; +import org.openapitools.jackson.nullable.JsonNullableModule; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.text.DateFormat; +import java.text.ParseException; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; +import java.util.function.Supplier; +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + + private CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private boolean debugging = false; + + private HttpHeaders defaultHeaders = new HttpHeaders(); + private MultiValueMap defaultCookies = new LinkedMultiValueMap(); + + private int maxAttemptsForRetry = 1; + + private long waitTimeMillis = 10; + + private String basePath = "http://api.example.xyz/v1"; + + private RestTemplate restTemplate; + + private Map authentications; + + private DateFormat dateFormat; + + public ApiClient() { + this.restTemplate = buildRestTemplate(); + init(); + } + + public ApiClient(RestTemplate restTemplate) { + this.restTemplate = restTemplate; + init(); + } + + protected void init() { + // Use RFC3339 format for date and datetime. + // See http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14 + this.dateFormat = new RFC3339DateFormat(); + + // Use UTC as the default time zone. + this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + + // Set default User-Agent. + setUserAgent("Java-SDK"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Get the current base path + * + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the max attempts for retry + * + * @return int the max attempts + */ + public int getMaxAttemptsForRetry() { + return maxAttemptsForRetry; + } + + /** + * Set the max attempts for retry + * + * @param maxAttemptsForRetry the max attempts for retry + * @return ApiClient this client + */ + public ApiClient setMaxAttemptsForRetry(int maxAttemptsForRetry) { + this.maxAttemptsForRetry = maxAttemptsForRetry; + return this; + } + + /** + * Get the wait time in milliseconds + * + * @return long wait time in milliseconds + */ + public long getWaitTimeMillis() { + return waitTimeMillis; + } + + /** + * Set the wait time in milliseconds + * + * @param waitTimeMillis the wait time in milliseconds + * @return ApiClient this client + */ + public ApiClient setWaitTimeMillis(long waitTimeMillis) { + this.waitTimeMillis = waitTimeMillis; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + + + + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + public void setDebugging(boolean debugging) { + List currentInterceptors = this.restTemplate.getInterceptors(); + if (debugging) { + if (currentInterceptors == null) { + currentInterceptors = new ArrayList(); + } + ClientHttpRequestInterceptor interceptor = new ApiClientHttpRequestInterceptor(); + currentInterceptors.add(interceptor); + this.restTemplate.setInterceptors(currentInterceptors); + } else { + if (currentInterceptors != null && !currentInterceptors.isEmpty()) { + Iterator iter = currentInterceptors.iterator(); + while (iter.hasNext()) { + ClientHttpRequestInterceptor interceptor = iter.next(); + if (interceptor instanceof ApiClientHttpRequestInterceptor) { + iter.remove(); + } + } + this.restTemplate.setInterceptors(currentInterceptors); + } + } + this.debugging = debugging; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return boolean true if this client is enabled for debugging, false otherwise + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + return this; + } + + /** + * Parse the given string into Date object. + * + * @param str the string to parse + * @return the Date parsed from the string + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * + * @param date the date to format + * @return the formatted date as string + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if (collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()) { + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList(); + for (Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, JSON will be used. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return MediaType.APPLICATION_JSON; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Expand path template with variables + * + * @param pathTemplate path template with placeholders + * @param variables variables to replace + * @return path with placeholders replaced by variables + */ + public String expandPath(String pathTemplate, Map variables) { + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + public String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + try { + final String encodedName = URLEncoder.encode(name.toString(), "UTF-8"); + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(encodedName); + if (value != null) { + String templatizedKey = encodedName + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + } catch (UnsupportedEncodingException e) { + + } + }); + return queryBuilder.toString(); + + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return ResponseEntity<T> The response of the chosen type + */ + public ResponseEntity invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + String finalUri = path; + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + String expandedPath = this.expandPath(finalUri, uriParams); + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath); + + URI uri; + try { + uri = new URI(builder.build().toUriString()); + } catch (URISyntaxException ex) { + throw new RestClientException("Could not build URL: " + builder.toUriString(), ex); + } + + final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams); + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if (contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + RequestEntity requestEntity = requestBuilder.body(selectBody(body, formParams, contentType)); + + ResponseEntity responseEntity = null; + int attempts = 0; + while (attempts < maxAttemptsForRetry) { + try { + responseEntity = restTemplate.exchange(requestEntity, returnType); + break; + } catch (HttpServerErrorException | HttpClientErrorException ex) { + if (ex instanceof HttpServerErrorException + || ((HttpClientErrorException) ex) + .getStatusCode() + .equals(HttpStatus.TOO_MANY_REQUESTS)) { + attempts++; + if (attempts < maxAttemptsForRetry) { + try { + Thread.sleep(waitTimeMillis); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } else { + throw ex; + } + } else { + throw ex; + } + } + } + + if (responseEntity == null) { + throw new RestClientException("ResponseEntity is null"); + } + + if (responseEntity.getStatusCode().is2xxSuccessful()) { + return responseEntity; + } else { + // The error handler built into the RestTemplate should handle 400 and 500 series errors. + throw new RestClientException("API returned " + responseEntity.getStatusCode() + " and it wasn't handled by the RestTemplate error handler"); + } + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, BodyBuilder requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for (String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, BodyBuilder requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Build the RestTemplate used to make HTTP requests. + * @return RestTemplate + */ + protected RestTemplate buildRestTemplate() { + RestTemplate restTemplate = new RestTemplate(); + // This allows us to read the response more than once - Necessary for debugging. + restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); + + // disable default URL encoding + DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory(); + uriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY); + restTemplate.setUriTemplateHandler(uriBuilderFactory); + return restTemplate; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor { + private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class); + + @Override + public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { + logRequest(request, body); + ClientHttpResponse response = execution.execute(request, body); + logResponse(response); + return response; + } + + private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException { + log.info("URI: " + request.getURI()); + log.info("HTTP Method: " + request.getMethod()); + log.info("HTTP Headers: " + headersToString(request.getHeaders())); + log.info("Request Body: " + new String(body, StandardCharsets.UTF_8)); + } + + private void logResponse(ClientHttpResponse response) throws IOException { + log.info("HTTP Status Code: " + response.getStatusCode().value()); + log.info("Status Text: " + response.getStatusText()); + log.info("HTTP Headers: " + headersToString(response.getHeaders())); + log.info("Response Body: " + bodyToString(response.getBody())); + } + + private String headersToString(HttpHeaders headers) { + if(headers == null || headers.isEmpty()) { + return ""; + } + StringBuilder builder = new StringBuilder(); + for (Entry> entry : headers.entrySet()) { + builder.append(entry.getKey()).append("=["); + for (String value : entry.getValue()) { + builder.append(value).append(","); + } + builder.setLength(builder.length() - 1); // Get rid of trailing comma + builder.append("],"); + } + builder.setLength(builder.length() - 1); // Get rid of trailing comma + return builder.toString(); + } + + private String bodyToString(InputStream body) throws IOException { + StringBuilder builder = new StringBuilder(); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8)); + String line = bufferedReader.readLine(); + while (line != null) { + builder.append(line).append(System.lineSeparator()); + line = bufferedReader.readLine(); + } + bufferedReader.close(); + return builder.toString(); + } + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/BaseApi.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/BaseApi.java new file mode 100644 index 00000000000..baaf8a72daf --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/BaseApi.java @@ -0,0 +1,74 @@ +package org.openapitools.client; + +import org.springframework.web.client.RestClientException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public abstract class BaseApi { + + protected ApiClient apiClient; + + public BaseApi() { + this(new ApiClient()); + } + + public BaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method) throws RestClientException { + return invokeAPI(url, method, null, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request) throws RestClientException { + return invokeAPI(url, method, request, new ParameterizedTypeReference() {}); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity invokeAPI(String url, HttpMethod method, ParameterizedTypeReference returnType) throws RestClientException { + return invokeAPI(url, method, null, returnType); + } + + /** + * Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests. + * @param url The URL for the request, either full URL or only the path. + * @param method The HTTP method for the request. + * @param request The request object. + * @param returnType The return type. + * @return ResponseEntity in the specified type. + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public abstract ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException; +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..7ee224db053 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * issue-17485 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..dc48e8f515b --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * issue-17485 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..ca5c3724482 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..00d527328c7 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..ca852583725 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,109 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.BaseApi; + + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class UserApi extends BaseApi { + + public UserApi() { + super(new ApiClient()); + } + + public UserApi(ApiClient apiClient) { + super(apiClient); + } + + /** + * + * + *

    200 - OK + * @param username The name of the user (required) + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void userGet(List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> username) throws RestClientException { + userGetWithHttpInfo(username); + } + + /** + * + * + *

    200 - OK + * @param username The name of the user (required) + * @return ResponseEntity<Void> + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public ResponseEntity userGetWithHttpInfo(List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> username) throws RestClientException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling userGet"); + } + + // create path and map variables + final Map uriVariables = new HashMap(); + uriVariables.put("username", apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), username)); + + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI("/user", HttpMethod.GET, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType); + } + + @Override + public ResponseEntity invokeAPI(String url, HttpMethod method, Object request, ParameterizedTypeReference returnType) throws RestClientException { + String localVarPath = url.replace(apiClient.getBasePath(), ""); + Object localVarPostBody = request; + + final Map uriVariables = new HashMap(); + final MultiValueMap localVarQueryParams = new LinkedMultiValueMap(); + final HttpHeaders localVarHeaderParams = new HttpHeaders(); + final MultiValueMap localVarCookieParams = new LinkedMultiValueMap(); + final MultiValueMap localVarFormParams = new LinkedMultiValueMap(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI(localVarPath, method, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, returnType); + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..bc390ace629 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..6bc5fb44aec --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..56b04f99b11 --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/others/java/resttemplate-list-schema-validation/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/others/java/resttemplate-list-schema-validation/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..3087a229dfa --- /dev/null +++ b/samples/client/others/java/resttemplate-list-schema-validation/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,56 @@ +/* + * issue-17485 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.web.client.RestClientException; + +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +/** + * API tests for UserApi + */ +@Disabled +class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * + * + * + * + * @throws RestClientException + * if the Api call fails + */ + @Test + void userGetTest() { + List<@Pattern(regexp = "^[a-zA-Z0-9]$")String> username = null; + + api.userGet(username); + + // TODO: test validations + } + +} diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/.github/workflows/maven.yml b/samples/client/others/java/resttemplate-useAbstractionForFiles/.github/workflows/maven.yml index 893d361fbd7..8b6f7a6aef0 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/.github/workflows/maven.yml +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew.bat b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew.bat +++ b/samples/client/others/java/resttemplate-useAbstractionForFiles/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/.github/workflows/maven.yml b/samples/client/others/java/webclient-useAbstractionForFiles/.github/workflows/maven.yml index 893d361fbd7..8b6f7a6aef0 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/.github/workflows/maven.yml +++ b/samples/client/others/java/webclient-useAbstractionForFiles/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle index 559d51536ef..215eeffc398 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle +++ b/samples/client/others/java/webclient-useAbstractionForFiles/build.gradle @@ -119,7 +119,7 @@ ext { jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -134,5 +134,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/java/webclient-useAbstractionForFiles/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/gradlew b/samples/client/others/java/webclient-useAbstractionForFiles/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/gradlew +++ b/samples/client/others/java/webclient-useAbstractionForFiles/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/gradlew.bat b/samples/client/others/java/webclient-useAbstractionForFiles/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/gradlew.bat +++ b/samples/client/others/java/webclient-useAbstractionForFiles/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml b/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml index 8a0d4efccb1..9014ea37c66 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml +++ b/samples/client/others/java/webclient-useAbstractionForFiles/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 1.8 1.8 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -112,8 +112,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -127,6 +127,6 @@ 1.3.5 3.4.34 1.0.39 - 4.13.2 + 5.10.2 diff --git a/samples/client/others/java/webclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java b/samples/client/others/java/webclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java index 89b79bf7265..d55f0302867 100644 --- a/samples/client/others/java/webclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java +++ b/samples/client/others/java/webclient-useAbstractionForFiles/src/test/java/org/openapitools/client/api/ResourceApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import java.io.File; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for ResourceApi */ -@Ignore +@Disabled public class ResourceApiTest { private final ResourceApi api = new ResourceApi(); @@ -39,7 +40,8 @@ public class ResourceApiTest { */ @Test public void resourceInResponseTest() { - org.springframework.core.io.Resource response = api.resourceInResponse().block(); + // uncomment below to test the function + //org.springframework.core.io.Resource response = api.resourceInResponse().block(); // TODO: test validations } diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/build.gradle b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/build.gradle +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.jar and b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/settings.gradle b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/settings.gradle index 0e6aed9e795..e7cb048a41e 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/settings.gradle +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-okhttp4-parameter-tests' diff --git a/samples/client/others/rust/Cargo.toml b/samples/client/others/rust/Cargo.toml index 85fad3af177..d36e0a12fec 100644 --- a/samples/client/others/rust/Cargo.toml +++ b/samples/client/others/rust/Cargo.toml @@ -1,2 +1,3 @@ [workspace] members = ["hyper/*", "reqwest/*", "reqwest-regression-16119"] +resolver = "2" diff --git a/samples/client/others/rust/hyper/api-with-ref-param/Cargo.toml b/samples/client/others/rust/hyper/api-with-ref-param/Cargo.toml index 78dd6778b99..bbf7d006f49 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/Cargo.toml +++ b/samples/client/others/rust/hyper/api-with-ref-param/Cargo.toml @@ -5,14 +5,13 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/mod.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/mod.rs index 1a5b2f58e4b..4d85ccfc475 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/lib.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/lib.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/api-with-ref-param/src/models/color.rs b/samples/client/others/rust/hyper/api-with-ref-param/src/models/color.rs index b5df438c652..7fcd2768c20 100644 --- a/samples/client/others/rust/hyper/api-with-ref-param/src/models/color.rs +++ b/samples/client/others/rust/hyper/api-with-ref-param/src/models/color.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] @@ -22,12 +23,12 @@ pub enum Color { } -impl ToString for Color { - fn to_string(&self) -> String { +impl std::fmt::Display for Color { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Red => String::from("RED"), - Self::Green => String::from("GREEN"), - Self::Blue => String::from("BLUE"), + Self::Red => write!(f, "RED"), + Self::Green => write!(f, "GREEN"), + Self::Blue => write!(f, "BLUE"), } } } diff --git a/samples/client/others/rust/hyper/composed-oneof/Cargo.toml b/samples/client/others/rust/hyper/composed-oneof/Cargo.toml index 0f8feed80f4..c91777db137 100644 --- a/samples/client/others/rust/hyper/composed-oneof/Cargo.toml +++ b/samples/client/others/rust/hyper/composed-oneof/Cargo.toml @@ -5,14 +5,13 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/composed-oneof/src/apis/mod.rs b/samples/client/others/rust/hyper/composed-oneof/src/apis/mod.rs index 1a5b2f58e4b..4d85ccfc475 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/composed-oneof/src/lib.rs b/samples/client/others/rust/hyper/composed-oneof/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs index a3ba90fcded..7e3701b8c96 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/create_state_request.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index afff7fb23a6..2b3c27f0d4e 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs index 1b1f60a3ffd..c4f53db183d 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/custom_one_of_schema.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs index aaa86cbafbb..aeee0c377e4 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/get_state_200_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs index 67e72b00fed..0d581be15d9 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_a.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjA { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs index 835695c7661..d0c508338d8 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_b.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjB { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs index abc6aae2487..df21df238a3 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_c.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjC { diff --git a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs index 287c2f24e3e..37640c7b418 100644 --- a/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/hyper/composed-oneof/src/models/obj_d.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjD { diff --git a/samples/client/others/rust/hyper/emptyObject/Cargo.toml b/samples/client/others/rust/hyper/emptyObject/Cargo.toml index 3574a9d4a89..7e570fe7056 100644 --- a/samples/client/others/rust/hyper/emptyObject/Cargo.toml +++ b/samples/client/others/rust/hyper/emptyObject/Cargo.toml @@ -5,14 +5,13 @@ authors = ["OpenAPI Generator team and contributors"] description = "Ensure rust supports empty objects using serde::Value" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs b/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs index 1a5b2f58e4b..4d85ccfc475 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/emptyObject/src/lib.rs b/samples/client/others/rust/hyper/emptyObject/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/lib.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs index 6db5fbff7ad..ed5bffc2d37 100644 --- a/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/hyper/emptyObject/src/models/empty_object.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EmptyObject { diff --git a/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml b/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml index 9b6c6d0bed3..7e1c7960f6d 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf-array-map/Cargo.toml @@ -5,14 +5,13 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs index 1a5b2f58e4b..4d85ccfc475 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs index 8472b2a8e5a..a9f47c5e029 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs index 3bf995add30..827f9e47063 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs index bc7d12681c4..50b1144cd1d 100644 --- a/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/hyper/oneOf-array-map/src/models/grape.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Grape { diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml index 60cde076e1b..6ff45ef734e 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/Cargo.toml @@ -4,14 +4,13 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" license = "MIT" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs index 1a5b2f58e4b..4d85ccfc475 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs index 72586e60471..6a7c03c3bc1 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs index b3dfb65a245..a80f3d23e0f 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/banana.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { diff --git a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs index e1b018e8411..cd28f15520c 100644 --- a/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] diff --git a/samples/client/others/rust/hyper/oneOf/Cargo.toml b/samples/client/others/rust/hyper/oneOf/Cargo.toml index 0209137ee82..647e2769394 100644 --- a/samples/client/others/rust/hyper/oneOf/Cargo.toml +++ b/samples/client/others/rust/hyper/oneOf/Cargo.toml @@ -5,14 +5,13 @@ authors = ["OpenAPI Generator team and contributors"] description = "This tests for a oneOf interface representation " # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs b/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs index e0dbe42efe7..288eec40a0e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs +++ b/samples/client/others/rust/hyper/oneOf/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/others/rust/hyper/oneOf/src/lib.rs b/samples/client/others/rust/hyper/oneOf/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/others/rust/hyper/oneOf/src/lib.rs +++ b/samples/client/others/rust/hyper/oneOf/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs index 82d62ccc288..bbca8e7e923 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/addressable.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Addressable : Base schema for addressable entities #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs index 54b95484671..3796fb213f4 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs index d026dbd2b8e..4bfe4182257 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/banana.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs index 7508b00b9af..2499fb3a586 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs index 0afc67998fe..6eb81b99033 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs index 42e2176fca0..8533dd933f5 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs index 3c9312706a7..6d1977d5ba0 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref_or_value.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs index b864cab686e..bfb1aac3382 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index 60773f6e9af..01272ef9fad 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs index d87abf5be19..23875ef0c6e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/extensible.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Extensible { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs index be82765a3a8..ea618695d0b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs index 11640d85a7c..d0b425044b7 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs index b3ad0848d62..fbbbd13150e 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref_or_value.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs index 84967523295..56d7f1eba28 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] diff --git a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs index 00f405a7846..6548af28e3f 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/fruit_type.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] @@ -20,11 +21,11 @@ pub enum FruitType { } -impl ToString for FruitType { - fn to_string(&self) -> String { +impl std::fmt::Display for FruitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Apple => String::from("APPLE"), - Self::Banana => String::from("BANANA"), + Self::Apple => write!(f, "APPLE"), + Self::Banana => write!(f, "BANANA"), } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs index 69ae5110cf6..8ba2efce083 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs index 6ae7f457df4..bfe6de64826 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs index e1c5258c616..a294e07dfdb 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { diff --git a/samples/client/others/rust/reqwest-regression-16119/Cargo.toml b/samples/client/others/rust/reqwest-regression-16119/Cargo.toml index 529ee9eba63..1919da46b08 100644 --- a/samples/client/others/rust/reqwest-regression-16119/Cargo.toml +++ b/samples/client/others/rust/reqwest-regression-16119/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs index 9f70938d1bc..3886a83c954 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest-regression-16119/src/lib.rs b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/lib.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs index 620ea7cb4b9..31d1ea44857 100644 --- a/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs +++ b/samples/client/others/rust/reqwest-regression-16119/src/models/parent.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Parent { diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/Cargo.toml b/samples/client/others/rust/reqwest/api-with-ref-param/Cargo.toml index 7aacac5ecac..7fc367e02dd 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/Cargo.toml +++ b/samples/client/others/rust/reqwest/api-with-ref-param/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs b/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs index b1be5415e4d..27a37acccf4 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/api-with-ref-param/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/src/lib.rs b/samples/client/others/rust/reqwest/api-with-ref-param/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/src/lib.rs +++ b/samples/client/others/rust/reqwest/api-with-ref-param/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/api-with-ref-param/src/models/color.rs b/samples/client/others/rust/reqwest/api-with-ref-param/src/models/color.rs index b5df438c652..7fcd2768c20 100644 --- a/samples/client/others/rust/reqwest/api-with-ref-param/src/models/color.rs +++ b/samples/client/others/rust/reqwest/api-with-ref-param/src/models/color.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] @@ -22,12 +23,12 @@ pub enum Color { } -impl ToString for Color { - fn to_string(&self) -> String { +impl std::fmt::Display for Color { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Red => String::from("RED"), - Self::Green => String::from("GREEN"), - Self::Blue => String::from("BLUE"), + Self::Red => write!(f, "RED"), + Self::Green => write!(f, "GREEN"), + Self::Blue => write!(f, "BLUE"), } } } diff --git a/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml b/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml index 0ff96294b5a..0a06ebb4f87 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml +++ b/samples/client/others/rust/reqwest/composed-oneof/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs index 03e6c12b171..59d4035053a 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs index a3ba90fcded..7e3701b8c96 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/create_state_request.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs index afff7fb23a6..2b3c27f0d4e 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_array_schema_inner.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs index 1b1f60a3ffd..c4f53db183d 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/custom_one_of_schema.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs index aaa86cbafbb..aeee0c377e4 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/get_state_200_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "realtype")] diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs index 67e72b00fed..0d581be15d9 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_a.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjA { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs index 835695c7661..d0c508338d8 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_b.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjB { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs index abc6aae2487..df21df238a3 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_c.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjC { diff --git a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs index 287c2f24e3e..37640c7b418 100644 --- a/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs +++ b/samples/client/others/rust/reqwest/composed-oneof/src/models/obj_d.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjD { diff --git a/samples/client/others/rust/reqwest/emptyObject/Cargo.toml b/samples/client/others/rust/reqwest/emptyObject/Cargo.toml index fa318861c57..8245af0063c 100644 --- a/samples/client/others/rust/reqwest/emptyObject/Cargo.toml +++ b/samples/client/others/rust/reqwest/emptyObject/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "Ensure rust supports empty objects using serde::Value" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs index 09832aa9133..5f5b46edc2c 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/emptyObject/src/lib.rs b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/lib.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs index 6db5fbff7ad..ed5bffc2d37 100644 --- a/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs +++ b/samples/client/others/rust/reqwest/emptyObject/src/models/empty_object.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EmptyObject { diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml b/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml index 9d5cdb68031..0b23d93ace1 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf-array-map/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs index b87854cd090..c487220374e 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs index 8472b2a8e5a..a9f47c5e029 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs index 3bf995add30..827f9e47063 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs index bc7d12681c4..50b1144cd1d 100644 --- a/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs +++ b/samples/client/others/rust/reqwest/oneOf-array-map/src/models/grape.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Grape { diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml index 4c98b337425..4d69b38b2e5 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/Cargo.toml @@ -4,14 +4,11 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" license = "MIT" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs index c0d92bc1e7e..035872574bf 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/apis/default_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs index 72586e60471..6a7c03c3bc1 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs index b3dfb65a245..a80f3d23e0f 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/banana.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { diff --git a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs index e1b018e8411..cd28f15520c 100644 --- a/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] diff --git a/samples/client/others/rust/reqwest/oneOf/Cargo.toml b/samples/client/others/rust/reqwest/oneOf/Cargo.toml index 91e5d81c55b..89997ba9566 100644 --- a/samples/client/others/rust/reqwest/oneOf/Cargo.toml +++ b/samples/client/others/rust/reqwest/oneOf/Cargo.toml @@ -5,14 +5,11 @@ authors = ["OpenAPI Generator team and contributors"] description = "This tests for a oneOf interface representation " # Override this license by providing a License Object in the OpenAPI. license = "Unlicense" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs index 2d07cacdb49..f8ce13d5cac 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/bar_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs index be07fec2008..202e6bb6679 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/apis/foo_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/others/rust/reqwest/oneOf/src/lib.rs b/samples/client/others/rust/reqwest/oneOf/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/lib.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs index 82d62ccc288..bbca8e7e923 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/addressable.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Addressable : Base schema for addressable entities #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs index 54b95484671..3796fb213f4 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/apple.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Apple { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs index d026dbd2b8e..4bfe4182257 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/banana.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Banana { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs index 7508b00b9af..2499fb3a586 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs index 0afc67998fe..6eb81b99033 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs index 42e2176fca0..8533dd933f5 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs index 3c9312706a7..6d1977d5ba0 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref_or_value.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(untagged)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs index b864cab686e..bfb1aac3382 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index 60773f6e9af..01272ef9fad 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs index d87abf5be19..23875ef0c6e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/extensible.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Extensible { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs index be82765a3a8..ea618695d0b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs index 11640d85a7c..d0b425044b7 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs index b3ad0848d62..fbbbd13150e 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref_or_value.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs index 84967523295..56d7f1eba28 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "fruitType")] diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs index 00f405a7846..6548af28e3f 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/fruit_type.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] @@ -20,11 +21,11 @@ pub enum FruitType { } -impl ToString for FruitType { - fn to_string(&self) -> String { +impl std::fmt::Display for FruitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Apple => String::from("APPLE"), - Self::Banana => String::from("BANANA"), + Self::Apple => write!(f, "APPLE"), + Self::Banana => write!(f, "BANANA"), } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs index 69ae5110cf6..8ba2efce083 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs index 6ae7f457df4..bfe6de64826 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs index e1c5258c616..a294e07dfdb 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts index 200ccbbf42e..9f012efcdac 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/api/pet.service.ts @@ -42,8 +42,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts b/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts index 200ccbbf42e..9f012efcdac 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas/api/pet.service.ts @@ -42,8 +42,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/common.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/common.ts index 71ef49eebeb..95d62a0dcdd 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/common.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-user-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-user-dto.ts index 765c4258833..3643cc60cff 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-user-dto.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/abstract-user-dto.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { BranchDto } from './branch-dto'; +import type { BranchDto } from './branch-dto'; /** * diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts index f0c0e4a678c..12cd97a7d4c 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/flat-stock-pick-order-dto.ts @@ -15,7 +15,7 @@ // May contain unused imports in some cases // @ts-ignore -import { AbstractFlatStockPickOrderBaseDto } from './abstract-flat-stock-pick-order-base-dto'; +import type { AbstractFlatStockPickOrderBaseDto } from './abstract-flat-stock-pick-order-base-dto'; /** * @type FlatStockPickOrderDto diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/internal-authenticated-user-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/internal-authenticated-user-dto.ts index 790458e5390..b3d1d3737ca 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/internal-authenticated-user-dto.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/internal-authenticated-user-dto.ts @@ -15,10 +15,10 @@ // May contain unused imports in some cases // @ts-ignore -import { AbstractUserDto } from './abstract-user-dto'; +import type { AbstractUserDto } from './abstract-user-dto'; // May contain unused imports in some cases // @ts-ignore -import { BranchDto } from './branch-dto'; +import type { BranchDto } from './branch-dto'; /** * @type InternalAuthenticatedUserDto diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/remote-authenticated-user-dto.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/remote-authenticated-user-dto.ts index b8071de4421..0cfe57c46a7 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/remote-authenticated-user-dto.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/model/remote-authenticated-user-dto.ts @@ -15,10 +15,10 @@ // May contain unused imports in some cases // @ts-ignore -import { AbstractUserDto } from './abstract-user-dto'; +import type { AbstractUserDto } from './abstract-user-dto'; // May contain unused imports in some cases // @ts-ignore -import { BranchDto } from './branch-dto'; +import type { BranchDto } from './branch-dto'; /** * @type RemoteAuthenticatedUserDto diff --git a/samples/client/petstore/c/docs/another_model.md b/samples/client/petstore/c/docs/another_model.md new file mode 100644 index 00000000000..98d906f97a3 --- /dev/null +++ b/samples/client/petstore/c/docs/another_model.md @@ -0,0 +1,11 @@ +# another_model_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**another_property** | **int** | | [optional] +**uuid_property** | **char \*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/c/model/another_model.c b/samples/client/petstore/c/model/another_model.c new file mode 100644 index 00000000000..11937d83fc4 --- /dev/null +++ b/samples/client/petstore/c/model/another_model.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include "another_model.h" + + + +another_model_t *another_model_create( + int another_property, + char *uuid_property + ) { + another_model_t *another_model_local_var = malloc(sizeof(another_model_t)); + if (!another_model_local_var) { + return NULL; + } + another_model_local_var->another_property = another_property; + another_model_local_var->uuid_property = uuid_property; + + return another_model_local_var; +} + + +void another_model_free(another_model_t *another_model) { + if(NULL == another_model){ + return ; + } + listEntry_t *listEntry; + if (another_model->uuid_property) { + free(another_model->uuid_property); + another_model->uuid_property = NULL; + } + free(another_model); +} + +cJSON *another_model_convertToJSON(another_model_t *another_model) { + cJSON *item = cJSON_CreateObject(); + + // another_model->another_property + if(another_model->another_property) { + if(cJSON_AddNumberToObject(item, "another_property", another_model->another_property) == NULL) { + goto fail; //Numeric + } + } + + + // another_model->uuid_property + if(another_model->uuid_property) { + if(cJSON_AddStringToObject(item, "uuid_property", another_model->uuid_property) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +another_model_t *another_model_parseFromJSON(cJSON *another_modelJSON){ + + another_model_t *another_model_local_var = NULL; + + // another_model->another_property + cJSON *another_property = cJSON_GetObjectItemCaseSensitive(another_modelJSON, "another_property"); + if (another_property) { + if(!cJSON_IsNumber(another_property)) + { + goto end; //Numeric + } + } + + // another_model->uuid_property + cJSON *uuid_property = cJSON_GetObjectItemCaseSensitive(another_modelJSON, "uuid_property"); + if (uuid_property) { + if(!cJSON_IsString(uuid_property) && !cJSON_IsNull(uuid_property)) + { + goto end; //String + } + } + + + another_model_local_var = another_model_create ( + another_property ? another_property->valuedouble : 0, + uuid_property && !cJSON_IsNull(uuid_property) ? strdup(uuid_property->valuestring) : NULL + ); + + return another_model_local_var; +end: + return NULL; + +} diff --git a/samples/client/petstore/c/model/another_model.h b/samples/client/petstore/c/model/another_model.h new file mode 100644 index 00000000000..0fe25570447 --- /dev/null +++ b/samples/client/petstore/c/model/another_model.h @@ -0,0 +1,39 @@ +/* + * another_model.h + * + * to test mapping features + */ + +#ifndef _another_model_H_ +#define _another_model_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct another_model_t another_model_t; + + + + +typedef struct another_model_t { + int another_property; //numeric + char *uuid_property; // string + +} another_model_t; + +another_model_t *another_model_create( + int another_property, + char *uuid_property +); + +void another_model_free(another_model_t *another_model); + +another_model_t *another_model_parseFromJSON(cJSON *another_modelJSON); + +cJSON *another_model_convertToJSON(another_model_t *another_model); + +#endif /* _another_model_H_ */ + diff --git a/samples/client/petstore/c/unit-test/test_another_model.c b/samples/client/petstore/c/unit-test/test_another_model.c new file mode 100644 index 00000000000..9dddc1f3a2a --- /dev/null +++ b/samples/client/petstore/c/unit-test/test_another_model.c @@ -0,0 +1,60 @@ +#ifndef another_model_TEST +#define another_model_TEST + +// the following is to include only the main from the first c file +#ifndef TEST_MAIN +#define TEST_MAIN +#define another_model_MAIN +#endif // TEST_MAIN + +#include +#include +#include +#include +#include "../external/cJSON.h" + +#include "../model/another_model.h" +another_model_t* instantiate_another_model(int include_optional); + + + +another_model_t* instantiate_another_model(int include_optional) { + another_model_t* another_model = NULL; + if (include_optional) { + another_model = another_model_create( + 56, + "0" + ); + } else { + another_model = another_model_create( + 56, + "0" + ); + } + + return another_model; +} + + +#ifdef another_model_MAIN + +void test_another_model(int include_optional) { + another_model_t* another_model_1 = instantiate_another_model(include_optional); + + cJSON* jsonanother_model_1 = another_model_convertToJSON(another_model_1); + printf("another_model :\n%s\n", cJSON_Print(jsonanother_model_1)); + another_model_t* another_model_2 = another_model_parseFromJSON(jsonanother_model_1); + cJSON* jsonanother_model_2 = another_model_convertToJSON(another_model_2); + printf("repeating another_model:\n%s\n", cJSON_Print(jsonanother_model_2)); +} + +int main() { + test_another_model(1); + test_another_model(0); + + printf("Hello world \n"); + return 0; +} + +#endif // another_model_MAIN +#endif // another_model_TEST diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES index a00a1414ecf..06401fbfbce 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES @@ -3,6 +3,7 @@ CMakeLists.txt Config.cmake.in README.md git_push.sh +include/CppRestPetstoreClient/AnyType.h include/CppRestPetstoreClient/ApiClient.h include/CppRestPetstoreClient/ApiConfiguration.h include/CppRestPetstoreClient/ApiException.h @@ -19,8 +20,12 @@ include/CppRestPetstoreClient/model/ApiResponse.h include/CppRestPetstoreClient/model/Category.h include/CppRestPetstoreClient/model/Order.h include/CppRestPetstoreClient/model/Pet.h +include/CppRestPetstoreClient/model/SchemaWithSet.h +include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h include/CppRestPetstoreClient/model/Tag.h include/CppRestPetstoreClient/model/User.h +include/CppRestPetstoreClient/model/Vaccine.h +src/AnyType.cpp src/ApiClient.cpp src/ApiConfiguration.cpp src/ApiException.cpp @@ -36,5 +41,8 @@ src/model/ApiResponse.cpp src/model/Category.cpp src/model/Order.cpp src/model/Pet.cpp +src/model/SchemaWithSet.cpp +src/model/SchemaWithSet_vaccinationBook.cpp src/model/Tag.cpp src/model/User.cpp +src/model/Vaccine.cpp diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/AnyType.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/AnyType.h new file mode 100644 index 00000000000..b11f208faeb --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/AnyType.h @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * AnyType.h + * + * This is the implementation of an any JSON type. + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ + + +#include "CppRestPetstoreClient/Object.h" + +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class AnyType : public Object { +public: + AnyType(); + virtual ~AnyType(); + + ///////////////////////////////////////////// + /// ModelBase overrides + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value &json) override; + + void toMultipart(std::shared_ptr multipart, + const utility::string_t &namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, + const utility::string_t &namePrefix) override; + +private: + web::json::value m_value; +}; + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_AnyType_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h index 8583c1e91c5..5895e3fa9b1 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/ModelBase.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace org { @@ -63,6 +64,8 @@ public: static utility::string_t toString( const std::shared_ptr& val ); template static utility::string_t toString( const std::vector & val ); + template + static utility::string_t toString( const std::set & val ); static web::json::value toJson( bool val ); static web::json::value toJson( float val ); @@ -79,6 +82,8 @@ public: template static web::json::value toJson( const std::vector& val ); template + static web::json::value toJson( const std::set& val ); + template static web::json::value toJson( const std::map& val ); static bool fromString( const utility::string_t& val, bool & ); @@ -96,6 +101,8 @@ public: template static bool fromString( const utility::string_t& val, std::vector & ); template + static bool fromString( const utility::string_t& val, std::set & ); + template static bool fromString( const utility::string_t& val, std::map & ); static bool fromJson( const web::json::value& val, bool & ); @@ -113,6 +120,8 @@ public: template static bool fromJson( const web::json::value& val, std::vector & ); template + static bool fromJson( const web::json::value& val, std::set & ); + template static bool fromJson( const web::json::value& val, std::map & ); @@ -131,6 +140,8 @@ public: template static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); template + static std::shared_ptr toHttpContent( const utility::string_t& name, const std::set& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); + template static std::shared_ptr toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); static bool fromHttpContent( std::shared_ptr val, bool & ); @@ -147,6 +158,8 @@ public: template static bool fromHttpContent( std::shared_ptr val, std::vector & ); template + static bool fromHttpContent( std::shared_ptr val, std::set & ); + template static bool fromHttpContent( std::shared_ptr val, std::map & ); static utility::string_t toBase64( utility::string_t value ); @@ -166,6 +179,8 @@ utility::string_t ModelBase::toString( const std::shared_ptr& val ) } return utility::string_t(ss.str()); } + +// std::vector to string template utility::string_t ModelBase::toString( const std::vector & val ) { @@ -180,6 +195,24 @@ utility::string_t ModelBase::toString( const std::vector & val ) } return strArray; } + +// std::set to string +template +utility::string_t ModelBase::toString( const std::set & val ) +{ + utility::string_t strArray; + for ( const auto &item : val ) + { + strArray.append( toString(item) + "," ); + } + if (val.count() > 0) + { + strArray.pop_back(); + } + return strArray; +} + + template web::json::value ModelBase::toJson( const std::shared_ptr& val ) { @@ -190,6 +223,8 @@ web::json::value ModelBase::toJson( const std::shared_ptr& val ) } return retVal; } + +// std::vector to json template web::json::value ModelBase::toJson( const std::vector& value ) { @@ -200,6 +235,21 @@ web::json::value ModelBase::toJson( const std::vector& value ) } return web::json::value::array(ret); } + +// std::set to json +template +web::json::value ModelBase::toJson( const std::set& value ) +{ + // There's no protoype web::json::value::array(...) taking a std::set parameter. Converting to std::vector to get an array. + std::vector ret; + for ( const auto& x : value ) + { + ret.push_back( toJson(x) ); + } + return web::json::value::array(ret); +} + + template web::json::value ModelBase::toJson( const std::map& val ) { @@ -290,6 +340,7 @@ std::shared_ptr ModelBase::toHttpContent(const utility::string_t& n } return content; } + template std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) { @@ -301,6 +352,7 @@ std::shared_ptr ModelBase::toHttpContent( const utility::string_t& content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) ); return content; } + template std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::map& value, const utility::string_t& contentType ) { diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/PetApi.h index 425765dc86f..0800e328c9a 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/PetApi.h @@ -52,9 +52,9 @@ public: /// /// /// - /// Pet object that needs to be added to the store - pplx::task addPet( - std::shared_ptr body + /// Pet object that needs to be added to the store + pplx::task> addPet( + std::shared_ptr pet ) const; ///

    /// Deletes a pet @@ -104,9 +104,9 @@ public: /// /// /// - /// Pet object that needs to be added to the store - pplx::task updatePet( - std::shared_ptr body + /// Pet object that needs to be added to the store + pplx::task> updatePet( + std::shared_ptr pet ) const; /// /// Updates a pet in the store with form data diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/StoreApi.h index a9bf051caf1..e2156479af4 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/StoreApi.h @@ -78,9 +78,9 @@ public: /// /// /// - /// order placed for purchasing the pet + /// order placed for purchasing the pet pplx::task> placeOrder( - std::shared_ptr body + std::shared_ptr order ) const; protected: diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserApi.h index 69b8ddaeaeb..bfaa8885aa5 100644 --- a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/api/UserApi.h @@ -50,9 +50,9 @@ public: /// /// This can only be done by the logged in user. /// - /// Created user object + /// Created user object pplx::task createUser( - std::shared_ptr body + std::shared_ptr user ) const; /// /// Creates list of users with given input array @@ -60,9 +60,9 @@ public: /// /// /// - /// List of user object + /// List of user object pplx::task createUsersWithArrayInput( - std::vector> body + std::vector> user ) const; /// /// Creates list of users with given input array @@ -70,9 +70,9 @@ public: /// /// /// - /// List of user object + /// List of user object pplx::task createUsersWithListInput( - std::vector> body + std::vector> user ) const; /// /// Delete user @@ -121,10 +121,10 @@ public: /// This can only be done by the logged in user. /// /// name that need to be deleted - /// Updated user object + /// Updated user object pplx::task updateUser( utility::string_t username, - std::shared_ptr body + std::shared_ptr user ) const; protected: diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet_vaccinationBook.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet_vaccinationBook.h new file mode 100644 index 00000000000..e82de6ab65a --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Pet_vaccinationBook.h @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.6.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Pet_vaccinationBook.h + * + * Vaccination book of the pet + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_vaccinationBook_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_vaccinationBook_H_ + + +#include "CppRestPetstoreClient/ModelBase.h" + +#include "CppRestPetstoreClient/model/Vaccine.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Vaccine; + +/// +/// Vaccination book of the pet +/// +class Pet_vaccinationBook + : public ModelBase +{ +public: + Pet_vaccinationBook(); + virtual ~Pet_vaccinationBook(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + ///////////////////////////////////////////// + /// Pet_vaccinationBook members + + /// + /// + /// + std::set>& getVaccines(); + bool vaccinesIsSet() const; + void unsetVaccines(); + + void setVaccines(const std::set>& value); + + +protected: + std::set> m_Vaccines; + bool m_VaccinesIsSet; +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_vaccinationBook_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h new file mode 100644 index 00000000000..1faef1272b4 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet.h @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * SchemaWithSet.h + * + * Schema with a set property + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_H_ + + +#include "CppRestPetstoreClient/ModelBase.h" + +#include "CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h" +#include +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class SchemaWithSet_vaccinationBook; + +/// +/// Schema with a set property +/// +class SchemaWithSet + : public ModelBase +{ +public: + SchemaWithSet(); + virtual ~SchemaWithSet(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + ///////////////////////////////////////////// + /// SchemaWithSet members + + /// + /// pedigree and other certificates + /// + std::set& getCertificates(); + bool certificatesIsSet() const; + void unsetCertificates(); + + void setCertificates(const std::set& value); + + /// + /// + /// + std::shared_ptr getVaccinationBook() const; + bool vaccinationBookIsSet() const; + void unsetVaccinationBook(); + + void setVaccinationBook(const std::shared_ptr& value); + + +protected: + std::set m_Certificates; + bool m_CertificatesIsSet; + std::shared_ptr m_VaccinationBook; + bool m_VaccinationBookIsSet; +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h new file mode 100644 index 00000000000..0f50805b938 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * SchemaWithSet_vaccinationBook.h + * + * Vaccination book of the pet + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_vaccinationBook_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_vaccinationBook_H_ + + +#include "CppRestPetstoreClient/ModelBase.h" + +#include "CppRestPetstoreClient/model/Vaccine.h" +#include + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +class Vaccine; + +/// +/// Vaccination book of the pet +/// +class SchemaWithSet_vaccinationBook + : public ModelBase +{ +public: + SchemaWithSet_vaccinationBook(); + virtual ~SchemaWithSet_vaccinationBook(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + ///////////////////////////////////////////// + /// SchemaWithSet_vaccinationBook members + + /// + /// + /// + std::set>& getVaccines(); + bool vaccinesIsSet() const; + void unsetVaccines(); + + void setVaccines(const std::set>& value); + + +protected: + std::set> m_Vaccines; + bool m_VaccinesIsSet; +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_SchemaWithSet_vaccinationBook_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h new file mode 100644 index 00000000000..42dd8b87d3c --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Vaccine.h @@ -0,0 +1,88 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/* + * Vaccine.h + * + * + */ + +#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Vaccine_H_ +#define ORG_OPENAPITOOLS_CLIENT_MODEL_Vaccine_H_ + + +#include "CppRestPetstoreClient/ModelBase.h" + +#include "CppRestPetstoreClient/AnyType.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + +/// +/// +/// +class Vaccine + : public ModelBase +{ +public: + Vaccine(); + virtual ~Vaccine(); + + ///////////////////////////////////////////// + /// ModelBase overrides + + void validate() override; + + web::json::value toJson() const override; + bool fromJson(const web::json::value& json) override; + + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; + + ///////////////////////////////////////////// + /// Vaccine members + + /// + /// vaccination date + /// + std::shared_ptr getDate() const; + bool dateIsSet() const; + void unsetdate(); + + void setDate(const std::shared_ptr& value); + + /// + /// true if a booster is still needed to complete the vaccination + /// + bool isBoosterRequired() const; + bool boosterRequiredIsSet() const; + void unsetBoosterRequired(); + + void setBoosterRequired(bool value); + + +protected: + std::shared_ptr m_date; + bool m_dateIsSet; + bool m_BoosterRequired; + bool m_BoosterRequiredIsSet; +}; + + +} +} +} +} + +#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Vaccine_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/src/AnyType.cpp b/samples/client/petstore/cpp-restsdk/client/src/AnyType.cpp new file mode 100644 index 00000000000..c358568a2c1 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/AnyType.cpp @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#include "CppRestPetstoreClient/AnyType.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + +AnyType::AnyType() { m_value = web::json::value::null(); } + +AnyType::~AnyType() {} + +void AnyType::validate() {} + +web::json::value AnyType::toJson() const { return m_value; } + +bool AnyType::fromJson(const web::json::value &val) { + m_value = val; + m_IsSet = true; + return isSet(); +} + +void AnyType::toMultipart(std::shared_ptr multipart, + const utility::string_t &prefix) const { + if (m_value.is_object()) { + return Object::toMultipart(multipart, prefix); + } + throw std::runtime_error("AnyType::toMultipart: unsupported type"); +} + +bool AnyType::fromMultiPart(std::shared_ptr multipart, + const utility::string_t &prefix) { + if (m_value.is_object()) { + return Object::fromMultiPart(multipart, prefix); + } + return false; +} + +} +} +} +} diff --git a/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp index 31f0dcf2748..d66684b4db9 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/PetApi.cpp @@ -35,13 +35,13 @@ PetApi::~PetApi() { } -pplx::task PetApi::addPet(std::shared_ptr body) const +pplx::task> PetApi::addPet(std::shared_ptr pet) const { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'pet' is set + if (pet == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->addPet")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->addPet")); } @@ -54,6 +54,8 @@ pplx::task PetApi::addPet(std::shared_ptr body) const std::map> localVarFileParams; std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t localVarResponseHttpContentType; @@ -93,7 +95,7 @@ pplx::task PetApi::addPet(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value localVarJson; - localVarJson = ModelBase::toJson(body); + localVarJson = ModelBase::toJson(pet); localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); @@ -104,9 +106,9 @@ pplx::task PetApi::addPet(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr localVarMultipart(new MultipartFormData); - if(body.get()) + if(pet.get()) { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); + pet->toMultipart(localVarMultipart, utility::conversions::to_string_t("pet")); } @@ -161,7 +163,25 @@ pplx::task PetApi::addPet(std::shared_ptr body) const }) .then([=](utility::string_t localVarResponse) { - return void(); + std::shared_ptr localVarResult(new Pet()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling addPet: unsupported response type")); + } + + return localVarResult; }); } pplx::task PetApi::deletePet(int64_t petId, boost::optional apiKey) const @@ -670,13 +690,13 @@ pplx::task> PetApi::getPetById(int64_t petId) const return localVarResult; }); } -pplx::task PetApi::updatePet(std::shared_ptr body) const +pplx::task> PetApi::updatePet(std::shared_ptr pet) const { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'pet' is set + if (pet == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->updatePet")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'pet' when calling PetApi->updatePet")); } @@ -689,6 +709,8 @@ pplx::task PetApi::updatePet(std::shared_ptr body) const std::map> localVarFileParams; std::unordered_set localVarResponseHttpContentTypes; + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); + localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); utility::string_t localVarResponseHttpContentType; @@ -728,7 +750,7 @@ pplx::task PetApi::updatePet(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value localVarJson; - localVarJson = ModelBase::toJson(body); + localVarJson = ModelBase::toJson(pet); localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); @@ -739,9 +761,9 @@ pplx::task PetApi::updatePet(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr localVarMultipart(new MultipartFormData); - if(body.get()) + if(pet.get()) { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); + pet->toMultipart(localVarMultipart, utility::conversions::to_string_t("pet")); } @@ -796,7 +818,25 @@ pplx::task PetApi::updatePet(std::shared_ptr body) const }) .then([=](utility::string_t localVarResponse) { - return void(); + std::shared_ptr localVarResult(new Pet()); + + if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) + { + web::json::value localVarJson = web::json::value::parse(localVarResponse); + + ModelBase::fromJson(localVarJson, localVarResult); + } + // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) + // { + // TODO multipart response parsing + // } + else + { + throw ApiException(500 + , utility::conversions::to_string_t("error calling updatePet: unsupported response type")); + } + + return localVarResult; }); } pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optional name, boost::optional status) const diff --git a/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp index 180ac6f03aa..e70054adbc7 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/StoreApi.cpp @@ -398,13 +398,13 @@ pplx::task> StoreApi::getOrderById(int64_t orderId) const return localVarResult; }); } -pplx::task> StoreApi::placeOrder(std::shared_ptr body) const +pplx::task> StoreApi::placeOrder(std::shared_ptr order) const { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'order' is set + if (order == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling StoreApi->placeOrder")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'order' when calling StoreApi->placeOrder")); } @@ -445,6 +445,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); std::shared_ptr localVarHttpBody; @@ -456,7 +457,7 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value localVarJson; - localVarJson = ModelBase::toJson(body); + localVarJson = ModelBase::toJson(order); localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); @@ -467,9 +468,9 @@ pplx::task> StoreApi::placeOrder(std::shared_ptr b localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr localVarMultipart(new MultipartFormData); - if(body.get()) + if(order.get()) { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); + order->toMultipart(localVarMultipart, utility::conversions::to_string_t("order")); } diff --git a/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp index 4340bc41d41..7e00f72f853 100644 --- a/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/src/api/UserApi.cpp @@ -35,13 +35,13 @@ UserApi::~UserApi() { } -pplx::task UserApi::createUser(std::shared_ptr body) const +pplx::task UserApi::createUser(std::shared_ptr user) const { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'user' is set + if (user == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->createUser")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->createUser")); } @@ -80,6 +80,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) const localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); std::shared_ptr localVarHttpBody; @@ -91,7 +92,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value localVarJson; - localVarJson = ModelBase::toJson(body); + localVarJson = ModelBase::toJson(user); localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); @@ -102,9 +103,9 @@ pplx::task UserApi::createUser(std::shared_ptr body) const localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr localVarMultipart(new MultipartFormData); - if(body.get()) + if(user.get()) { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); + user->toMultipart(localVarMultipart, utility::conversions::to_string_t("user")); } @@ -120,6 +121,14 @@ pplx::task UserApi::createUser(std::shared_ptr body) const throw ApiException(415, utility::conversions::to_string_t("UserApi->createUser does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) @@ -160,7 +169,7 @@ pplx::task UserApi::createUser(std::shared_ptr body) const return void(); }); } -pplx::task UserApi::createUsersWithArrayInput(std::vector> body) const +pplx::task UserApi::createUsersWithArrayInput(std::vector> user) const { @@ -199,6 +208,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); std::shared_ptr localVarHttpBody; @@ -212,7 +222,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector localVarJsonArray; - for( auto& localVarItem : body ) + for( auto& localVarItem : user ) { localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); @@ -230,11 +240,11 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector localVarJsonArray; - for( auto& localVarItem : body ) + for( auto& localVarItem : user ) { localVarJsonArray.push_back(ModelBase::toJson(localVarItem)); } - localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), localVarJsonArray, utility::conversions::to_string_t("application/json"))); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), localVarJsonArray, utility::conversions::to_string_t("application/json"))); } @@ -250,6 +260,14 @@ pplx::task UserApi::createUsersWithArrayInput(std::vectorcreateUsersWithArrayInput does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) @@ -290,7 +308,7 @@ pplx::task UserApi::createUsersWithArrayInput(std::vector UserApi::createUsersWithListInput(std::vector> body) const +pplx::task UserApi::createUsersWithListInput(std::vector> user) const { @@ -329,6 +347,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); std::shared_ptr localVarHttpBody; @@ -342,7 +361,7 @@ pplx::task UserApi::createUsersWithListInput(std::vector localVarJsonArray; - for( auto& localVarItem : body ) + for( auto& localVarItem : user ) { localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); @@ -360,11 +379,11 @@ pplx::task UserApi::createUsersWithListInput(std::vector localVarJsonArray; - for( auto& localVarItem : body ) + for( auto& localVarItem : user ) { localVarJsonArray.push_back(ModelBase::toJson(localVarItem)); } - localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), localVarJsonArray, utility::conversions::to_string_t("application/json"))); + localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("user"), localVarJsonArray, utility::conversions::to_string_t("application/json"))); } @@ -380,6 +399,14 @@ pplx::task UserApi::createUsersWithListInput(std::vectorcreateUsersWithListInput does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) @@ -484,6 +511,14 @@ pplx::task UserApi::deleteUser(utility::string_t username) const throw ApiException(415, utility::conversions::to_string_t("UserApi->deleteUser does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) @@ -849,6 +884,14 @@ pplx::task UserApi::logoutUser() const throw ApiException(415, utility::conversions::to_string_t("UserApi->logoutUser does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) @@ -889,13 +932,13 @@ pplx::task UserApi::logoutUser() const return void(); }); } -pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr body) const +pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr user) const { - // verify the required parameter 'body' is set - if (body == nullptr) + // verify the required parameter 'user' is set + if (user == nullptr) { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->updateUser")); + throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'user' when calling UserApi->updateUser")); } @@ -935,6 +978,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; std::unordered_set localVarConsumeHttpContentTypes; + localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); std::shared_ptr localVarHttpBody; @@ -946,7 +990,7 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); web::json::value localVarJson; - localVarJson = ModelBase::toJson(body); + localVarJson = ModelBase::toJson(user); localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); @@ -957,9 +1001,9 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); std::shared_ptr localVarMultipart(new MultipartFormData); - if(body.get()) + if(user.get()) { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); + user->toMultipart(localVarMultipart, utility::conversions::to_string_t("user")); } @@ -975,6 +1019,14 @@ pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr throw ApiException(415, utility::conversions::to_string_t("UserApi->updateUser does not consume any supported media type")); } + // authentication (api_key) required + { + utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); + if ( localVarApiKey.size() > 0 ) + { + localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; + } + } return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) .then([=](web::http::http_response localVarResponse) diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Pet_vaccinationBook.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Pet_vaccinationBook.cpp new file mode 100644 index 00000000000..082e038bf2e --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Pet_vaccinationBook.cpp @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 7.6.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "CppRestPetstoreClient/model/Pet_vaccinationBook.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +Pet_vaccinationBook::Pet_vaccinationBook() +{ + m_VaccinesIsSet = false; +} + +Pet_vaccinationBook::~Pet_vaccinationBook() +{ +} + +void Pet_vaccinationBook::validate() +{ + // TODO: implement validation +} + +web::json::value Pet_vaccinationBook::toJson() const +{ + + web::json::value val = web::json::value::object(); + + if(m_VaccinesIsSet) + { + val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines); + } + + return val; +} + +bool Pet_vaccinationBook::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t(U("vaccines")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vaccines"))); + if(!fieldValue.is_null()) + { + std::set> refVal_setVaccines; + ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines); + setVaccines(refVal_setVaccines); + } + } + return ok; +} + +void Pet_vaccinationBook::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VaccinesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines)); + } +} + +bool Pet_vaccinationBook::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("vaccines")))) + { + std::set> refVal_setVaccines; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines ); + setVaccines(refVal_setVaccines); + } + return ok; +} + +std::set>& Pet_vaccinationBook::getVaccines() +{ + return m_Vaccines; +} + +void Pet_vaccinationBook::setVaccines(const std::set>& value) +{ + m_Vaccines = value; + m_VaccinesIsSet = true; +} + +bool Pet_vaccinationBook::vaccinesIsSet() const +{ + return m_VaccinesIsSet; +} + +void Pet_vaccinationBook::unsetVaccines() +{ + m_VaccinesIsSet = false; +} +} +} +} +} + + diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp new file mode 100644 index 00000000000..e6327b61fc0 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet.cpp @@ -0,0 +1,168 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "CppRestPetstoreClient/model/SchemaWithSet.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +SchemaWithSet::SchemaWithSet() +{ + m_CertificatesIsSet = false; + m_VaccinationBookIsSet = false; +} + +SchemaWithSet::~SchemaWithSet() +{ +} + +void SchemaWithSet::validate() +{ + // TODO: implement validation +} + +web::json::value SchemaWithSet::toJson() const +{ + + web::json::value val = web::json::value::object(); + + if(m_CertificatesIsSet) + { + val[utility::conversions::to_string_t(U("certificates"))] = ModelBase::toJson(m_Certificates); + } + if(m_VaccinationBookIsSet) + { + val[utility::conversions::to_string_t(U("vaccinationBook"))] = ModelBase::toJson(m_VaccinationBook); + } + + return val; +} + +bool SchemaWithSet::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t(U("certificates")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("certificates"))); + if(!fieldValue.is_null()) + { + std::set refVal_setCertificates; + ok &= ModelBase::fromJson(fieldValue, refVal_setCertificates); + setCertificates(refVal_setCertificates); + } + } + if(val.has_field(utility::conversions::to_string_t(U("vaccinationBook")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vaccinationBook"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setVaccinationBook; + ok &= ModelBase::fromJson(fieldValue, refVal_setVaccinationBook); + setVaccinationBook(refVal_setVaccinationBook); + } + } + return ok; +} + +void SchemaWithSet::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_CertificatesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("certificates")), m_Certificates)); + } + if(m_VaccinationBookIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccinationBook")), m_VaccinationBook)); + } +} + +bool SchemaWithSet::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("certificates")))) + { + std::set refVal_setCertificates; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("certificates"))), refVal_setCertificates ); + setCertificates(refVal_setCertificates); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("vaccinationBook")))) + { + std::shared_ptr refVal_setVaccinationBook; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccinationBook"))), refVal_setVaccinationBook ); + setVaccinationBook(refVal_setVaccinationBook); + } + return ok; +} + +std::set& SchemaWithSet::getCertificates() +{ + return m_Certificates; +} + +void SchemaWithSet::setCertificates(const std::set& value) +{ + m_Certificates = value; + m_CertificatesIsSet = true; +} + +bool SchemaWithSet::certificatesIsSet() const +{ + return m_CertificatesIsSet; +} + +void SchemaWithSet::unsetCertificates() +{ + m_CertificatesIsSet = false; +} +std::shared_ptr SchemaWithSet::getVaccinationBook() const +{ + return m_VaccinationBook; +} + +void SchemaWithSet::setVaccinationBook(const std::shared_ptr& value) +{ + m_VaccinationBook = value; + m_VaccinationBookIsSet = true; +} + +bool SchemaWithSet::vaccinationBookIsSet() const +{ + return m_VaccinationBookIsSet; +} + +void SchemaWithSet::unsetVaccinationBook() +{ + m_VaccinationBookIsSet = false; +} +} +} +} +} + + diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp new file mode 100644 index 00000000000..5409db81098 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/model/SchemaWithSet_vaccinationBook.cpp @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "CppRestPetstoreClient/model/SchemaWithSet_vaccinationBook.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +SchemaWithSet_vaccinationBook::SchemaWithSet_vaccinationBook() +{ + m_VaccinesIsSet = false; +} + +SchemaWithSet_vaccinationBook::~SchemaWithSet_vaccinationBook() +{ +} + +void SchemaWithSet_vaccinationBook::validate() +{ + // TODO: implement validation +} + +web::json::value SchemaWithSet_vaccinationBook::toJson() const +{ + + web::json::value val = web::json::value::object(); + + if(m_VaccinesIsSet) + { + val[utility::conversions::to_string_t(U("vaccines"))] = ModelBase::toJson(m_Vaccines); + } + + return val; +} + +bool SchemaWithSet_vaccinationBook::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t(U("vaccines")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("vaccines"))); + if(!fieldValue.is_null()) + { + std::set> refVal_setVaccines; + ok &= ModelBase::fromJson(fieldValue, refVal_setVaccines); + setVaccines(refVal_setVaccines); + } + } + return ok; +} + +void SchemaWithSet_vaccinationBook::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_VaccinesIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("vaccines")), m_Vaccines)); + } +} + +bool SchemaWithSet_vaccinationBook::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("vaccines")))) + { + std::set> refVal_setVaccines; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("vaccines"))), refVal_setVaccines ); + setVaccines(refVal_setVaccines); + } + return ok; +} + +std::set>& SchemaWithSet_vaccinationBook::getVaccines() +{ + return m_Vaccines; +} + +void SchemaWithSet_vaccinationBook::setVaccines(const std::set>& value) +{ + m_Vaccines = value; + m_VaccinesIsSet = true; +} + +bool SchemaWithSet_vaccinationBook::vaccinesIsSet() const +{ + return m_VaccinesIsSet; +} + +void SchemaWithSet_vaccinationBook::unsetVaccines() +{ + m_VaccinesIsSet = false; +} +} +} +} +} + + diff --git a/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp new file mode 100644 index 00000000000..4b525969431 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/src/model/Vaccine.cpp @@ -0,0 +1,169 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * NOTE: This class is auto generated by OpenAPI-Generator 8.0.0-SNAPSHOT. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +#include "CppRestPetstoreClient/model/Vaccine.h" + +namespace org { +namespace openapitools { +namespace client { +namespace model { + + + +Vaccine::Vaccine() +{ + m_dateIsSet = false; + m_BoosterRequired = false; + m_BoosterRequiredIsSet = false; +} + +Vaccine::~Vaccine() +{ +} + +void Vaccine::validate() +{ + // TODO: implement validation +} + +web::json::value Vaccine::toJson() const +{ + + web::json::value val = web::json::value::object(); + + if(m_dateIsSet) + { + val[utility::conversions::to_string_t(U("date"))] = ModelBase::toJson(m_date); + } + if(m_BoosterRequiredIsSet) + { + val[utility::conversions::to_string_t(U("boosterRequired"))] = ModelBase::toJson(m_BoosterRequired); + } + + return val; +} + +bool Vaccine::fromJson(const web::json::value& val) +{ + bool ok = true; + + if(val.has_field(utility::conversions::to_string_t(U("date")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("date"))); + if(!fieldValue.is_null()) + { + std::shared_ptr refVal_setDate; + ok &= ModelBase::fromJson(fieldValue, refVal_setDate); + setDate(refVal_setDate); + } + } + if(val.has_field(utility::conversions::to_string_t(U("boosterRequired")))) + { + const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("boosterRequired"))); + if(!fieldValue.is_null()) + { + bool refVal_setBoosterRequired; + ok &= ModelBase::fromJson(fieldValue, refVal_setBoosterRequired); + setBoosterRequired(refVal_setBoosterRequired); + } + } + return ok; +} + +void Vaccine::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const +{ + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + if(m_dateIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("date")), m_date)); + } + if(m_BoosterRequiredIsSet) + { + multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t(U("boosterRequired")), m_BoosterRequired)); + } +} + +bool Vaccine::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) +{ + bool ok = true; + utility::string_t namePrefix = prefix; + if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(U("."))) + { + namePrefix += utility::conversions::to_string_t(U(".")); + } + + if(multipart->hasContent(utility::conversions::to_string_t(U("date")))) + { + std::shared_ptr refVal_setDate; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("date"))), refVal_setDate ); + setDate(refVal_setDate); + } + if(multipart->hasContent(utility::conversions::to_string_t(U("boosterRequired")))) + { + bool refVal_setBoosterRequired; + ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("boosterRequired"))), refVal_setBoosterRequired ); + setBoosterRequired(refVal_setBoosterRequired); + } + return ok; +} + +std::shared_ptr Vaccine::getDate() const +{ + return m_date; +} + +void Vaccine::setDate(const std::shared_ptr& value) +{ + m_date = value; + m_dateIsSet = true; +} + +bool Vaccine::dateIsSet() const +{ + return m_dateIsSet; +} + +void Vaccine::unsetdate() +{ + m_dateIsSet = false; +} +bool Vaccine::isBoosterRequired() const +{ + return m_BoosterRequired; +} + +void Vaccine::setBoosterRequired(bool value) +{ + m_BoosterRequired = value; + m_BoosterRequiredIsSet = true; +} + +bool Vaccine::boosterRequiredIsSet() const +{ + return m_BoosterRequiredIsSet; +} + +void Vaccine::unsetBoosterRequired() +{ + m_BoosterRequiredIsSet = false; +} +} +} +} +} + + diff --git a/samples/client/petstore/crystal/pom.xml b/samples/client/petstore/crystal/pom.xml index 29b7e4bc351..2cdbf1e1739 100644 --- a/samples/client/petstore/crystal/pom.xml +++ b/samples/client/petstore/crystal/pom.xml @@ -37,6 +37,7 @@ install --ignore-crystal-version + --without-development diff --git a/samples/client/petstore/crystal/shard.lock b/samples/client/petstore/crystal/shard.lock index 6a33ec4f671..b2ac3af1d03 100644 --- a/samples/client/petstore/crystal/shard.lock +++ b/samples/client/petstore/crystal/shard.lock @@ -1,16 +1,8 @@ version: 2.0 shards: - ameba: - git: https://github.com/crystal-ameba/ameba.git - version: 0.14.3 - crest: git: https://github.com/mamantoha/crest.git - version: 0.26.8 - - exception_page: - git: https://github.com/crystal-loot/exception_page.git - version: 0.1.5 + version: 1.3.13 http-client-digest_auth: git: https://github.com/mamantoha/http-client-digest_auth.git @@ -18,17 +10,5 @@ shards: http_proxy: git: https://github.com/mamantoha/http_proxy.git - version: 0.8.0 - - kemal: - git: https://github.com/kemalcr/kemal.git - version: 0.27.0 - - kilt: - git: https://github.com/jeromegn/kilt.git - version: 0.4.1 - - radix: - git: https://github.com/luislavena/radix.git - version: 0.3.9 + version: 0.10.3 diff --git a/samples/client/petstore/crystal/shard.yml b/samples/client/petstore/crystal/shard.yml index a4c86a06e2a..acb14217d1b 100644 --- a/samples/client/petstore/crystal/shard.yml +++ b/samples/client/petstore/crystal/shard.yml @@ -8,12 +8,12 @@ crystal: ">= 0.35.1" dependencies: crest: github: mamantoha/crest - version: ~> 0.26.0 + version: ~> 1.3.13 development_dependencies: kemal: github: kemalcr/kemal - version: ~>0.27.0 + version: ~>1.5.0 ameba: github: crystal-ameba/ameba diff --git a/samples/client/petstore/crystal/spec/models/pet_spec.cr b/samples/client/petstore/crystal/spec/models/pet_spec.cr index 16117449db5..dac484057c9 100644 --- a/samples/client/petstore/crystal/spec/models/pet_spec.cr +++ b/samples/client/petstore/crystal/spec/models/pet_spec.cr @@ -19,7 +19,7 @@ describe Petstore::Pet do describe "test an instance of Pet" do it "should fail to compile if any required properties is missing" do - assert_compilation_error(path: "./pet_compilation_error_spec.cr", message: "Error: no overload matches 'Petstore::Pet.new', id: Nil, category: Nil, name: Nil, photo_urls: Array(String), tags: Nil, status: Nil") + assert_compilation_error(path: "./pet_compilation_error_spec.cr", message: "Error: expected argument 'name' to 'Petstore::Pet.new' to be String, not Nil") end it "should create an instance of Pet with only required properties" do diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index ed8ad21dd92..56bcd0078f2 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -29,7 +29,7 @@ module Petstore msg = "" msg = msg + "\nHTTP status code: #{code}" if @code msg = msg + "\nResponse headers: #{response_headers}" if @response_headers - if @message.nil? || @message.empty? + if @message.try &.empty? msg = msg + "\nError message: the server returns an error but the HTTP response body is empty." else msg = msg + "\nResponse body: #{@message}" diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs index 76ccb5126ad..07611aff320 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -266,6 +266,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs index 4fdb779b142..5c879e6f980 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -37,9 +37,8 @@ namespace Org.OpenAPITools.Model /// children /// firstName /// lastName - /// type [JsonConstructor] - public Adult(Option?> children = default, Option firstName = default, Option lastName = default, Option type = default) : base(firstName, lastName, type) + public Adult(Option?> children = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) { ChildrenOption = children; OnCreated(); @@ -60,6 +59,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("children")] public List? Children { get { return this.ChildrenOption; } set { this.ChildrenOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Adult"; + /// /// Returns the string presentation of the object /// @@ -148,7 +154,7 @@ namespace Org.OpenAPITools.Model if (type.IsSet && type.Value == null) throw new ArgumentNullException(nameof(type), "Property is not nullable for class Adult."); - return new Adult(children, firstName, lastName, type); + return new Adult(children, firstName, lastName); } /// @@ -162,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, adult, jsonSerializerOptions); + WriteProperties(writer, adult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -173,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Adult adult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Adult adult, JsonSerializerOptions jsonSerializerOptions) { if (adult.ChildrenOption.IsSet && adult.Children == null) throw new ArgumentNullException(nameof(adult.Children), "Property is required for class Adult."); @@ -184,9 +190,6 @@ namespace Org.OpenAPITools.Model if (adult.LastNameOption.IsSet && adult.LastName == null) throw new ArgumentNullException(nameof(adult.LastName), "Property is required for class Adult."); - if (adult.TypeOption.IsSet && adult.Type == null) - throw new ArgumentNullException(nameof(adult.Type), "Property is required for class Adult."); - if (adult.ChildrenOption.IsSet) { writer.WritePropertyName("children"); @@ -198,8 +201,7 @@ namespace Org.OpenAPITools.Model if (adult.LastNameOption.IsSet) writer.WriteString("lastName", adult.LastName); - if (adult.TypeOption.IsSet) - writer.WriteString("$_type", adult.Type); + writer.WriteString("$_type", adult.Type); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs index c82c4feb26e..426cf4706ee 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -37,10 +37,9 @@ namespace Org.OpenAPITools.Model /// age /// firstName /// lastName - /// type /// boosterSeat [JsonConstructor] - public Child(Option age = default, Option firstName = default, Option lastName = default, Option type = default, Option boosterSeat = default) : base(firstName, lastName, type) + public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) { AgeOption = age; BoosterSeatOption = boosterSeat; @@ -62,6 +61,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("age")] public int? Age { get { return this.AgeOption; } set { this.AgeOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + /// /// Used to track the state of BoosterSeat /// @@ -172,7 +178,7 @@ namespace Org.OpenAPITools.Model if (boosterSeat.IsSet && boosterSeat.Value == null) throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); - return new Child(age, firstName, lastName, type, boosterSeat); + return new Child(age, firstName, lastName, boosterSeat); } /// @@ -186,7 +192,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, child, jsonSerializerOptions); + WriteProperties(writer, child, jsonSerializerOptions); writer.WriteEndObject(); } @@ -197,7 +203,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Child child, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOptions jsonSerializerOptions) { if (child.FirstNameOption.IsSet && child.FirstName == null) throw new ArgumentNullException(nameof(child.FirstName), "Property is required for class Child."); @@ -205,9 +211,6 @@ namespace Org.OpenAPITools.Model if (child.LastNameOption.IsSet && child.LastName == null) throw new ArgumentNullException(nameof(child.LastName), "Property is required for class Child."); - if (child.TypeOption.IsSet && child.Type == null) - throw new ArgumentNullException(nameof(child.Type), "Property is required for class Child."); - if (child.AgeOption.IsSet) writer.WriteNumber("age", child.AgeOption.Value!.Value); @@ -217,8 +220,7 @@ namespace Org.OpenAPITools.Model if (child.LastNameOption.IsSet) writer.WriteString("lastName", child.LastName); - if (child.TypeOption.IsSet) - writer.WriteString("$_type", child.Type); + writer.WriteString("$_type", child.Type); if (child.BoosterSeatOption.IsSet) writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Person.cs index b05de7bd826..7acde5f926c 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Person.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Person.cs @@ -36,13 +36,11 @@ namespace Org.OpenAPITools.Model /// /// firstName /// lastName - /// type [JsonConstructor] - public Person(Option firstName = default, Option lastName = default, Option type = default) + public Person(Option firstName = default, Option lastName = default) { FirstNameOption = firstName; LastNameOption = lastName; - TypeOption = type; OnCreated(); } @@ -75,17 +73,11 @@ namespace Org.OpenAPITools.Model public string? LastName { get { return this.LastNameOption; } set { this.LastNameOption = new(value); } } /// - /// Used to track the state of Type + /// The discriminator /// [JsonIgnore] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public Option TypeOption { get; private set; } - - /// - /// Gets or Sets Type - /// - [JsonPropertyName("$_type")] - public string? Type { get { return this.TypeOption; } set { this.TypeOption = new(value); } } + public string Type { get; } = "Person"; /// /// Gets or Sets additional properties @@ -103,7 +95,6 @@ namespace Org.OpenAPITools.Model sb.Append("class Person {\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -156,6 +147,14 @@ namespace Org.OpenAPITools.Model Option lastName = default; Option type = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "$_type"); + + if (discriminator != null && discriminator.Equals("Adult")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Child")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -195,7 +194,7 @@ namespace Org.OpenAPITools.Model if (type.IsSet && type.Value == null) throw new ArgumentNullException(nameof(type), "Property is not nullable for class Person."); - return new Person(firstName, lastName, type); + return new Person(firstName, lastName); } /// @@ -207,9 +206,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Person person, JsonSerializerOptions jsonSerializerOptions) { + if (person is Adult adult){ + JsonSerializer.Serialize(writer, adult, jsonSerializerOptions); + return; + } + + if (person is Child child){ + JsonSerializer.Serialize(writer, child, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, person, jsonSerializerOptions); + WriteProperties(writer, person, jsonSerializerOptions); writer.WriteEndObject(); } @@ -220,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Person person, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Person person, JsonSerializerOptions jsonSerializerOptions) { if (person.FirstNameOption.IsSet && person.FirstName == null) throw new ArgumentNullException(nameof(person.FirstName), "Property is required for class Person."); @@ -228,17 +237,13 @@ namespace Org.OpenAPITools.Model if (person.LastNameOption.IsSet && person.LastName == null) throw new ArgumentNullException(nameof(person.LastName), "Property is required for class Person."); - if (person.TypeOption.IsSet && person.Type == null) - throw new ArgumentNullException(nameof(person.Type), "Property is required for class Person."); - if (person.FirstNameOption.IsSet) writer.WriteString("firstName", person.FirstName); if (person.LastNameOption.IsSet) writer.WriteString("lastName", person.LastName); - if (person.TypeOption.IsSet) - writer.WriteString("$_type", person.Type); + writer.WriteString("$_type", person.Type); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 82d2a297384..2fa1be128cc 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/README.md index 36381fcdb16..e7c0364a9f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/README.md @@ -133,7 +133,6 @@ Endpoints do not require authorization. - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs index 57169a68de3..906cd993717 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -266,6 +266,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs index e933186d8e0..c887090b6ca 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Apple.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.KindOption.IsSet && apple.Kind == null) throw new ArgumentNullException(nameof(apple.Kind), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs index 102dc422c2e..ad5d19ad12d 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.CountOption.IsSet) writer.WriteNumber("count", banana.CountOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs index 053d067c836..fde1dab0272 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -212,16 +212,16 @@ namespace Org.OpenAPITools.Model if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, fruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, fruit.AppleOption.Value, jsonSerializerOptions); } if (fruit.BananaOption.IsSet && fruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, fruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, fruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -232,7 +232,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 82d2a297384..2fa1be128cc 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/README.md index f99d3ae5d09..5fcead230b8 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/README.md @@ -133,7 +133,6 @@ Endpoints do not require authorization. - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs index fcb4e3b1152..581159c0005 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -251,6 +251,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs index 96cf1c1e5ed..abd80a48180 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Apple.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.KindOption.IsSet && apple.Kind == null) throw new ArgumentNullException(nameof(apple.Kind), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs index a2ec1b7eadf..0425d779223 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.CountOption.IsSet) writer.WriteNumber("count", banana.CountOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs index 8598723e3f3..415bc63ab43 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Fruit.cs @@ -211,16 +211,16 @@ namespace Org.OpenAPITools.Model if (fruit.AppleOption.IsSet && fruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, fruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, fruit.AppleOption.Value, jsonSerializerOptions); } if (fruit.BananaOption.IsSet && fruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(fruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, fruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, fruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c8c0e561c37..0c948f147ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/README.md index 109d2319f50..3826b4be2aa 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/README.md @@ -132,7 +132,6 @@ Endpoints do not require authorization. - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES index 4fdf3cb720f..deef0a5de48 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/.openapi-generator/FILES @@ -62,6 +62,7 @@ docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md docs/models/MapTestMapOfEnumStringValue.md +docs/models/MixLog.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md docs/models/Model200Response.md docs/models/ModelClient.md @@ -215,6 +216,7 @@ src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs src/Org.OpenAPITools/Model/MapTestMapOfEnumStringValue.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml index e0dd3b46457..b4ab1bc2b81 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1247,6 +1247,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -1272,7 +1276,7 @@ components: id: 0 shipDate: 2020-02-02T20:20:20.000222Z complete: false - status: null + status: placed properties: id: format: int64 @@ -1396,7 +1400,7 @@ components: id: 1 - name: name id: 1 - status: null + status: available properties: id: format: int64 @@ -2524,6 +2528,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2714,6 +2820,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**FormulaVersionDate** | **DateTime** | | +**Id** | **Guid** | | +**MixDate** | **DateTime** | | +**TotalOverPoors** | **int** | | +**TotalRecalculations** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] +**ShopId** | **Guid** | | [optional] +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**TotalPrice** | **float** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/RequiredClass.md index f336a29afea..2c792f6b219 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/RequiredClass.md +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/RequiredClass.md @@ -15,17 +15,6 @@ Name | Type | Description | Notes **RequiredNotnullableStringProp** | **string** | | **RequiredNotnullableUuid** | **Guid** | | **RequiredNotnullableintegerProp** | **int** | | -**RequiredNullableArrayOfString** | **List<string>** | | -**RequiredNullableBooleanProp** | **bool** | | -**RequiredNullableDateProp** | **DateOnly** | | -**RequiredNullableDatetimeProp** | **DateTime** | | -**RequiredNullableEnumInteger** | **RequiredClassRequiredNullableEnumInteger** | | -**RequiredNullableEnumIntegerOnly** | **RequiredClassRequiredNullableEnumIntegerOnly** | | -**RequiredNullableEnumString** | **RequiredClassRequiredNullableEnumString** | | -**RequiredNullableIntegerProp** | **int** | | -**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | -**RequiredNullableStringProp** | **string** | | -**RequiredNullableUuid** | **Guid** | | **NotRequiredNotnullableDateProp** | **DateOnly** | | [optional] **NotRequiredNotnullableintegerProp** | **int** | | [optional] **NotRequiredNullableDateProp** | **DateOnly** | | [optional] @@ -48,6 +37,17 @@ Name | Type | Description | Notes **NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] **NotrequiredNullableStringProp** | **string** | | [optional] **NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateOnly** | | +**RequiredNullableDatetimeProp** | **DateTime** | | +**RequiredNullableEnumInteger** | **RequiredClassRequiredNullableEnumInteger** | | +**RequiredNullableEnumIntegerOnly** | **RequiredClassRequiredNullableEnumIntegerOnly** | | +**RequiredNullableEnumString** | **RequiredClassRequiredNullableEnumString** | | +**RequiredNullableIntegerProp** | **int** | | +**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNullableStringProp** | **string** | | +**RequiredNullableUuid** | **Guid** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs index e5186391592..d1da68281ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'RequiredNotnullableintegerProp' } - /// - /// Test the property 'RequiredNullableArrayOfString' - /// - [Fact] - public void RequiredNullableArrayOfStringTest() - { - // TODO unit test for the property 'RequiredNullableArrayOfString' - } - - /// - /// Test the property 'RequiredNullableBooleanProp' - /// - [Fact] - public void RequiredNullableBooleanPropTest() - { - // TODO unit test for the property 'RequiredNullableBooleanProp' - } - - /// - /// Test the property 'RequiredNullableDateProp' - /// - [Fact] - public void RequiredNullableDatePropTest() - { - // TODO unit test for the property 'RequiredNullableDateProp' - } - - /// - /// Test the property 'RequiredNullableDatetimeProp' - /// - [Fact] - public void RequiredNullableDatetimePropTest() - { - // TODO unit test for the property 'RequiredNullableDatetimeProp' - } - - /// - /// Test the property 'RequiredNullableEnumInteger' - /// - [Fact] - public void RequiredNullableEnumIntegerTest() - { - // TODO unit test for the property 'RequiredNullableEnumInteger' - } - - /// - /// Test the property 'RequiredNullableEnumIntegerOnly' - /// - [Fact] - public void RequiredNullableEnumIntegerOnlyTest() - { - // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' - } - - /// - /// Test the property 'RequiredNullableEnumString' - /// - [Fact] - public void RequiredNullableEnumStringTest() - { - // TODO unit test for the property 'RequiredNullableEnumString' - } - - /// - /// Test the property 'RequiredNullableIntegerProp' - /// - [Fact] - public void RequiredNullableIntegerPropTest() - { - // TODO unit test for the property 'RequiredNullableIntegerProp' - } - - /// - /// Test the property 'RequiredNullableOuterEnumDefaultValue' - /// - [Fact] - public void RequiredNullableOuterEnumDefaultValueTest() - { - // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' - } - - /// - /// Test the property 'RequiredNullableStringProp' - /// - [Fact] - public void RequiredNullableStringPropTest() - { - // TODO unit test for the property 'RequiredNullableStringProp' - } - - /// - /// Test the property 'RequiredNullableUuid' - /// - [Fact] - public void RequiredNullableUuidTest() - { - // TODO unit test for the property 'RequiredNullableUuid' - } - /// /// Test the property 'NotRequiredNotnullableDateProp' /// @@ -448,5 +349,104 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'NotrequiredNullableUuid' } + + /// + /// Test the property 'RequiredNullableArrayOfString' + /// + [Fact] + public void RequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNullableArrayOfString' + } + + /// + /// Test the property 'RequiredNullableBooleanProp' + /// + [Fact] + public void RequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNullableBooleanProp' + } + + /// + /// Test the property 'RequiredNullableDateProp' + /// + [Fact] + public void RequiredNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNullableDateProp' + } + + /// + /// Test the property 'RequiredNullableDatetimeProp' + /// + [Fact] + public void RequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNullableEnumInteger' + /// + [Fact] + public void RequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNullableEnumInteger' + } + + /// + /// Test the property 'RequiredNullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNullableEnumString' + /// + [Fact] + public void RequiredNullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNullableEnumString' + } + + /// + /// Test the property 'RequiredNullableIntegerProp' + /// + [Fact] + public void RequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'RequiredNullableIntegerProp' + } + + /// + /// Test the property 'RequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNullableStringProp' + /// + [Fact] + public void RequiredNullableStringPropTest() + { + // TODO unit test for the property 'RequiredNullableStringProp' + } + + /// + /// Test the property 'RequiredNullableUuid' + /// + [Fact] + public void RequiredNullableUuidTest() + { + // TODO unit test for the property 'RequiredNullableUuid' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs index 26a81eb5330..1f8bfa7f636 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -355,6 +355,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs index 2bb970ddf67..4a6a9ad0907 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -102,6 +102,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new MapTestJsonConverter()); _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueJsonConverter()); _jsonOptions.Converters.Add(new MapTestMapOfEnumStringValueNullableJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs index 2ed0cacfe1e..b746b781c3e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activity, jsonSerializerOptions); + WriteProperties(writer, activity, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) { if (activity.ActivityOutputsOption.IsSet && activity.ActivityOutputs == null) throw new ArgumentNullException(nameof(activity.ActivityOutputs), "Property is required for class Activity."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index e51af3a1a80..3afdabfc6d5 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activityOutputElementRepresentation, jsonSerializerOptions); + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) { if (activityOutputElementRepresentation.Prop1Option.IsSet && activityOutputElementRepresentation.Prop1 == null) throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop1), "Property is required for class ActivityOutputElementRepresentation."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8aecec6328e..b422890b171 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -318,7 +318,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, additionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -329,7 +329,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (additionalPropertiesClass.EmptyMapOption.IsSet && additionalPropertiesClass.EmptyMap == null) throw new ArgumentNullException(nameof(additionalPropertiesClass.EmptyMap), "Property is required for class AdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Animal.cs index 700f201cf89..aea74905748 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Animal.cs @@ -32,12 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, Option color = default) + public Animal(Option color = default) { - ClassName = className; ColorOption = color; OnCreated(); } @@ -45,10 +43,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets ClassName + /// The discriminator /// - [JsonPropertyName("className")] - public string ClassName { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; /// /// Used to track the state of Color @@ -77,7 +76,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); @@ -130,6 +128,14 @@ namespace Org.OpenAPITools.Model Option className = default; Option color = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "className"); + + if (discriminator != null && discriminator.Equals("Cat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Dog")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -166,7 +172,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); - return new Animal(className.Value, color); + return new Animal(color); } /// @@ -178,9 +184,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { + if (animal is Cat cat){ + JsonSerializer.Serialize(writer, cat, jsonSerializerOptions); + return; + } + + if (animal is Dog dog){ + JsonSerializer.Serialize(writer, dog, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, animal, jsonSerializerOptions); + WriteProperties(writer, animal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -191,11 +207,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { - if (animal.ClassName == null) - throw new ArgumentNullException(nameof(animal.ClassName), "Property is required for class Animal."); - if (animal.ColorOption.IsSet && animal.Color == null) throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs index 84fa6eef72c..02c11a9a77e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apiResponse, jsonSerializerOptions); + WriteProperties(writer, apiResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) { if (apiResponse.MessageOption.IsSet && apiResponse.Message == null) throw new ArgumentNullException(nameof(apiResponse.Message), "Property is required for class ApiResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Apple.cs index 233ec205fd3..59e078d0a8d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Apple.cs @@ -227,7 +227,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -238,7 +238,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.ColorCodeOption.IsSet && apple.ColorCode == null) throw new ArgumentNullException(nameof(apple.ColorCode), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs index eccab20bd13..9801b197763 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, appleReq, jsonSerializerOptions); + WriteProperties(writer, appleReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) { if (appleReq.Cultivar == null) throw new ArgumentNullException(nameof(appleReq.Cultivar), "Property is required for class AppleReq."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 2935b372eee..7decd736dd6 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet && arrayOfArrayOfNumberOnly.ArrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfArrayOfNumberOnly.ArrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 1e028acb226..d9c4bbd05e4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfNumberOnly.ArrayNumberOption.IsSet && arrayOfNumberOnly.ArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfNumberOnly.ArrayNumber), "Property is required for class ArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs index f0990197e1d..0d5cf364c0b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -200,7 +200,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayTest, jsonSerializerOptions); + WriteProperties(writer, arrayTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -211,7 +211,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) { if (arrayTest.ArrayArrayOfIntegerOption.IsSet && arrayTest.ArrayArrayOfInteger == null) throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfInteger), "Property is required for class ArrayTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs index 773f3d09bf9..5deb7b3cabb 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.LengthCmOption.IsSet) writer.WriteNumber("lengthCm", banana.LengthCmOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs index d8b91e33ae2..1ead980e60a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, bananaReq, jsonSerializerOptions); + WriteProperties(writer, bananaReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) { writer.WriteNumber("lengthCm", bananaReq.LengthCm); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs index 53c20a25cd1..863cc82bc78 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BasquePig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, basquePig, jsonSerializerOptions); + WriteProperties(writer, basquePig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) { if (basquePig.ClassName == null) throw new ArgumentNullException(nameof(basquePig.ClassName), "Property is required for class BasquePig."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs index fe9e72647b7..5ee27d790d1 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Capitalization.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, capitalization, jsonSerializerOptions); + WriteProperties(writer, capitalization, jsonSerializerOptions); writer.WriteEndObject(); } @@ -278,7 +278,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) { if (capitalization.ATT_NAMEOption.IsSet && capitalization.ATT_NAME == null) throw new ArgumentNullException(nameof(capitalization.ATT_NAME), "Property is required for class Capitalization."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs index b60c6b69a4e..33d826fa7ea 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") /// declawed [JsonConstructor] - public Cat(string className, Option color = default, Option declawed = default) : base(className, color) + public Cat(Option color = default, Option declawed = default) : base(color) { DeclawedOption = declawed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Cat"; + /// /// Used to track the state of Declawed /// @@ -141,7 +147,7 @@ namespace Org.OpenAPITools.Model if (declawed.IsSet && declawed.Value == null) throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); - return new Cat(className.Value, color, declawed); + return new Cat(color, declawed); } /// @@ -155,7 +161,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, cat, jsonSerializerOptions); + WriteProperties(writer, cat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,11 +172,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) { - if (cat.ClassName == null) - throw new ArgumentNullException(nameof(cat.ClassName), "Property is required for class Cat."); - if (cat.ColorOption.IsSet && cat.Color == null) throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs index a880d914ef0..646d804623a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, category, jsonSerializerOptions); + WriteProperties(writer, category, jsonSerializerOptions); writer.WriteEndObject(); } @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) { if (category.Name == null) throw new ArgumentNullException(nameof(category.Name), "Property is required for class Category."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs index e45ece9c076..4caedf25fce 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ChildCat.cs @@ -32,12 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType /// name [JsonConstructor] - public ChildCat(ChildCatAllOfPetType petType, Option name = default) : base(ChildCatAllOfPetTypeValueConverter.ToJsonValue(petType)) + public ChildCat(Option name = default) : base() { - PetType = petType; NameOption = name; OnCreated(); } @@ -45,10 +43,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public new ChildCatAllOfPetType PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new ChildCatAllOfPetType PetType { get; } = (ChildCatAllOfPetType)Enum.Parse(typeof(ChildCatAllOfPetType), "ChildCat"); /// /// Used to track the state of Name @@ -72,7 +71,6 @@ namespace Org.OpenAPITools.Model StringBuilder sb = new StringBuilder(); sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -142,7 +140,7 @@ namespace Org.OpenAPITools.Model if (name.IsSet && name.Value == null) throw new ArgumentNullException(nameof(name), "Property is not nullable for class ChildCat."); - return new ChildCat(petType.Value.Value, name); + return new ChildCat(name); } /// @@ -156,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, childCat, jsonSerializerOptions); + WriteProperties(writer, childCat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -167,13 +165,12 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) { if (childCat.NameOption.IsSet && childCat.Name == null) throw new ArgumentNullException(nameof(childCat.Name), "Property is required for class ChildCat."); - var petTypeRawValue = ChildCatAllOfPetTypeValueConverter.ToJsonValue(childCat.PetType); - writer.WriteString("pet_type", petTypeRawValue); + writer.WriteString("pet_type", ChildCatAllOfPetTypeValueConverter.ToJsonValue(childCat.PetType)); if (childCat.NameOption.IsSet) writer.WriteString("name", childCat.Name); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs index 31f98f66f50..3740f80f7c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ClassModel.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, classModel, jsonSerializerOptions); + WriteProperties(writer, classModel, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) { if (classModel.ClassOption.IsSet && classModel.Class == null) throw new ArgumentNullException(nameof(classModel.Class), "Property is required for class ClassModel."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 747b36ec65b..1a42f967ca9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, complexQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (complexQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(complexQuadrilateral.QuadrilateralType), "Property is required for class ComplexQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs index c28634e4e13..9eb8b733358 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DanishPig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, danishPig, jsonSerializerOptions); + WriteProperties(writer, danishPig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) { if (danishPig.ClassName == null) throw new ArgumentNullException(nameof(danishPig.ClassName), "Property is required for class DanishPig."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 7d7789e3d8d..4f3c74c26d9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dateOnlyClass, jsonSerializerOptions); + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) { if (dateOnlyClass.DateOnlyPropertyOption.IsSet) writer.WriteString("dateOnlyProperty", dateOnlyClass.DateOnlyPropertyOption.Value.Value.ToString(DateOnlyPropertyFormat)); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 2db62c460fc..1ffcd1e09a8 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, deprecatedObject, jsonSerializerOptions); + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) { if (deprecatedObject.NameOption.IsSet && deprecatedObject.Name == null) throw new ArgumentNullException(nameof(deprecatedObject.Name), "Property is required for class DeprecatedObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Dog.cs index cafd49dfda8..ee6d230b265 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Dog.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// breed /// color (default to "red") [JsonConstructor] - public Dog(string className, Option breed = default, Option color = default) : base(className, color) + public Dog(Option breed = default, Option color = default) : base(color) { BreedOption = breed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Dog"; + /// /// Used to track the state of Breed /// @@ -140,7 +146,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); - return new Dog(className.Value, breed, color); + return new Dog(breed, color); } /// @@ -154,7 +160,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dog, jsonSerializerOptions); + WriteProperties(writer, dog, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,11 +171,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) { - if (dog.ClassName == null) - throw new ArgumentNullException(nameof(dog.ClassName), "Property is required for class Dog."); - if (dog.BreedOption.IsSet && dog.Breed == null) throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs index 29aaebc2075..e5f2fb7e025 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, drawing, jsonSerializerOptions); + WriteProperties(writer, drawing, jsonSerializerOptions); writer.WriteEndObject(); } @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) { if (drawing.MainShapeOption.IsSet && drawing.MainShape == null) throw new ArgumentNullException(nameof(drawing.MainShape), "Property is required for class Drawing."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs index 3b102cc35c8..427a3cd1ffc 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumArrays, jsonSerializerOptions); + WriteProperties(writer, enumArrays, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) { if (enumArrays.ArrayEnumOption.IsSet && enumArrays.ArrayEnum == null) throw new ArgumentNullException(nameof(enumArrays.ArrayEnum), "Property is required for class EnumArrays."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs index 830bec9aee2..47fbc662772 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumTest.cs @@ -346,7 +346,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumTest, jsonSerializerOptions); + WriteProperties(writer, enumTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -357,7 +357,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) { var enumStringRequiredRawValue = EnumTestEnumStringValueConverter.ToJsonValue(enumTest.EnumStringRequired); writer.WriteString("enum_string_required", enumStringRequiredRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index bbf4bf8f8e0..b84f89b531d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, equilateralTriangle, jsonSerializerOptions); + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) { if (equilateralTriangle.ShapeType == null) throw new ArgumentNullException(nameof(equilateralTriangle.ShapeType), "Property is required for class EquilateralTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/File.cs index dc4ffdfe56b..49cc4b73830 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/File.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, file, jsonSerializerOptions); + WriteProperties(writer, file, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) { if (file.SourceURIOption.IsSet && file.SourceURI == null) throw new ArgumentNullException(nameof(file.SourceURI), "Property is required for class File."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 29f6d03ffd0..4c22995b605 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fileSchemaTestClass, jsonSerializerOptions); + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) { if (fileSchemaTestClass.FileOption.IsSet && fileSchemaTestClass.File == null) throw new ArgumentNullException(nameof(fileSchemaTestClass.File), "Property is required for class FileSchemaTestClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Foo.cs index 21dba921663..2b59206330a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Foo.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, foo, jsonSerializerOptions); + WriteProperties(writer, foo, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) { if (foo.BarOption.IsSet && foo.Bar == null) throw new ArgumentNullException(nameof(foo.Bar), "Property is required for class Foo."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 21585e839d6..42d40f715ec 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fooGetDefaultResponse, jsonSerializerOptions); + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) { if (fooGetDefaultResponse.StringOption.IsSet && fooGetDefaultResponse.String == null) throw new ArgumentNullException(nameof(fooGetDefaultResponse.String), "Property is required for class FooGetDefaultResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 24cc7c3f39b..545fe1a83b6 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -703,7 +703,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, formatTest, jsonSerializerOptions); + WriteProperties(writer, formatTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) { if (formatTest.Byte == null) throw new ArgumentNullException(nameof(formatTest.Byte), "Property is required for class FormatTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs index 1c491c62a5a..d39d2a29ad8 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Fruit.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs index 03ef926c47d..f5dd6d56278 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FruitReq.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruitReq, jsonSerializerOptions); + WriteProperties(writer, fruitReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs index b0ff469057d..95772b5635b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GmFruit.cs @@ -203,16 +203,16 @@ namespace Org.OpenAPITools.Model if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, gmFruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, gmFruit.AppleOption.Value, jsonSerializerOptions); } if (gmFruit.BananaOption.IsSet && gmFruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, gmFruit, jsonSerializerOptions); + WriteProperties(writer, gmFruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) { if (gmFruit.ColorOption.IsSet && gmFruit.Color == null) throw new ArgumentNullException(nameof(gmFruit.Color), "Property is required for class GmFruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 6b7d7ae8da6..86246ae5457 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -32,21 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public GrandparentAnimal(string petType) + public GrandparentAnimal() { - PetType = petType; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public string PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; /// /// Gets or Sets additional properties @@ -62,7 +61,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -113,6 +111,14 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("ParentPet")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -143,7 +149,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); - return new GrandparentAnimal(petType.Value); + return new GrandparentAnimal(); } /// @@ -155,9 +161,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { + if (grandparentAnimal is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + if (grandparentAnimal is ParentPet parentPet){ + JsonSerializer.Serialize(writer, parentPet, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, grandparentAnimal, jsonSerializerOptions); + WriteProperties(writer, grandparentAnimal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -168,11 +184,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { - if (grandparentAnimal.PetType == null) - throw new ArgumentNullException(nameof(grandparentAnimal.PetType), "Property is required for class GrandparentAnimal."); - writer.WriteString("pet_type", grandparentAnimal.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index a58bd756968..88c5d4274ea 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, hasOnlyReadOnly, jsonSerializerOptions); + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) { if (hasOnlyReadOnly.BarOption.IsSet && hasOnlyReadOnly.Bar == null) throw new ArgumentNullException(nameof(hasOnlyReadOnly.Bar), "Property is required for class HasOnlyReadOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 2c741269251..0c916b0a208 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -148,7 +148,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, healthCheckResult, jsonSerializerOptions); + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) { if (healthCheckResult.NullableMessageOption.IsSet) if (healthCheckResult.NullableMessageOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3f4aa3229c4..384e48f3a15 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, isoscelesTriangle, jsonSerializerOptions); + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) { if (isoscelesTriangle.ShapeType == null) throw new ArgumentNullException(nameof(isoscelesTriangle.ShapeType), "Property is required for class IsoscelesTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/List.cs index cbdf361981b..b4f4f31b7fd 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/List.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, list, jsonSerializerOptions); + WriteProperties(writer, list, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) { if (list.Var123ListOption.IsSet && list.Var123List == null) throw new ArgumentNullException(nameof(list.Var123List), "Property is required for class List."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 25c7ef39a73..9e1a7878ad5 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, literalStringClass, jsonSerializerOptions); + WriteProperties(writer, literalStringClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -185,7 +185,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) { if (literalStringClass.EscapedLiteralStringOption.IsSet && literalStringClass.EscapedLiteralString == null) throw new ArgumentNullException(nameof(literalStringClass.EscapedLiteralString), "Property is required for class LiteralStringClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs index 05e439a9c3e..1be5661d993 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Mammal.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Whale whale, string className) + public Mammal(Whale whale) { Whale = whale; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Zebra zebra, string className) + public Mammal(Zebra zebra) { Zebra = zebra; - ClassName = className; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Pig pig, string className) + public Mammal(Pig pig) { Pig = pig; - ClassName = className; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public Pig Pig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Mammal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); if (pig != null) - return new Mammal(pig, className.Value); + return new Mammal(pig); if (whale != null) - return new Mammal(whale, className.Value); + return new Mammal(whale); if (zebra != null) - return new Mammal(zebra, className.Value); + return new Mammal(zebra); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (mammal.Whale != null) { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); - whaleJsonConverter.WriteProperties(ref writer, mammal.Whale, jsonSerializerOptions); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } if (mammal.Zebra != null) { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); - zebraJsonConverter.WriteProperties(ref writer, mammal.Zebra, jsonSerializerOptions); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } if (mammal.Pig != null) { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); - pigJsonConverter.WriteProperties(ref writer, mammal.Pig, jsonSerializerOptions); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } - WriteProperties(ref writer, mammal, jsonSerializerOptions); + WriteProperties(writer, mammal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) { - if (mammal.ClassName == null) - throw new ArgumentNullException(nameof(mammal.ClassName), "Property is required for class Mammal."); - writer.WriteString("className", mammal.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs index f703c6769aa..e99895fbeda 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -224,7 +224,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mapTest, jsonSerializerOptions); + WriteProperties(writer, mapTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -235,7 +235,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) { if (mapTest.DirectMapOption.IsSet && mapTest.DirectMap == null) throw new ArgumentNullException(nameof(mapTest.DirectMap), "Property is required for class MapTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..44130823a00 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1027 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + public partial class MixLog : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// description + /// formulaVersionDate + /// id + /// mixDate + /// totalOverPoors + /// totalRecalculations + /// totalSkips + /// totalUnderPours + /// batchNumber + /// BrandCode is only required for non-color mixes + /// BrandId is only required for color mixes + /// BrandName is only required for color mixes + /// CategoryCode is not used anymore + /// Color is only required for color mixes + /// colorDescription + /// comment + /// commercialProductCode + /// country + /// createdBy + /// createdByFirstName + /// createdByLastName + /// deltaECalculationRepaired + /// deltaECalculationSprayout + /// ownColorVariantNumber + /// primerProductId + /// ProductId is only required for color mixes + /// ProductLineCode is only required for color mixes + /// ProductName is only required for color mixes + /// selectedVersionIndex + /// shopId + /// SomeCode is only required for color mixes + /// totalPrice + [JsonConstructor] + public MixLog(string description, DateTime formulaVersionDate, Guid id, DateTime mixDate, int totalOverPoors, int totalRecalculations, int totalSkips, int totalUnderPours, Option batchNumber = default, Option brandCode = default, Option brandId = default, Option brandName = default, Option categoryCode = default, Option color = default, Option colorDescription = default, Option comment = default, Option commercialProductCode = default, Option country = default, Option createdBy = default, Option createdByFirstName = default, Option createdByLastName = default, Option deltaECalculationRepaired = default, Option deltaECalculationSprayout = default, Option ownColorVariantNumber = default, Option primerProductId = default, Option productId = default, Option productLineCode = default, Option productName = default, Option selectedVersionIndex = default, Option shopId = default, Option someCode = default, Option totalPrice = default) + { + Description = description; + FormulaVersionDate = formulaVersionDate; + Id = id; + MixDate = mixDate; + TotalOverPoors = totalOverPoors; + TotalRecalculations = totalRecalculations; + TotalSkips = totalSkips; + TotalUnderPours = totalUnderPours; + BatchNumberOption = batchNumber; + BrandCodeOption = brandCode; + BrandIdOption = brandId; + BrandNameOption = brandName; + CategoryCodeOption = categoryCode; + ColorOption = color; + ColorDescriptionOption = colorDescription; + CommentOption = comment; + CommercialProductCodeOption = commercialProductCode; + CountryOption = country; + CreatedByOption = createdBy; + CreatedByFirstNameOption = createdByFirstName; + CreatedByLastNameOption = createdByLastName; + DeltaECalculationRepairedOption = deltaECalculationRepaired; + DeltaECalculationSprayoutOption = deltaECalculationSprayout; + OwnColorVariantNumberOption = ownColorVariantNumber; + PrimerProductIdOption = primerProductId; + ProductIdOption = productId; + ProductLineCodeOption = productLineCode; + ProductNameOption = productName; + SelectedVersionIndexOption = selectedVersionIndex; + ShopIdOption = shopId; + SomeCodeOption = someCode; + TotalPriceOption = totalPrice; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [JsonPropertyName("formulaVersionDate")] + public DateTime FormulaVersionDate { get; set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public Guid Id { get; set; } + + /// + /// Gets or Sets MixDate + /// + [JsonPropertyName("mixDate")] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [JsonPropertyName("totalOverPoors")] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [JsonPropertyName("totalRecalculations")] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [JsonPropertyName("totalSkips")] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [JsonPropertyName("totalUnderPours")] + public int TotalUnderPours { get; set; } + + /// + /// Used to track the state of BatchNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BatchNumberOption { get; private set; } + + /// + /// Gets or Sets BatchNumber + /// + [JsonPropertyName("batchNumber")] + public string BatchNumber { get { return this.BatchNumberOption; } set { this.BatchNumberOption = new(value); } } + + /// + /// Used to track the state of BrandCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandCodeOption { get; private set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [JsonPropertyName("brandCode")] + public string BrandCode { get { return this.BrandCodeOption; } set { this.BrandCodeOption = new(value); } } + + /// + /// Used to track the state of BrandId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandIdOption { get; private set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [JsonPropertyName("brandId")] + public string BrandId { get { return this.BrandIdOption; } set { this.BrandIdOption = new(value); } } + + /// + /// Used to track the state of BrandName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandNameOption { get; private set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [JsonPropertyName("brandName")] + public string BrandName { get { return this.BrandNameOption; } set { this.BrandNameOption = new(value); } } + + /// + /// Used to track the state of CategoryCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryCodeOption { get; private set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [JsonPropertyName("categoryCode")] + public string CategoryCode { get { return this.CategoryCodeOption; } set { this.CategoryCodeOption = new(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new(value); } } + + /// + /// Used to track the state of ColorDescription + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorDescriptionOption { get; private set; } + + /// + /// Gets or Sets ColorDescription + /// + [JsonPropertyName("colorDescription")] + public string ColorDescription { get { return this.ColorDescriptionOption; } set { this.ColorDescriptionOption = new(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string Comment { get { return this.CommentOption; } set { this.CommentOption = new(value); } } + + /// + /// Used to track the state of CommercialProductCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommercialProductCodeOption { get; private set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [JsonPropertyName("commercialProductCode")] + public string CommercialProductCode { get { return this.CommercialProductCodeOption; } set { this.CommercialProductCodeOption = new(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } + + /// + /// Gets or Sets Country + /// + [JsonPropertyName("country")] + public string Country { get { return this.CountryOption; } set { this.CountryOption = new(value); } } + + /// + /// Used to track the state of CreatedBy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByOption { get; private set; } + + /// + /// Gets or Sets CreatedBy + /// + [JsonPropertyName("createdBy")] + public string CreatedBy { get { return this.CreatedByOption; } set { this.CreatedByOption = new(value); } } + + /// + /// Used to track the state of CreatedByFirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByFirstNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [JsonPropertyName("createdByFirstName")] + public string CreatedByFirstName { get { return this.CreatedByFirstNameOption; } set { this.CreatedByFirstNameOption = new(value); } } + + /// + /// Used to track the state of CreatedByLastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByLastNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [JsonPropertyName("createdByLastName")] + public string CreatedByLastName { get { return this.CreatedByLastNameOption; } set { this.CreatedByLastNameOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationRepaired + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationRepairedOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [JsonPropertyName("deltaECalculationRepaired")] + public string DeltaECalculationRepaired { get { return this.DeltaECalculationRepairedOption; } set { this.DeltaECalculationRepairedOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationSprayout + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationSprayoutOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [JsonPropertyName("deltaECalculationSprayout")] + public string DeltaECalculationSprayout { get { return this.DeltaECalculationSprayoutOption; } set { this.DeltaECalculationSprayoutOption = new(value); } } + + /// + /// Used to track the state of OwnColorVariantNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnColorVariantNumberOption { get; private set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [JsonPropertyName("ownColorVariantNumber")] + public int? OwnColorVariantNumber { get { return this.OwnColorVariantNumberOption; } set { this.OwnColorVariantNumberOption = new(value); } } + + /// + /// Used to track the state of PrimerProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PrimerProductIdOption { get; private set; } + + /// + /// Gets or Sets PrimerProductId + /// + [JsonPropertyName("primerProductId")] + public string PrimerProductId { get { return this.PrimerProductIdOption; } set { this.PrimerProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductIdOption { get; private set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [JsonPropertyName("productId")] + public string ProductId { get { return this.ProductIdOption; } set { this.ProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductLineCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductLineCodeOption { get; private set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [JsonPropertyName("productLineCode")] + public string ProductLineCode { get { return this.ProductLineCodeOption; } set { this.ProductLineCodeOption = new(value); } } + + /// + /// Used to track the state of ProductName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductNameOption { get; private set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [JsonPropertyName("productName")] + public string ProductName { get { return this.ProductNameOption; } set { this.ProductNameOption = new(value); } } + + /// + /// Used to track the state of SelectedVersionIndex + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedVersionIndexOption { get; private set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [JsonPropertyName("selectedVersionIndex")] + public int? SelectedVersionIndex { get { return this.SelectedVersionIndexOption; } set { this.SelectedVersionIndexOption = new(value); } } + + /// + /// Used to track the state of ShopId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopIdOption { get; private set; } + + /// + /// Gets or Sets ShopId + /// + [JsonPropertyName("shopId")] + public Guid? ShopId { get { return this.ShopIdOption; } set { this.ShopIdOption = new(value); } } + + /// + /// Used to track the state of SomeCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomeCodeOption { get; private set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [JsonPropertyName("someCode")] + public string SomeCode { get { return this.SomeCodeOption; } set { this.SomeCodeOption = new(value); } } + + /// + /// Used to track the state of TotalPrice + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalPriceOption { get; private set; } + + /// + /// Gets or Sets TotalPrice + /// + [JsonPropertyName("totalPrice")] + public float? TotalPrice { get { return this.TotalPriceOption; } set { this.TotalPriceOption = new(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixLogJsonConverter : JsonConverter + { + /// + /// The format to use to serialize FormulaVersionDate + /// + public static string FormulaVersionDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize MixDate + /// + public static string MixDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixLog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option description = default; + Option formulaVersionDate = default; + Option id = default; + Option mixDate = default; + Option totalOverPoors = default; + Option totalRecalculations = default; + Option totalSkips = default; + Option totalUnderPours = default; + Option batchNumber = default; + Option brandCode = default; + Option brandId = default; + Option brandName = default; + Option categoryCode = default; + Option color = default; + Option colorDescription = default; + Option comment = default; + Option commercialProductCode = default; + Option country = default; + Option createdBy = default; + Option createdByFirstName = default; + Option createdByLastName = default; + Option deltaECalculationRepaired = default; + Option deltaECalculationSprayout = default; + Option ownColorVariantNumber = default; + Option primerProductId = default; + Option productId = default; + Option productLineCode = default; + Option productName = default; + Option selectedVersionIndex = default; + Option shopId = default; + Option someCode = default; + Option totalPrice = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "formulaVersionDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + formulaVersionDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetGuid()); + break; + case "mixDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mixDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalOverPoors": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalOverPoors = new Option(utf8JsonReader.GetInt32()); + break; + case "totalRecalculations": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalRecalculations = new Option(utf8JsonReader.GetInt32()); + break; + case "totalSkips": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalSkips = new Option(utf8JsonReader.GetInt32()); + break; + case "totalUnderPours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalUnderPours = new Option(utf8JsonReader.GetInt32()); + break; + case "batchNumber": + batchNumber = new Option(utf8JsonReader.GetString()); + break; + case "brandCode": + brandCode = new Option(utf8JsonReader.GetString()); + break; + case "brandId": + brandId = new Option(utf8JsonReader.GetString()); + break; + case "brandName": + brandName = new Option(utf8JsonReader.GetString()); + break; + case "categoryCode": + categoryCode = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "colorDescription": + colorDescription = new Option(utf8JsonReader.GetString()); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()); + break; + case "commercialProductCode": + commercialProductCode = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "createdBy": + createdBy = new Option(utf8JsonReader.GetString()); + break; + case "createdByFirstName": + createdByFirstName = new Option(utf8JsonReader.GetString()); + break; + case "createdByLastName": + createdByLastName = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationRepaired": + deltaECalculationRepaired = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationSprayout": + deltaECalculationSprayout = new Option(utf8JsonReader.GetString()); + break; + case "ownColorVariantNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ownColorVariantNumber = new Option(utf8JsonReader.GetInt32()); + break; + case "primerProductId": + primerProductId = new Option(utf8JsonReader.GetString()); + break; + case "productId": + productId = new Option(utf8JsonReader.GetString()); + break; + case "productLineCode": + productLineCode = new Option(utf8JsonReader.GetString()); + break; + case "productName": + productName = new Option(utf8JsonReader.GetString()); + break; + case "selectedVersionIndex": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selectedVersionIndex = new Option(utf8JsonReader.GetInt32()); + break; + case "shopId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopId = new Option(utf8JsonReader.GetGuid()); + break; + case "someCode": + someCode = new Option(utf8JsonReader.GetString()); + break; + case "totalPrice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalPrice = new Option((float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!description.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(description)); + + if (!formulaVersionDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(formulaVersionDate)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(id)); + + if (!mixDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(mixDate)); + + if (!totalOverPoors.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalOverPoors)); + + if (!totalRecalculations.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalRecalculations)); + + if (!totalSkips.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalSkips)); + + if (!totalUnderPours.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalUnderPours)); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class MixLog."); + + if (formulaVersionDate.IsSet && formulaVersionDate.Value == null) + throw new ArgumentNullException(nameof(formulaVersionDate), "Property is not nullable for class MixLog."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixLog."); + + if (mixDate.IsSet && mixDate.Value == null) + throw new ArgumentNullException(nameof(mixDate), "Property is not nullable for class MixLog."); + + if (totalOverPoors.IsSet && totalOverPoors.Value == null) + throw new ArgumentNullException(nameof(totalOverPoors), "Property is not nullable for class MixLog."); + + if (totalRecalculations.IsSet && totalRecalculations.Value == null) + throw new ArgumentNullException(nameof(totalRecalculations), "Property is not nullable for class MixLog."); + + if (totalSkips.IsSet && totalSkips.Value == null) + throw new ArgumentNullException(nameof(totalSkips), "Property is not nullable for class MixLog."); + + if (totalUnderPours.IsSet && totalUnderPours.Value == null) + throw new ArgumentNullException(nameof(totalUnderPours), "Property is not nullable for class MixLog."); + + if (batchNumber.IsSet && batchNumber.Value == null) + throw new ArgumentNullException(nameof(batchNumber), "Property is not nullable for class MixLog."); + + if (brandCode.IsSet && brandCode.Value == null) + throw new ArgumentNullException(nameof(brandCode), "Property is not nullable for class MixLog."); + + if (brandId.IsSet && brandId.Value == null) + throw new ArgumentNullException(nameof(brandId), "Property is not nullable for class MixLog."); + + if (brandName.IsSet && brandName.Value == null) + throw new ArgumentNullException(nameof(brandName), "Property is not nullable for class MixLog."); + + if (categoryCode.IsSet && categoryCode.Value == null) + throw new ArgumentNullException(nameof(categoryCode), "Property is not nullable for class MixLog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class MixLog."); + + if (colorDescription.IsSet && colorDescription.Value == null) + throw new ArgumentNullException(nameof(colorDescription), "Property is not nullable for class MixLog."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class MixLog."); + + if (commercialProductCode.IsSet && commercialProductCode.Value == null) + throw new ArgumentNullException(nameof(commercialProductCode), "Property is not nullable for class MixLog."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class MixLog."); + + if (createdBy.IsSet && createdBy.Value == null) + throw new ArgumentNullException(nameof(createdBy), "Property is not nullable for class MixLog."); + + if (createdByFirstName.IsSet && createdByFirstName.Value == null) + throw new ArgumentNullException(nameof(createdByFirstName), "Property is not nullable for class MixLog."); + + if (createdByLastName.IsSet && createdByLastName.Value == null) + throw new ArgumentNullException(nameof(createdByLastName), "Property is not nullable for class MixLog."); + + if (deltaECalculationRepaired.IsSet && deltaECalculationRepaired.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationRepaired), "Property is not nullable for class MixLog."); + + if (deltaECalculationSprayout.IsSet && deltaECalculationSprayout.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationSprayout), "Property is not nullable for class MixLog."); + + if (primerProductId.IsSet && primerProductId.Value == null) + throw new ArgumentNullException(nameof(primerProductId), "Property is not nullable for class MixLog."); + + if (productId.IsSet && productId.Value == null) + throw new ArgumentNullException(nameof(productId), "Property is not nullable for class MixLog."); + + if (productLineCode.IsSet && productLineCode.Value == null) + throw new ArgumentNullException(nameof(productLineCode), "Property is not nullable for class MixLog."); + + if (productName.IsSet && productName.Value == null) + throw new ArgumentNullException(nameof(productName), "Property is not nullable for class MixLog."); + + if (selectedVersionIndex.IsSet && selectedVersionIndex.Value == null) + throw new ArgumentNullException(nameof(selectedVersionIndex), "Property is not nullable for class MixLog."); + + if (shopId.IsSet && shopId.Value == null) + throw new ArgumentNullException(nameof(shopId), "Property is not nullable for class MixLog."); + + return new MixLog(description.Value, formulaVersionDate.Value.Value, id.Value.Value, mixDate.Value.Value, totalOverPoors.Value.Value, totalRecalculations.Value.Value, totalSkips.Value.Value, totalUnderPours.Value.Value, batchNumber, brandCode, brandId, brandName, categoryCode, color, colorDescription, comment, commercialProductCode, country, createdBy, createdByFirstName, createdByLastName, deltaECalculationRepaired, deltaECalculationSprayout, ownColorVariantNumber, primerProductId, productId, productLineCode, productName, selectedVersionIndex, shopId, someCode, totalPrice); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixLog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + if (mixLog.Description == null) + throw new ArgumentNullException(nameof(mixLog.Description), "Property is required for class MixLog."); + + if (mixLog.BatchNumberOption.IsSet && mixLog.BatchNumber == null) + throw new ArgumentNullException(nameof(mixLog.BatchNumber), "Property is required for class MixLog."); + + if (mixLog.BrandCodeOption.IsSet && mixLog.BrandCode == null) + throw new ArgumentNullException(nameof(mixLog.BrandCode), "Property is required for class MixLog."); + + if (mixLog.BrandIdOption.IsSet && mixLog.BrandId == null) + throw new ArgumentNullException(nameof(mixLog.BrandId), "Property is required for class MixLog."); + + if (mixLog.BrandNameOption.IsSet && mixLog.BrandName == null) + throw new ArgumentNullException(nameof(mixLog.BrandName), "Property is required for class MixLog."); + + if (mixLog.CategoryCodeOption.IsSet && mixLog.CategoryCode == null) + throw new ArgumentNullException(nameof(mixLog.CategoryCode), "Property is required for class MixLog."); + + if (mixLog.ColorOption.IsSet && mixLog.Color == null) + throw new ArgumentNullException(nameof(mixLog.Color), "Property is required for class MixLog."); + + if (mixLog.ColorDescriptionOption.IsSet && mixLog.ColorDescription == null) + throw new ArgumentNullException(nameof(mixLog.ColorDescription), "Property is required for class MixLog."); + + if (mixLog.CommentOption.IsSet && mixLog.Comment == null) + throw new ArgumentNullException(nameof(mixLog.Comment), "Property is required for class MixLog."); + + if (mixLog.CommercialProductCodeOption.IsSet && mixLog.CommercialProductCode == null) + throw new ArgumentNullException(nameof(mixLog.CommercialProductCode), "Property is required for class MixLog."); + + if (mixLog.CountryOption.IsSet && mixLog.Country == null) + throw new ArgumentNullException(nameof(mixLog.Country), "Property is required for class MixLog."); + + if (mixLog.CreatedByOption.IsSet && mixLog.CreatedBy == null) + throw new ArgumentNullException(nameof(mixLog.CreatedBy), "Property is required for class MixLog."); + + if (mixLog.CreatedByFirstNameOption.IsSet && mixLog.CreatedByFirstName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByFirstName), "Property is required for class MixLog."); + + if (mixLog.CreatedByLastNameOption.IsSet && mixLog.CreatedByLastName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByLastName), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationRepairedOption.IsSet && mixLog.DeltaECalculationRepaired == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationRepaired), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet && mixLog.DeltaECalculationSprayout == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationSprayout), "Property is required for class MixLog."); + + if (mixLog.PrimerProductIdOption.IsSet && mixLog.PrimerProductId == null) + throw new ArgumentNullException(nameof(mixLog.PrimerProductId), "Property is required for class MixLog."); + + if (mixLog.ProductIdOption.IsSet && mixLog.ProductId == null) + throw new ArgumentNullException(nameof(mixLog.ProductId), "Property is required for class MixLog."); + + if (mixLog.ProductLineCodeOption.IsSet && mixLog.ProductLineCode == null) + throw new ArgumentNullException(nameof(mixLog.ProductLineCode), "Property is required for class MixLog."); + + if (mixLog.ProductNameOption.IsSet && mixLog.ProductName == null) + throw new ArgumentNullException(nameof(mixLog.ProductName), "Property is required for class MixLog."); + + writer.WriteString("description", mixLog.Description); + + writer.WriteString("formulaVersionDate", mixLog.FormulaVersionDate.ToString(FormulaVersionDateFormat)); + + writer.WriteString("id", mixLog.Id); + + writer.WriteString("mixDate", mixLog.MixDate.ToString(MixDateFormat)); + + writer.WriteNumber("totalOverPoors", mixLog.TotalOverPoors); + + writer.WriteNumber("totalRecalculations", mixLog.TotalRecalculations); + + writer.WriteNumber("totalSkips", mixLog.TotalSkips); + + writer.WriteNumber("totalUnderPours", mixLog.TotalUnderPours); + + if (mixLog.BatchNumberOption.IsSet) + writer.WriteString("batchNumber", mixLog.BatchNumber); + + if (mixLog.BrandCodeOption.IsSet) + writer.WriteString("brandCode", mixLog.BrandCode); + + if (mixLog.BrandIdOption.IsSet) + writer.WriteString("brandId", mixLog.BrandId); + + if (mixLog.BrandNameOption.IsSet) + writer.WriteString("brandName", mixLog.BrandName); + + if (mixLog.CategoryCodeOption.IsSet) + writer.WriteString("categoryCode", mixLog.CategoryCode); + + if (mixLog.ColorOption.IsSet) + writer.WriteString("color", mixLog.Color); + + if (mixLog.ColorDescriptionOption.IsSet) + writer.WriteString("colorDescription", mixLog.ColorDescription); + + if (mixLog.CommentOption.IsSet) + writer.WriteString("comment", mixLog.Comment); + + if (mixLog.CommercialProductCodeOption.IsSet) + writer.WriteString("commercialProductCode", mixLog.CommercialProductCode); + + if (mixLog.CountryOption.IsSet) + writer.WriteString("country", mixLog.Country); + + if (mixLog.CreatedByOption.IsSet) + writer.WriteString("createdBy", mixLog.CreatedBy); + + if (mixLog.CreatedByFirstNameOption.IsSet) + writer.WriteString("createdByFirstName", mixLog.CreatedByFirstName); + + if (mixLog.CreatedByLastNameOption.IsSet) + writer.WriteString("createdByLastName", mixLog.CreatedByLastName); + + if (mixLog.DeltaECalculationRepairedOption.IsSet) + writer.WriteString("deltaECalculationRepaired", mixLog.DeltaECalculationRepaired); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet) + writer.WriteString("deltaECalculationSprayout", mixLog.DeltaECalculationSprayout); + + if (mixLog.OwnColorVariantNumberOption.IsSet) + if (mixLog.OwnColorVariantNumberOption.Value != null) + writer.WriteNumber("ownColorVariantNumber", mixLog.OwnColorVariantNumberOption.Value.Value); + else + writer.WriteNull("ownColorVariantNumber"); + + if (mixLog.PrimerProductIdOption.IsSet) + writer.WriteString("primerProductId", mixLog.PrimerProductId); + + if (mixLog.ProductIdOption.IsSet) + writer.WriteString("productId", mixLog.ProductId); + + if (mixLog.ProductLineCodeOption.IsSet) + writer.WriteString("productLineCode", mixLog.ProductLineCode); + + if (mixLog.ProductNameOption.IsSet) + writer.WriteString("productName", mixLog.ProductName); + + if (mixLog.SelectedVersionIndexOption.IsSet) + writer.WriteNumber("selectedVersionIndex", mixLog.SelectedVersionIndexOption.Value.Value); + + if (mixLog.ShopIdOption.IsSet) + writer.WriteString("shopId", mixLog.ShopIdOption.Value.Value); + + if (mixLog.SomeCodeOption.IsSet) + if (mixLog.SomeCodeOption.Value != null) + writer.WriteString("someCode", mixLog.SomeCode); + else + writer.WriteNull("someCode"); + + if (mixLog.TotalPriceOption.IsSet) + if (mixLog.TotalPriceOption.Value != null) + writer.WriteNumber("totalPrice", mixLog.TotalPriceOption.Value.Value); + else + writer.WriteNull("totalPrice"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 5effb3c63c5..ae423667629 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -236,7 +236,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -247,7 +247,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet && mixedPropertiesAndAdditionalPropertiesClass.Map == null) throw new ArgumentNullException(nameof(mixedPropertiesAndAdditionalPropertiesClass.Map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs index 6447826e7d8..f503204de20 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, model200Response, jsonSerializerOptions); + WriteProperties(writer, model200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) { if (model200Response.ClassOption.IsSet && model200Response.Class == null) throw new ArgumentNullException(nameof(model200Response.Class), "Property is required for class Model200Response."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs index 1c3b4cf30db..cac0963a201 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ModelClient.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, modelClient, jsonSerializerOptions); + WriteProperties(writer, modelClient, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) { if (modelClient.VarClientOption.IsSet && modelClient.VarClient == null) throw new ArgumentNullException(nameof(modelClient.VarClient), "Property is required for class ModelClient."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs index 083a7233e15..86bbf24f53a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, name, jsonSerializerOptions); + WriteProperties(writer, name, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,7 +271,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { if (name.PropertyOption.IsSet && name.Property == null) throw new ArgumentNullException(nameof(name.Property), "Property is required for class Name."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index cd1516104e3..d10268f2927 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) { if (notificationtestGetElementsV1ResponseMPayload.AObjVariableobject == null) throw new ArgumentNullException(nameof(notificationtestGetElementsV1ResponseMPayload.AObjVariableobject), "Property is required for class NotificationtestGetElementsV1ResponseMPayload."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs index e5aa8354137..fcafbb94744 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -395,7 +395,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableClass, jsonSerializerOptions); + WriteProperties(writer, nullableClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableClass.ArrayItemsNullableOption.IsSet && nullableClass.ArrayItemsNullable == null) throw new ArgumentNullException(nameof(nullableClass.ArrayItemsNullable), "Property is required for class NullableClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs index e4ecd87be6a..4b5f815656a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableGuidClass, jsonSerializerOptions); + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableGuidClass.UuidOption.IsSet) if (nullableGuidClass.UuidOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs index d6659599426..10061a2c228 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableShape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Triangle triangle, string shapeType) + public NullableShape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Quadrilateral quadrilateral, string shapeType) + public NullableShape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class NullableShape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); if (quadrilateral != null) - return new NullableShape(quadrilateral, shapeType.Value); + return new NullableShape(quadrilateral); if (triangle != null) - return new NullableShape(triangle, shapeType.Value); + return new NullableShape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (nullableShape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, nullableShape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } if (nullableShape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, nullableShape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, nullableShape, jsonSerializerOptions); + WriteProperties(writer, nullableShape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) { - if (nullableShape.ShapeType == null) - throw new ArgumentNullException(nameof(nullableShape.ShapeType), "Property is required for class NullableShape."); - writer.WriteString("shapeType", nullableShape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs index b54928bcca5..15c9e5cbfcb 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, numberOnly, jsonSerializerOptions); + WriteProperties(writer, numberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) { if (numberOnly.JustNumberOption.IsSet) writer.WriteNumber("JustNumber", numberOnly.JustNumberOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 8dc4e4d1b9e..b25d9e5fd87 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, objectWithDeprecatedFields, jsonSerializerOptions); + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); writer.WriteEndObject(); } @@ -237,7 +237,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) { if (objectWithDeprecatedFields.BarsOption.IsSet && objectWithDeprecatedFields.Bars == null) throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Bars), "Property is required for class ObjectWithDeprecatedFields."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs index 6e94b861b23..0f4f13f311b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OneOfString.cs @@ -32,19 +32,19 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal OneOfString(string varString) + /// + internal OneOfString(string @string) { - VarString = varString; + String = @string; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets additional properties @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, oneOfString, jsonSerializerOptions); + WriteProperties(writer, oneOfString, jsonSerializerOptions); writer.WriteEndObject(); } @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs index db011f4a4c6..a0d820562b4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -279,7 +279,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, order, jsonSerializerOptions); + WriteProperties(writer, order, jsonSerializerOptions); writer.WriteEndObject(); } @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) { if (order.CompleteOption.IsSet) writer.WriteBoolean("complete", order.CompleteOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs index c4592b634a3..daa467e228b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -199,7 +199,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, outerComposite, jsonSerializerOptions); + WriteProperties(writer, outerComposite, jsonSerializerOptions); writer.WriteEndObject(); } @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) { if (outerComposite.MyStringOption.IsSet && outerComposite.MyString == null) throw new ArgumentNullException(nameof(outerComposite.MyString), "Property is required for class OuterComposite."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs index c451e1a8991..5d1cab769fa 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ParentPet.cs @@ -32,15 +32,21 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public ParentPet(string petType) : base(petType) + public ParentPet() : base() { OnCreated(); } partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string PetType { get; } = "ParentPet"; + /// /// Returns the string presentation of the object /// @@ -79,6 +85,11 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -109,7 +120,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); - return new ParentPet(petType.Value); + return new ParentPet(); } /// @@ -121,9 +132,14 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, parentPet, jsonSerializerOptions); + WriteProperties(writer, parentPet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -134,11 +150,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { - if (parentPet.PetType == null) - throw new ArgumentNullException(nameof(parentPet.PetType), "Property is required for class ParentPet."); - writer.WriteString("pet_type", parentPet.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs index c8d55edaca6..43fb8d49cc2 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, pet, jsonSerializerOptions); + WriteProperties(writer, pet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -276,7 +276,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) { if (pet.Name == null) throw new ArgumentNullException(nameof(pet.Name), "Property is required for class Pet."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pig.cs index d3bbeb8ff32..19e395f1de4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pig.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(BasquePig basquePig, string className) + public Pig(BasquePig basquePig) { BasquePig = basquePig; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(DanishPig danishPig, string className) + public Pig(DanishPig danishPig) { DanishPig = danishPig; - ClassName = className; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public DanishPig DanishPig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Pig {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); if (basquePig != null) - return new Pig(basquePig, className.Value); + return new Pig(basquePig); if (danishPig != null) - return new Pig(danishPig, className.Value); + return new Pig(danishPig); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (pig.BasquePig != null) { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); - basquePigJsonConverter.WriteProperties(ref writer, pig.BasquePig, jsonSerializerOptions); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } if (pig.DanishPig != null) { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); - danishPigJsonConverter.WriteProperties(ref writer, pig.DanishPig, jsonSerializerOptions); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } - WriteProperties(ref writer, pig, jsonSerializerOptions); + WriteProperties(writer, pig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) { - if (pig.ClassName == null) - throw new ArgumentNullException(nameof(pig.ClassName), "Property is required for class Pig."); - writer.WriteString("className", pig.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 85e19cd25d2..30edd0b77d2 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -32,20 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(bool varBool) + /// + internal PolymorphicProperty(bool @bool) { - VarBool = varBool; + Bool = @bool; OnCreated(); } /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(string varString) + /// + internal PolymorphicProperty(string @string) { - VarString = varString; + String = @string; OnCreated(); } @@ -72,14 +72,14 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets VarBool + /// Gets or Sets Bool /// - public bool? VarBool { get; set; } + public bool? Bool { get; set; } /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets Object @@ -159,11 +159,11 @@ namespace Org.OpenAPITools.Model if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); - Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model } if (varBool != null) - return new PolymorphicProperty(varBool); + return new PolymorphicProperty(varBool.Value); if (varString != null) return new PolymorphicProperty(varString); @@ -220,7 +220,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, polymorphicProperty, jsonSerializerOptions); + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); writer.WriteEndObject(); } @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs index f3ef21718ae..3d333d7958f 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral, string quadrilateralType) + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) { SimpleQuadrilateral = simpleQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(ComplexQuadrilateral complexQuadrilateral, string quadrilateralType) + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) { ComplexQuadrilateral = complexQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public ComplexQuadrilateral ComplexQuadrilateral { get; set; } - /// - /// Gets or Sets QuadrilateralType - /// - [JsonPropertyName("quadrilateralType")] - public string QuadrilateralType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Quadrilateral {\n"); - sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); if (complexQuadrilateral != null) - return new Quadrilateral(complexQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(complexQuadrilateral); if (simpleQuadrilateral != null) - return new Quadrilateral(simpleQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(simpleQuadrilateral); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (quadrilateral.SimpleQuadrilateral != null) { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); - simpleQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } if (quadrilateral.ComplexQuadrilateral != null) { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); - complexQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, quadrilateral, jsonSerializerOptions); + WriteProperties(writer, quadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) { - if (quadrilateral.QuadrilateralType == null) - throw new ArgumentNullException(nameof(quadrilateral.QuadrilateralType), "Property is required for class Quadrilateral."); - writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 75b7e516cfc..610005a0540 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, quadrilateralInterface, jsonSerializerOptions); + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) { if (quadrilateralInterface.QuadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralInterface.QuadrilateralType), "Property is required for class QuadrilateralInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 46c7177ca57..5ef0b044807 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, readOnlyFirst, jsonSerializerOptions); + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) { if (readOnlyFirst.BarOption.IsSet && readOnlyFirst.Bar == null) throw new ArgumentNullException(nameof(readOnlyFirst.Bar), "Property is required for class ReadOnlyFirst."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs index bf168ddaecd..5e3108fbe63 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -43,17 +43,6 @@ namespace Org.OpenAPITools.Model /// requiredNotnullableStringProp /// requiredNotnullableUuid /// requiredNotnullableintegerProp - /// requiredNullableArrayOfString - /// requiredNullableBooleanProp - /// requiredNullableDateProp - /// requiredNullableDatetimeProp - /// requiredNullableEnumInteger - /// requiredNullableEnumIntegerOnly - /// requiredNullableEnumString - /// requiredNullableIntegerProp - /// requiredNullableOuterEnumDefaultValue - /// requiredNullableStringProp - /// requiredNullableUuid /// notRequiredNotnullableDateProp /// notRequiredNotnullableintegerProp /// notRequiredNullableDateProp @@ -76,8 +65,19 @@ namespace Org.OpenAPITools.Model /// notrequiredNullableOuterEnumDefaultValue /// notrequiredNullableStringProp /// notrequiredNullableUuid + /// requiredNullableArrayOfString + /// requiredNullableBooleanProp + /// requiredNullableDateProp + /// requiredNullableDatetimeProp + /// requiredNullableEnumInteger + /// requiredNullableEnumIntegerOnly + /// requiredNullableEnumString + /// requiredNullableIntegerProp + /// requiredNullableOuterEnumDefaultValue + /// requiredNullableStringProp + /// requiredNullableUuid [JsonConstructor] - public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredClassRequiredNotnullableEnumInteger requiredNotnullableEnumInteger, RequiredClassRequiredNotnullableEnumIntegerOnly requiredNotnullableEnumIntegerOnly, RequiredClassRequiredNotnullableEnumString requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredClassRequiredNullableEnumInteger? requiredNullableEnumInteger = default, RequiredClassRequiredNullableEnumIntegerOnly? requiredNullableEnumIntegerOnly = default, RequiredClassRequiredNullableEnumString? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default) + public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredClassRequiredNotnullableEnumInteger requiredNotnullableEnumInteger, RequiredClassRequiredNotnullableEnumIntegerOnly requiredNotnullableEnumIntegerOnly, RequiredClassRequiredNotnullableEnumString requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredClassRequiredNullableEnumInteger? requiredNullableEnumInteger = default, RequiredClassRequiredNullableEnumIntegerOnly? requiredNullableEnumIntegerOnly = default, RequiredClassRequiredNullableEnumString? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default) { RequiredNotNullableDateProp = requiredNotNullableDateProp; RequiredNotnullableArrayOfString = requiredNotnullableArrayOfString; @@ -90,17 +90,6 @@ namespace Org.OpenAPITools.Model RequiredNotnullableStringProp = requiredNotnullableStringProp; RequiredNotnullableUuid = requiredNotnullableUuid; RequiredNotnullableintegerProp = requiredNotnullableintegerProp; - RequiredNullableArrayOfString = requiredNullableArrayOfString; - RequiredNullableBooleanProp = requiredNullableBooleanProp; - RequiredNullableDateProp = requiredNullableDateProp; - RequiredNullableDatetimeProp = requiredNullableDatetimeProp; - RequiredNullableEnumInteger = requiredNullableEnumInteger; - RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; - RequiredNullableEnumString = requiredNullableEnumString; - RequiredNullableIntegerProp = requiredNullableIntegerProp; - RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; - RequiredNullableStringProp = requiredNullableStringProp; - RequiredNullableUuid = requiredNullableUuid; NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; NotRequiredNullableDatePropOption = notRequiredNullableDateProp; @@ -123,6 +112,17 @@ namespace Org.OpenAPITools.Model NotrequiredNullableOuterEnumDefaultValueOption = notrequiredNullableOuterEnumDefaultValue; NotrequiredNullableStringPropOption = notrequiredNullableStringProp; NotrequiredNullableUuidOption = notrequiredNullableUuid; + RequiredNullableArrayOfString = requiredNullableArrayOfString; + RequiredNullableBooleanProp = requiredNullableBooleanProp; + RequiredNullableDateProp = requiredNullableDateProp; + RequiredNullableDatetimeProp = requiredNullableDatetimeProp; + RequiredNullableEnumInteger = requiredNullableEnumInteger; + RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; + RequiredNullableEnumString = requiredNullableEnumString; + RequiredNullableIntegerProp = requiredNullableIntegerProp; + RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; + RequiredNullableStringProp = requiredNullableStringProp; + RequiredNullableUuid = requiredNullableUuid; OnCreated(); } @@ -152,30 +152,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } - /// - /// Gets or Sets RequiredNullableEnumInteger - /// - [JsonPropertyName("required_nullable_enum_integer")] - public RequiredClassRequiredNullableEnumInteger? RequiredNullableEnumInteger { get; set; } - - /// - /// Gets or Sets RequiredNullableEnumIntegerOnly - /// - [JsonPropertyName("required_nullable_enum_integer_only")] - public RequiredClassRequiredNullableEnumIntegerOnly? RequiredNullableEnumIntegerOnly { get; set; } - - /// - /// Gets or Sets RequiredNullableEnumString - /// - [JsonPropertyName("required_nullable_enum_string")] - public RequiredClassRequiredNullableEnumString? RequiredNullableEnumString { get; set; } - - /// - /// Gets or Sets RequiredNullableOuterEnumDefaultValue - /// - [JsonPropertyName("required_nullable_outerEnumDefaultValue")] - public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } - /// /// Used to track the state of NotrequiredNotnullableEnumInteger /// @@ -280,6 +256,30 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new(value); } } + /// + /// Gets or Sets RequiredNullableEnumInteger + /// + [JsonPropertyName("required_nullable_enum_integer")] + public RequiredClassRequiredNullableEnumInteger? RequiredNullableEnumInteger { get; set; } + + /// + /// Gets or Sets RequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("required_nullable_enum_integer_only")] + public RequiredClassRequiredNullableEnumIntegerOnly? RequiredNullableEnumIntegerOnly { get; set; } + + /// + /// Gets or Sets RequiredNullableEnumString + /// + [JsonPropertyName("required_nullable_enum_string")] + public RequiredClassRequiredNullableEnumString? RequiredNullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } + /// /// Gets or Sets RequiredNotNullableDateProp /// @@ -323,49 +323,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullableinteger_prop")] public int RequiredNotnullableintegerProp { get; set; } - /// - /// Gets or Sets RequiredNullableArrayOfString - /// - [JsonPropertyName("required_nullable_array_of_string")] - public List RequiredNullableArrayOfString { get; set; } - - /// - /// Gets or Sets RequiredNullableBooleanProp - /// - [JsonPropertyName("required_nullable_boolean_prop")] - public bool? RequiredNullableBooleanProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDateProp - /// - [JsonPropertyName("required_nullable_date_prop")] - public DateOnly? RequiredNullableDateProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDatetimeProp - /// - [JsonPropertyName("required_nullable_datetime_prop")] - public DateTime? RequiredNullableDatetimeProp { get; set; } - - /// - /// Gets or Sets RequiredNullableIntegerProp - /// - [JsonPropertyName("required_nullable_integer_prop")] - public int? RequiredNullableIntegerProp { get; set; } - - /// - /// Gets or Sets RequiredNullableStringProp - /// - [JsonPropertyName("required_nullable_string_prop")] - public string RequiredNullableStringProp { get; set; } - - /// - /// Gets or Sets RequiredNullableUuid - /// - /// 72f98069-206d-4f12-9f12-3d1e525a8e84 - [JsonPropertyName("required_nullable_uuid")] - public Guid? RequiredNullableUuid { get; set; } - /// /// Used to track the state of NotRequiredNotnullableDateProp /// @@ -550,6 +507,49 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_uuid")] public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new(value); } } + /// + /// Gets or Sets RequiredNullableArrayOfString + /// + [JsonPropertyName("required_nullable_array_of_string")] + public List RequiredNullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNullableBooleanProp + /// + [JsonPropertyName("required_nullable_boolean_prop")] + public bool? RequiredNullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDateProp + /// + [JsonPropertyName("required_nullable_date_prop")] + public DateOnly? RequiredNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDatetimeProp + /// + [JsonPropertyName("required_nullable_datetime_prop")] + public DateTime? RequiredNullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNullableIntegerProp + /// + [JsonPropertyName("required_nullable_integer_prop")] + public int? RequiredNullableIntegerProp { get; set; } + + /// + /// Gets or Sets RequiredNullableStringProp + /// + [JsonPropertyName("required_nullable_string_prop")] + public string RequiredNullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_nullable_uuid")] + public Guid? RequiredNullableUuid { get; set; } + /// /// Gets or Sets additional properties /// @@ -575,17 +575,6 @@ namespace Org.OpenAPITools.Model sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); - sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); - sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); - sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); - sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); - sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); - sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); - sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); - sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); - sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); - sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); - sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); @@ -608,6 +597,17 @@ namespace Org.OpenAPITools.Model sb.Append(" NotrequiredNullableOuterEnumDefaultValue: ").Append(NotrequiredNullableOuterEnumDefaultValue).Append("\n"); sb.Append(" NotrequiredNullableStringProp: ").Append(NotrequiredNullableStringProp).Append("\n"); sb.Append(" NotrequiredNullableUuid: ").Append(NotrequiredNullableUuid).Append("\n"); + sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); + sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); + sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); + sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); + sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); + sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); + sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); + sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -639,16 +639,6 @@ namespace Org.OpenAPITools.Model /// public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// - /// The format to use to serialize RequiredNullableDateProp - /// - public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize RequiredNullableDatetimeProp - /// - public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// /// The format to use to serialize NotRequiredNotnullableDateProp /// @@ -669,6 +659,16 @@ namespace Org.OpenAPITools.Model /// public static string NotrequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// + /// The format to use to serialize RequiredNullableDateProp + /// + public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNullableDatetimeProp + /// + public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// /// Deserializes json to /// @@ -697,17 +697,6 @@ namespace Org.OpenAPITools.Model Option requiredNotnullableStringProp = default; Option requiredNotnullableUuid = default; Option requiredNotnullableintegerProp = default; - Option> requiredNullableArrayOfString = default; - Option requiredNullableBooleanProp = default; - Option requiredNullableDateProp = default; - Option requiredNullableDatetimeProp = default; - Option requiredNullableEnumInteger = default; - Option requiredNullableEnumIntegerOnly = default; - Option requiredNullableEnumString = default; - Option requiredNullableIntegerProp = default; - Option requiredNullableOuterEnumDefaultValue = default; - Option requiredNullableStringProp = default; - Option requiredNullableUuid = default; Option notRequiredNotnullableDateProp = default; Option notRequiredNotnullableintegerProp = default; Option notRequiredNullableDateProp = default; @@ -730,6 +719,17 @@ namespace Org.OpenAPITools.Model Option notrequiredNullableOuterEnumDefaultValue = default; Option notrequiredNullableStringProp = default; Option notrequiredNullableUuid = default; + Option> requiredNullableArrayOfString = default; + Option requiredNullableBooleanProp = default; + Option requiredNullableDateProp = default; + Option requiredNullableDatetimeProp = default; + Option requiredNullableEnumInteger = default; + Option requiredNullableEnumIntegerOnly = default; + Option requiredNullableEnumString = default; + Option requiredNullableIntegerProp = default; + Option requiredNullableOuterEnumDefaultValue = default; + Option requiredNullableStringProp = default; + Option requiredNullableUuid = default; while (utf8JsonReader.Read()) { @@ -793,53 +793,6 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); break; - case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); - break; - case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_enum_integer": - string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumIntegerRawValue != null) - requiredNullableEnumInteger = new Option(RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(requiredNullableEnumIntegerRawValue)); - break; - case "required_nullable_enum_integer_only": - string requiredNullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumIntegerOnlyRawValue != null) - requiredNullableEnumIntegerOnly = new Option(RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(requiredNullableEnumIntegerOnlyRawValue)); - break; - case "required_nullable_enum_string": - string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumStringRawValue != null) - requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); - break; - case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); - break; - case "required_nullable_outerEnumDefaultValue": - string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); - break; - case "required_nullable_string_prop": - requiredNullableStringProp = new Option(utf8JsonReader.GetString()); - break; - case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); - break; case "not_required_notnullable_date_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -934,6 +887,53 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); break; + case "required_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_enum_integer": + string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumIntegerRawValue != null) + requiredNullableEnumInteger = new Option(RequiredClassRequiredNullableEnumIntegerValueConverter.FromStringOrDefault(requiredNullableEnumIntegerRawValue)); + break; + case "required_nullable_enum_integer_only": + string requiredNullableEnumIntegerOnlyRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumIntegerOnlyRawValue != null) + requiredNullableEnumIntegerOnly = new Option(RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.FromStringOrDefault(requiredNullableEnumIntegerOnlyRawValue)); + break; + case "required_nullable_enum_string": + string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumStringRawValue != null) + requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); + break; + case "required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "required_nullable_outerEnumDefaultValue": + string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); + break; + case "required_nullable_string_prop": + requiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_nullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + break; default: break; } @@ -1072,7 +1072,7 @@ namespace Org.OpenAPITools.Model if (notrequiredNotnullableUuid.IsSet && notrequiredNotnullableUuid.Value == null) throw new ArgumentNullException(nameof(notrequiredNotnullableUuid), "Property is not nullable for class RequiredClass."); - return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid); + return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value); } /// @@ -1086,7 +1086,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, requiredClass, jsonSerializerOptions); + WriteProperties(writer, requiredClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -1097,7 +1097,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) { if (requiredClass.RequiredNotnullableArrayOfString == null) throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); @@ -1137,81 +1137,6 @@ namespace Org.OpenAPITools.Model writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); - if (requiredClass.RequiredNullableArrayOfString != null) - { - writer.WritePropertyName("required_nullable_array_of_string"); - JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); - } - else - writer.WriteNull("required_nullable_array_of_string"); - if (requiredClass.RequiredNullableBooleanProp != null) - writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); - else - writer.WriteNull("required_nullable_boolean_prop"); - - if (requiredClass.RequiredNullableDateProp != null) - writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); - else - writer.WriteNull("required_nullable_date_prop"); - - if (requiredClass.RequiredNullableDatetimeProp != null) - writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); - else - writer.WriteNull("required_nullable_datetime_prop"); - - if (requiredClass.RequiredNullableEnumInteger == null) - writer.WriteNull("required_nullable_enum_integer"); - else - { - var requiredNullableEnumIntegerRawValue = RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumInteger.Value); - writer.WriteNumber("required_nullable_enum_integer", requiredNullableEnumIntegerRawValue); - } - - if (requiredClass.RequiredNullableEnumIntegerOnly == null) - writer.WriteNull("required_nullable_enum_integer_only"); - else - { - var requiredNullableEnumIntegerOnlyRawValue = RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value); - writer.WriteNumber("required_nullable_enum_integer_only", requiredNullableEnumIntegerOnlyRawValue); - } - - if (requiredClass.RequiredNullableEnumString == null) - writer.WriteNull("required_nullable_enum_string"); - else - { - var requiredNullableEnumStringRawValue = RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumString.Value); - if (requiredNullableEnumStringRawValue != null) - writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); - else - writer.WriteNull("required_nullable_enum_string"); - } - - if (requiredClass.RequiredNullableIntegerProp != null) - writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); - else - writer.WriteNull("required_nullable_integer_prop"); - - if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - else - { - var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); - else - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - } - - if (requiredClass.RequiredNullableStringProp != null) - writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); - else - writer.WriteNull("required_nullable_string_prop"); - - if (requiredClass.RequiredNullableUuid != null) - writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); - else - writer.WriteNull("required_nullable_uuid"); - if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); @@ -1330,6 +1255,81 @@ namespace Org.OpenAPITools.Model writer.WriteString("notrequired_nullable_uuid", requiredClass.NotrequiredNullableUuidOption.Value.Value); else writer.WriteNull("notrequired_nullable_uuid"); + + if (requiredClass.RequiredNullableArrayOfString != null) + { + writer.WritePropertyName("required_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("required_nullable_array_of_string"); + if (requiredClass.RequiredNullableBooleanProp != null) + writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); + else + writer.WriteNull("required_nullable_boolean_prop"); + + if (requiredClass.RequiredNullableDateProp != null) + writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); + else + writer.WriteNull("required_nullable_date_prop"); + + if (requiredClass.RequiredNullableDatetimeProp != null) + writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); + else + writer.WriteNull("required_nullable_datetime_prop"); + + if (requiredClass.RequiredNullableEnumInteger == null) + writer.WriteNull("required_nullable_enum_integer"); + else + { + var requiredNullableEnumIntegerRawValue = RequiredClassRequiredNullableEnumIntegerValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumInteger.Value); + writer.WriteNumber("required_nullable_enum_integer", requiredNullableEnumIntegerRawValue); + } + + if (requiredClass.RequiredNullableEnumIntegerOnly == null) + writer.WriteNull("required_nullable_enum_integer_only"); + else + { + var requiredNullableEnumIntegerOnlyRawValue = RequiredClassRequiredNullableEnumIntegerOnlyValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value); + writer.WriteNumber("required_nullable_enum_integer_only", requiredNullableEnumIntegerOnlyRawValue); + } + + if (requiredClass.RequiredNullableEnumString == null) + writer.WriteNull("required_nullable_enum_string"); + else + { + var requiredNullableEnumStringRawValue = RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClass.RequiredNullableEnumString.Value); + if (requiredNullableEnumStringRawValue != null) + writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); + else + writer.WriteNull("required_nullable_enum_string"); + } + + if (requiredClass.RequiredNullableIntegerProp != null) + writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); + else + writer.WriteNull("required_nullable_integer_prop"); + + if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + else + { + var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); + else + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + } + + if (requiredClass.RequiredNullableStringProp != null) + writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); + else + writer.WriteNull("required_nullable_string_prop"); + + if (requiredClass.RequiredNullableUuid != null) + writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); + else + writer.WriteNull("required_nullable_uuid"); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs index 5804b46eff2..30c6b4d7fe9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, varReturn, jsonSerializerOptions); + WriteProperties(writer, varReturn, jsonSerializerOptions); writer.WriteEndObject(); } @@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) { if (varReturn.Lock == null) throw new ArgumentNullException(nameof(varReturn.Lock), "Property is required for class Return."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 306c5b8f727..14e2d9ee12f 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHash.RoleOption.IsSet && rolesReportsHash.Role == null) throw new ArgumentNullException(nameof(rolesReportsHash.Role), "Property is required for class RolesReportsHash."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 763295f2497..1e19e81e55c 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHashRole.NameOption.IsSet && rolesReportsHashRole.Name == null) throw new ArgumentNullException(nameof(rolesReportsHashRole.Name), "Property is required for class RolesReportsHashRole."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 52a8e0d69c6..47081ede38e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, scaleneTriangle, jsonSerializerOptions); + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) { if (scaleneTriangle.ShapeType == null) throw new ArgumentNullException(nameof(scaleneTriangle.ShapeType), "Property is required for class ScaleneTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Shape.cs index ffd95a8fdff..d4883a363a2 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Shape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Triangle triangle, string shapeType) + public Shape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Quadrilateral quadrilateral, string shapeType) + public Shape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Shape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); if (quadrilateral != null) - return new Shape(quadrilateral, shapeType.Value); + return new Shape(quadrilateral); if (triangle != null) - return new Shape(triangle, shapeType.Value); + return new Shape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } if (shape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shape, jsonSerializerOptions); + WriteProperties(writer, shape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) { - if (shape.ShapeType == null) - throw new ArgumentNullException(nameof(shape.ShapeType), "Property is required for class Shape."); - writer.WriteString("shapeType", shape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs index 5bd364cc6a4..3027d9142ba 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, shapeInterface, jsonSerializerOptions); + WriteProperties(writer, shapeInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) { if (shapeInterface.ShapeType == null) throw new ArgumentNullException(nameof(shapeInterface.ShapeType), "Property is required for class ShapeInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d60f396c70d..2d9fb2cbb33 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Triangle triangle, string shapeType) + public ShapeOrNull(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Quadrilateral quadrilateral, string shapeType) + public ShapeOrNull(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class ShapeOrNull {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); if (quadrilateral != null) - return new ShapeOrNull(quadrilateral, shapeType.Value); + return new ShapeOrNull(quadrilateral); if (triangle != null) - return new ShapeOrNull(triangle, shapeType.Value); + return new ShapeOrNull(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shapeOrNull.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shapeOrNull.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } if (shapeOrNull.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shapeOrNull, jsonSerializerOptions); + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) { - if (shapeOrNull.ShapeType == null) - throw new ArgumentNullException(nameof(shapeOrNull.ShapeType), "Property is required for class ShapeOrNull."); - writer.WriteString("shapeType", shapeOrNull.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index a00a87e2efa..3fa8bdc1917 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, simpleQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (simpleQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(simpleQuadrilateral.QuadrilateralType), "Property is required for class SimpleQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs index e90c6487364..0cc19a946de 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, specialModelName, jsonSerializerOptions); + WriteProperties(writer, specialModelName, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) { if (specialModelName.VarSpecialModelNameOption.IsSet && specialModelName.VarSpecialModelName == null) throw new ArgumentNullException(nameof(specialModelName.VarSpecialModelName), "Property is required for class SpecialModelName."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs index 84f19a2c898..5c64df495c1 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, tag, jsonSerializerOptions); + WriteProperties(writer, tag, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) { if (tag.NameOption.IsSet && tag.Name == null) throw new ArgumentNullException(nameof(tag.Name), "Property is required for class Tag."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 73886a2eca0..c5e4293dca4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordList, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordList.ValueOption.IsSet && testCollectionEndingWithWordList.Value == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList.Value), "Property is required for class TestCollectionEndingWithWordList."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 599b515add9..798a4b835c9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet && testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index 1e3b57bfe36..e6590dd351d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) { if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet && testInlineFreeformAdditionalPropertiesRequest.SomeProperty == null) throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest.SomeProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs index 737124e080b..d31d2948c65 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Triangle.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(EquilateralTriangle equilateralTriangle, string triangleType) + public Triangle(EquilateralTriangle equilateralTriangle) { EquilateralTriangle = equilateralTriangle; - TriangleType = triangleType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(IsoscelesTriangle isoscelesTriangle, string triangleType) + public Triangle(IsoscelesTriangle isoscelesTriangle) { IsoscelesTriangle = isoscelesTriangle; - TriangleType = triangleType; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(ScaleneTriangle scaleneTriangle, string triangleType) + public Triangle(ScaleneTriangle scaleneTriangle) { ScaleneTriangle = scaleneTriangle; - TriangleType = triangleType; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public ScaleneTriangle ScaleneTriangle { get; set; } - /// - /// Gets or Sets TriangleType - /// - [JsonPropertyName("triangleType")] - public string TriangleType { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Triangle {\n"); - sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); if (equilateralTriangle != null) - return new Triangle(equilateralTriangle, triangleType.Value); + return new Triangle(equilateralTriangle); if (isoscelesTriangle != null) - return new Triangle(isoscelesTriangle, triangleType.Value); + return new Triangle(isoscelesTriangle); if (scaleneTriangle != null) - return new Triangle(scaleneTriangle, triangleType.Value); + return new Triangle(scaleneTriangle); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (triangle.EquilateralTriangle != null) { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); - equilateralTriangleJsonConverter.WriteProperties(ref writer, triangle.EquilateralTriangle, jsonSerializerOptions); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } if (triangle.IsoscelesTriangle != null) { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); - isoscelesTriangleJsonConverter.WriteProperties(ref writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } if (triangle.ScaleneTriangle != null) { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); - scaleneTriangleJsonConverter.WriteProperties(ref writer, triangle.ScaleneTriangle, jsonSerializerOptions); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } - WriteProperties(ref writer, triangle, jsonSerializerOptions); + WriteProperties(writer, triangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) { - if (triangle.TriangleType == null) - throw new ArgumentNullException(nameof(triangle.TriangleType), "Property is required for class Triangle."); - writer.WriteString("triangleType", triangle.TriangleType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs index 270c598de61..aa6d31b9190 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, triangleInterface, jsonSerializerOptions); + WriteProperties(writer, triangleInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) { if (triangleInterface.TriangleType == null) throw new ArgumentNullException(nameof(triangleInterface.TriangleType), "Property is required for class TriangleInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs index 22330c4f5a8..ea5842d39f4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, user, jsonSerializerOptions); + WriteProperties(writer, user, jsonSerializerOptions); writer.WriteEndObject(); } @@ -417,7 +417,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) { if (user.EmailOption.IsSet && user.Email == null) throw new ArgumentNullException(nameof(user.Email), "Property is required for class User."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs index b130c0fbf88..258c1713bcc 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, whale, jsonSerializerOptions); + WriteProperties(writer, whale, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) { if (whale.ClassName == null) throw new ArgumentNullException(nameof(whale.ClassName), "Property is required for class Whale."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs index 0fe5dea1ff1..5479d7346cd 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Zebra.cs @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zebra, jsonSerializerOptions); + WriteProperties(writer, zebra, jsonSerializerOptions); writer.WriteEndObject(); } @@ -183,7 +183,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) { if (zebra.ClassName == null) throw new ArgumentNullException(nameof(zebra.ClassName), "Property is required for class Zebra."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 12d12b9fddb..a8d79997472 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zeroBasedEnumClass, jsonSerializerOptions); + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) { if (zeroBasedEnumClass.ZeroBasedEnumOption.IsSet) { diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 73772d84956..a5ac63f5ad0 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/README.md index 014ef147baa..84d0c69c394 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/README.md @@ -179,7 +179,6 @@ Authentication schemes defined for the API: - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests/OpenAPIClient-generichost-manual-tests/UnitTest1.cs b/samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests/OpenAPIClient-generichost-manual-tests/UnitTest1.cs index 20513bc2f8f..eba2904f0bd 100644 --- a/samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests/OpenAPIClient-generichost-manual-tests/UnitTest1.cs +++ b/samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests/OpenAPIClient-generichost-manual-tests/UnitTest1.cs @@ -47,101 +47,147 @@ namespace OpenAPIClient_generichost_manual_tests [TestMethod] public void Apple() { - Apple apple = new("#000000", "cultivar", "origin"); - string appleJson = JsonSerializer.Serialize(apple, _jsonSerializerOptions); - Apple? apple2 = JsonSerializer.Deserialize(appleJson, _jsonSerializerOptions); - Assert.IsTrue(apple2 != null && apple.Cultivar != null && apple.Cultivar.Equals(apple2.Cultivar) && apple.Origin != null && apple.Origin.Equals(apple2.Origin)); + string expected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin"}"""; + Apple? apple = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(apple, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void Pig() { - BasquePig basquePig = new("BasquePig"); - Pig pig = new(basquePig, "BasquePig"); - string pigJson = JsonSerializer.Serialize(pig, _jsonSerializerOptions); - Pig? pig2 = JsonSerializer.Deserialize(pigJson, _jsonSerializerOptions); - Assert.IsTrue( - pig.DanishPig == null && - pig.BasquePig != null && - pig2 != null && - pig2.BasquePig != null && - pig2.DanishPig == null && - pig2.BasquePig.ClassName.Equals(pig.BasquePig.ClassName)); + string expected = """{"className":"BasquePig"}"""; + Pig? pig = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(pig, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void DanishPig() { - DanishPig danishPig = new("danishPig"); - string danishPigJson = JsonSerializer.Serialize(danishPig, _jsonSerializerOptions); - DanishPig? danishPig2 = JsonSerializer.Deserialize(danishPigJson, _jsonSerializerOptions); - Assert.IsTrue(danishPig2 != null && danishPig.ClassName.Equals(danishPig2.ClassName)); + string expected = """{"className":"DanishPig"}"""; + DanishPig? danishPig = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(danishPig, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void GmFruit() { - Apple apple = new("#000000", "cultivar", "origin"); - Banana banana = new(10); - GmFruit gmFruit = new(apple, banana, "yellow"); - string gmFruitJson = JsonSerializer.Serialize(gmFruit, _jsonSerializerOptions); - GmFruit? gmFruit2 = JsonSerializer.Deserialize(gmFruitJson, _jsonSerializerOptions); - Assert.IsTrue( - gmFruit.Apple != null && - gmFruit.Banana != null && - gmFruit2 != null && - gmFruit2.Apple != null && - gmFruit2.Banana != null && - gmFruit2.Apple.Cultivar != null && - gmFruit2.Apple.Cultivar.Equals(gmFruit.Apple.Cultivar) && - gmFruit2.Apple.Origin != null && - gmFruit2.Apple.Origin.Equals(gmFruit.Apple.Origin) && - gmFruit2.Banana.LengthCm.Equals(gmFruit.Banana.LengthCm)); + string expected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin","lengthCm":10}"""; + GmFruit? gmFruit = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(gmFruit, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); - // TODO: assert the properties from Banana and GmFruit are in additionalProperties + Banana? banana = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string bananaActual = JsonSerializer.Serialize(banana); + string bananaExpected = """{"lengthCm":10}"""; + Assert.AreEqual(bananaExpected, bananaActual); + + Apple? apple = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string appleActual = JsonSerializer.Serialize(apple); + string appleExpected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin"}"""; + Assert.AreEqual(appleExpected, appleActual); } [TestMethod] public void EquilateralTriangle() { - EquilateralTriangle equilateralTriangle = new("triangle", "equilateral"); - string equilateralTriangleJson = JsonSerializer.Serialize(equilateralTriangle, _jsonSerializerOptions); - EquilateralTriangle? equilateralTriangle2 = JsonSerializer.Deserialize(equilateralTriangleJson, _jsonSerializerOptions); - Assert.IsTrue(equilateralTriangle2 != null && equilateralTriangle.TriangleType.Equals(equilateralTriangle2.TriangleType) && equilateralTriangle.ShapeType.Equals(equilateralTriangle2.ShapeType)); + string expected = """{"shapeType":"triangle","triangleType":"equilateral"}"""; + EquilateralTriangle? triangle = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(triangle, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void Quadrilateral() { - ComplexQuadrilateral complexQuadrilateral = new("ComplexQuadrilateral", "shapeType"); - Quadrilateral quadrilateral = new(complexQuadrilateral, "ComplexQuadrilateral"); - string quadrilateralJson = JsonSerializer.Serialize(quadrilateral, _jsonSerializerOptions); - Quadrilateral? quadrilateral2 = JsonSerializer.Deserialize(quadrilateralJson, _jsonSerializerOptions); - Assert.IsTrue( - quadrilateral.ComplexQuadrilateral != null && - quadrilateral2 != null && - quadrilateral2.SimpleQuadrilateral == null && - quadrilateral2.ComplexQuadrilateral != null && - quadrilateral2.ComplexQuadrilateral.QuadrilateralType.Equals(quadrilateral.ComplexQuadrilateral.QuadrilateralType) && - quadrilateral2.ComplexQuadrilateral.ShapeType.Equals(quadrilateral.ComplexQuadrilateral.ShapeType)); + string expected = """{"quadrilateralType":"SimpleQuadrilateral","shapeType":"some quadralateral"}"""; + Quadrilateral? quadrilateral = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(quadrilateral, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); + } + + [TestMethod] + public void SimpleQuadrilateral() + { + string expected = """{"quadrilateralType":"SimpleQuadrilateral","shapeType":"some quadralateral"}"""; + SimpleQuadrilateral? simpleQuadrilateral = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string simpleQuadrilateralActual = JsonSerializer.Serialize(simpleQuadrilateral, _jsonSerializerOptions); + Assert.AreEqual(expected, simpleQuadrilateralActual); + } + + [TestMethod] + public void ComplexQuadrilateral() + { + string complexQuadrilateralExpected = """{"quadrilateralType":"ComplexQuadrilateral","shapeType":"some quadralateral"}"""; + ComplexQuadrilateral? complexQuadrilateral = JsonSerializer.Deserialize(complexQuadrilateralExpected, _jsonSerializerOptions); + string complexQuadrilateralActual = JsonSerializer.Serialize(complexQuadrilateral, _jsonSerializerOptions); + Assert.AreEqual(complexQuadrilateralExpected, complexQuadrilateralActual); } [TestMethod] public void ChildCat() { - ChildCat childCat = new("some name", Org.OpenAPITools.Model.ChildCat.PetTypeEnum.ChildCat); - string childCatJson = JsonSerializer.Serialize(childCat, _jsonSerializerOptions); - ChildCat? childCat2 = JsonSerializer.Deserialize(childCatJson, _jsonSerializerOptions); - Assert.IsTrue(childCat2 != null && childCat.PetType.Equals(childCat2.PetType) && childCat.Name != null && childCat.Name.Equals(childCat2.Name)); + string childCatExpected = """{"name":"foo","pet_type":"ChildCat"}"""; + ChildCat? childCat = JsonSerializer.Deserialize(childCatExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(childCat, _jsonSerializerOptions); + Assert.AreEqual(childCatExpected, childCatActual); } [TestMethod] public void Cat() { - Cat cat = new("cat", "black", false); // TODO: where is the address property? - string catJson = JsonSerializer.Serialize(cat, _jsonSerializerOptions); - Cat? cat2 = JsonSerializer.Deserialize(catJson, _jsonSerializerOptions); - Assert.IsTrue(cat2 != null && cat.Declawed.Equals(cat2.Declawed) && cat.ClassName.Equals(cat2.ClassName) && cat.Color != null && cat.Color.Equals(cat2.Color)); // TODO: add the address property + string catExpected = """{"className":"Cat","color":"black","declawed":true}"""; + Cat? cat = JsonSerializer.Deserialize(catExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(cat, _jsonSerializerOptions); + Assert.AreEqual(catExpected, childCatActual); + } + + [TestMethod] + public void Dog() + { + string dogExpected = """{"className":"Dog","breed":"Maltese"}"""; + Dog? dog = JsonSerializer.Deserialize(dogExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(dog, _jsonSerializerOptions); + Assert.AreEqual(dogExpected, childCatActual); + } + + [TestMethod] + public void Whale() + { + string expected = """{"className":"whale","hasBaleen":true,"hasTeeth":true}"""; + Whale? whale = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(whale, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void Mammal() + { + string expected = """{"className":"whale","hasBaleen":true,"hasTeeth":true}"""; + Mammal? mammal = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(mammal, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void ParentPet() + { + string expected = """{"pet_type":"ParentPet"}"""; + ParentPet? parentPet = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(parentPet, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void Animal() + { + string expected = """{"className":"Dog","breed":"maltese","color":"white"}"""; + Animal? animal = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + Assert.IsInstanceOfType(animal); + string result = JsonSerializer.Serialize(animal, _jsonSerializerOptions); + Assert.AreEqual(expected, result); } } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests/ManualTests.Latest.UseSourceGeneration/UnitTest1.cs b/samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests/ManualTests.Latest.UseSourceGeneration/UnitTest1.cs index f42b1a20a84..8a6a5fb3a90 100644 --- a/samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests/ManualTests.Latest.UseSourceGeneration/UnitTest1.cs +++ b/samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests/ManualTests.Latest.UseSourceGeneration/UnitTest1.cs @@ -48,114 +48,150 @@ public class UnitTest1 _jsonSerializerOptions = _host.Services.GetRequiredService().Options; } - [TestMethod] - public void Category() - { - Category category = new(1, "test"); - string categoryJson = JsonSerializer.Serialize(category, _jsonSerializerOptions); - Category? category2 = JsonSerializer.Deserialize(categoryJson, _jsonSerializerOptions); - Assert.AreEqual(category.Id, category2?.Id); - Assert.AreEqual(category.Name, category2?.Name); - } - [TestMethod] public void Apple() { - Apple apple = new("#000000", "cultivar", "origin"); - string appleJson = JsonSerializer.Serialize(apple, _jsonSerializerOptions); - Apple? apple2 = JsonSerializer.Deserialize(appleJson, _jsonSerializerOptions); - Assert.IsTrue(apple2 != null && apple.Cultivar != null && apple.Cultivar.Equals(apple2.Cultivar) && apple.Origin != null && apple.Origin.Equals(apple2.Origin)); + string expected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin"}"""; + Apple? apple = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(apple, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void Pig() { - BasquePig basquePig = new("BasquePig"); - Pig pig = new(basquePig, "BasquePig"); - string pigJson = JsonSerializer.Serialize(pig, _jsonSerializerOptions); - Pig? pig2 = JsonSerializer.Deserialize(pigJson, _jsonSerializerOptions); - Assert.IsTrue( - pig.DanishPig == null && - pig.BasquePig != null && - pig2 != null && - pig2.BasquePig != null && - pig2.DanishPig == null && - pig2.BasquePig.ClassName.Equals(pig.BasquePig.ClassName)); + string expected = """{"className":"BasquePig"}"""; + Pig? pig = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(pig, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void DanishPig() { - DanishPig danishPig = new("danishPig"); - string danishPigJson = JsonSerializer.Serialize(danishPig, _jsonSerializerOptions); - DanishPig? danishPig2 = JsonSerializer.Deserialize(danishPigJson, _jsonSerializerOptions); - Assert.IsTrue(danishPig2 != null && danishPig.ClassName.Equals(danishPig2.ClassName)); + string expected = """{"className":"DanishPig"}"""; + DanishPig? danishPig = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(danishPig, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void GmFruit() { - Apple apple = new("#000000", "cultivar", "origin"); - Banana banana = new(10); - GmFruit gmFruit = new(apple, banana, "yellow"); - string gmFruitJson = JsonSerializer.Serialize(gmFruit, _jsonSerializerOptions); - GmFruit? gmFruit2 = JsonSerializer.Deserialize(gmFruitJson, _jsonSerializerOptions); - Assert.IsTrue( - gmFruit.Apple != null && - gmFruit.Banana != null && - gmFruit2 != null && - gmFruit2.Apple != null && - gmFruit2.Banana != null && - gmFruit2.Apple.Cultivar != null && - gmFruit2.Apple.Cultivar.Equals(gmFruit.Apple.Cultivar) && - gmFruit2.Apple.Origin != null && - gmFruit2.Apple.Origin.Equals(gmFruit.Apple.Origin) && - gmFruit2.Banana.LengthCm.Equals(gmFruit.Banana.LengthCm)); + string expected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin","lengthCm":10}"""; + GmFruit? gmFruit = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(gmFruit, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); - // TODO: assert the properties from Banana and GmFruit are in additionalProperties + Banana? banana = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string bananaActual = JsonSerializer.Serialize(banana); + string bananaExpected = """{"lengthCm":10}"""; + Assert.AreEqual(bananaExpected, bananaActual); + + Apple? apple = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string appleActual = JsonSerializer.Serialize(apple); + string appleExpected = """{"color_code":"#000000","cultivar":"cultivar","origin":"origin"}"""; + Assert.AreEqual(appleExpected, appleActual); } [TestMethod] public void EquilateralTriangle() { - EquilateralTriangle equilateralTriangle = new("triangle", "equilateral"); - string equilateralTriangleJson = JsonSerializer.Serialize(equilateralTriangle, _jsonSerializerOptions); - EquilateralTriangle? equilateralTriangle2 = JsonSerializer.Deserialize(equilateralTriangleJson, _jsonSerializerOptions); - Assert.IsTrue(equilateralTriangle2 != null && equilateralTriangle.TriangleType.Equals(equilateralTriangle2.TriangleType) && equilateralTriangle.ShapeType.Equals(equilateralTriangle2.ShapeType)); + string expected = """{"shapeType":"triangle","triangleType":"equilateral"}"""; + EquilateralTriangle? triangle = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(triangle, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] public void Quadrilateral() { - ComplexQuadrilateral complexQuadrilateral = new("ComplexQuadrilateral", "shapeType"); - Quadrilateral quadrilateral = new(complexQuadrilateral, "ComplexQuadrilateral"); - string quadrilateralJson = JsonSerializer.Serialize(quadrilateral, _jsonSerializerOptions); - Quadrilateral? quadrilateral2 = JsonSerializer.Deserialize(quadrilateralJson, _jsonSerializerOptions); - Assert.IsTrue( - quadrilateral.ComplexQuadrilateral != null && - quadrilateral2 != null && - quadrilateral2.SimpleQuadrilateral == null && - quadrilateral2.ComplexQuadrilateral != null && - quadrilateral2.ComplexQuadrilateral.QuadrilateralType.Equals(quadrilateral.ComplexQuadrilateral.QuadrilateralType) && - quadrilateral2.ComplexQuadrilateral.ShapeType.Equals(quadrilateral.ComplexQuadrilateral.ShapeType)); + string expected = """{"quadrilateralType":"SimpleQuadrilateral","shapeType":"some quadralateral"}"""; + Quadrilateral? quadrilateral = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string actual = JsonSerializer.Serialize(quadrilateral, _jsonSerializerOptions); + Assert.AreEqual(expected, actual); } [TestMethod] - public void ChildCatTest() + public void SimpleQuadrilateral() { - ChildCat childCat = new("some name", ChildCat.PetTypeEnum.ChildCat); - string childCatJson = JsonSerializer.Serialize(childCat, _jsonSerializerOptions); - ChildCat? childCat2 = JsonSerializer.Deserialize(childCatJson, _jsonSerializerOptions); - Assert.IsTrue(childCat2 != null && childCat.PetType.Equals(childCat2.PetType) && childCat.Name != null && childCat.Name.Equals(childCat2.Name)); + string expected = """{"quadrilateralType":"SimpleQuadrilateral","shapeType":"some quadralateral"}"""; + SimpleQuadrilateral? simpleQuadrilateral = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string simpleQuadrilateralActual = JsonSerializer.Serialize(simpleQuadrilateral, _jsonSerializerOptions); + Assert.AreEqual(expected, simpleQuadrilateralActual); + } + + [TestMethod] + public void ComplexQuadrilateral() + { + string complexQuadrilateralExpected = """{"quadrilateralType":"ComplexQuadrilateral","shapeType":"some quadralateral"}"""; + ComplexQuadrilateral? complexQuadrilateral = JsonSerializer.Deserialize(complexQuadrilateralExpected, _jsonSerializerOptions); + string complexQuadrilateralActual = JsonSerializer.Serialize(complexQuadrilateral, _jsonSerializerOptions); + Assert.AreEqual(complexQuadrilateralExpected, complexQuadrilateralActual); + } + + [TestMethod] + public void ChildCat() + { + string childCatExpected = """{"name":"foo","pet_type":"ChildCat"}"""; + ChildCat? childCat = JsonSerializer.Deserialize(childCatExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(childCat, _jsonSerializerOptions); + Assert.AreEqual(childCatExpected, childCatActual); } [TestMethod] public void Cat() { - Cat cat = new("cat", "black", false); // TODO: where is the address property? - string catJson = JsonSerializer.Serialize(cat, _jsonSerializerOptions); - Cat? cat2 = JsonSerializer.Deserialize(catJson, _jsonSerializerOptions); - Assert.IsTrue(cat2 != null && cat.Declawed.Equals(cat2.Declawed) && cat.ClassName.Equals(cat2.ClassName) && cat.Color != null && cat.Color.Equals(cat2.Color)); // TODO: add the address property + string catExpected = """{"className":"Cat","color":"black","declawed":true}"""; + Cat? cat = JsonSerializer.Deserialize(catExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(cat, _jsonSerializerOptions); + Assert.AreEqual(catExpected, childCatActual); + } + + [TestMethod] + public void Dog() + { + string dogExpected = """{"className":"Dog","breed":"Maltese"}"""; + Dog? dog = JsonSerializer.Deserialize(dogExpected, _jsonSerializerOptions); + string childCatActual = JsonSerializer.Serialize(dog, _jsonSerializerOptions); + Assert.AreEqual(dogExpected, childCatActual); + } + + [TestMethod] + public void Whale() + { + string expected = """{"className":"whale","hasBaleen":true,"hasTeeth":true}"""; + Whale? whale = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(whale, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void Mammal() + { + string expected = """{"className":"whale","hasBaleen":true,"hasTeeth":true}"""; + Mammal? mammal = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(mammal, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void ParentPet() + { + string expected = """{"pet_type":"ParentPet"}"""; + ParentPet? parentPet = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + string result = JsonSerializer.Serialize(parentPet, _jsonSerializerOptions); + Assert.AreEqual(expected, result); + } + + [TestMethod] + public void Animal() + { + string expected = """{"className":"Dog","breed":"maltese","color":"white"}"""; + Animal? animal = JsonSerializer.Deserialize(expected, _jsonSerializerOptions); + Assert.IsInstanceOfType(animal); + string result = JsonSerializer.Serialize(animal, _jsonSerializerOptions); + Assert.AreEqual(expected, result); } } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES index 0c900b9c260..a94acc41bff 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/.openapi-generator/FILES @@ -54,6 +54,7 @@ docs/models/List.md docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md +docs/models/MixLog.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md docs/models/Model200Response.md docs/models/ModelClient.md @@ -184,6 +185,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**FormulaVersionDate** | **DateTime** | | +**Id** | **Guid** | | +**MixDate** | **DateTime** | | +**TotalOverPoors** | **int** | | +**TotalRecalculations** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] +**ShopId** | **Guid** | | [optional] +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**TotalPrice** | **float** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/RequiredClass.md index bbdf6d8407b..990aeb5de3d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/RequiredClass.md +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/RequiredClass.md @@ -15,17 +15,6 @@ Name | Type | Description | Notes **RequiredNotnullableStringProp** | **string** | | **RequiredNotnullableUuid** | **Guid** | | **RequiredNotnullableintegerProp** | **int** | | -**RequiredNullableArrayOfString** | **List<string>** | | -**RequiredNullableBooleanProp** | **bool** | | -**RequiredNullableDateProp** | **DateOnly** | | -**RequiredNullableDatetimeProp** | **DateTime** | | -**RequiredNullableEnumInteger** | **int** | | -**RequiredNullableEnumIntegerOnly** | **int** | | -**RequiredNullableEnumString** | **string** | | -**RequiredNullableIntegerProp** | **int** | | -**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | -**RequiredNullableStringProp** | **string** | | -**RequiredNullableUuid** | **Guid** | | **NotRequiredNotnullableDateProp** | **DateOnly** | | [optional] **NotRequiredNotnullableintegerProp** | **int** | | [optional] **NotRequiredNullableDateProp** | **DateOnly** | | [optional] @@ -48,6 +37,17 @@ Name | Type | Description | Notes **NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] **NotrequiredNullableStringProp** | **string** | | [optional] **NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateOnly** | | +**RequiredNullableDatetimeProp** | **DateTime** | | +**RequiredNullableEnumInteger** | **int** | | +**RequiredNullableEnumIntegerOnly** | **int** | | +**RequiredNullableEnumString** | **string** | | +**RequiredNullableIntegerProp** | **int** | | +**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNullableStringProp** | **string** | | +**RequiredNullableUuid** | **Guid** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 19d536890f1..fe8397be218 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -121,6 +121,16 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default!; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + /// /// Test TestBodyWithFileSchema /// @@ -257,5 +267,15 @@ namespace Org.OpenAPITools.Test.Api Client.Option notRequiredNullable = default!; await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); } + + /// + /// Test TestStringMapReference + /// + [Fact (Skip = "not implemented")] + public async Task TestStringMapReferenceAsyncTest() + { + Dictionary requestBody = default!; + await _instance.TestStringMapReferenceAsync(requestBody); + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index d29d1dfd846..a866bfbe242 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index 210069f6ad3..55086a7cf24 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 164baa8862b..b658f317f1c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarByte' + /// Test the property 'Byte' /// [Fact] - public void VarByteTest() + public void ByteTest() { - // TODO unit test for the property 'VarByte' + // TODO unit test for the property 'Byte' } /// @@ -108,30 +108,30 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarDecimal' + /// Test the property 'Decimal' /// [Fact] - public void VarDecimalTest() + public void DecimalTest() { - // TODO unit test for the property 'VarDecimal' + // TODO unit test for the property 'Decimal' } /// - /// Test the property 'VarDouble' + /// Test the property 'Double' /// [Fact] - public void VarDoubleTest() + public void DoubleTest() { - // TODO unit test for the property 'VarDouble' + // TODO unit test for the property 'Double' } /// - /// Test the property 'VarFloat' + /// Test the property 'Float' /// [Fact] - public void VarFloatTest() + public void FloatTest() { - // TODO unit test for the property 'VarFloat' + // TODO unit test for the property 'Float' } /// @@ -189,12 +189,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs deleted file mode 100644 index e27750c9c1f..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedEnumType - //private MixedEnumType instance; - - public MixedEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedEnumType - //instance = new MixedEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedEnumType - /// - [Fact] - public void MixedEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs deleted file mode 100644 index 1513de7a320..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedNullableEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedNullableEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedNullableEnumType - //private MixedNullableEnumType instance; - - public MixedNullableEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedNullableEnumType - //instance = new MixedNullableEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedNullableEnumType - /// - [Fact] - public void MixedNullableEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedNullableEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs deleted file mode 100644 index 2ed728a41b8..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedSubId - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedSubIdTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedSubId - //private MixedSubId instance; - - public MixedSubIdTests() - { - // TODO uncomment below to create an instance of MixedSubId - //instance = new MixedSubId(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedSubId - /// - [Fact] - public void MixedSubIdInstanceTest() - { - // TODO uncomment below to test "IsType" MixedSubId - //Assert.IsType(instance); - } - - /// - /// Test the property 'Id' - /// - [Fact] - public void IdTest() - { - // TODO unit test for the property 'Id' - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index fda0e5b588c..3b5e94c5f8f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs index e5186391592..d1da68281ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'RequiredNotnullableintegerProp' } - /// - /// Test the property 'RequiredNullableArrayOfString' - /// - [Fact] - public void RequiredNullableArrayOfStringTest() - { - // TODO unit test for the property 'RequiredNullableArrayOfString' - } - - /// - /// Test the property 'RequiredNullableBooleanProp' - /// - [Fact] - public void RequiredNullableBooleanPropTest() - { - // TODO unit test for the property 'RequiredNullableBooleanProp' - } - - /// - /// Test the property 'RequiredNullableDateProp' - /// - [Fact] - public void RequiredNullableDatePropTest() - { - // TODO unit test for the property 'RequiredNullableDateProp' - } - - /// - /// Test the property 'RequiredNullableDatetimeProp' - /// - [Fact] - public void RequiredNullableDatetimePropTest() - { - // TODO unit test for the property 'RequiredNullableDatetimeProp' - } - - /// - /// Test the property 'RequiredNullableEnumInteger' - /// - [Fact] - public void RequiredNullableEnumIntegerTest() - { - // TODO unit test for the property 'RequiredNullableEnumInteger' - } - - /// - /// Test the property 'RequiredNullableEnumIntegerOnly' - /// - [Fact] - public void RequiredNullableEnumIntegerOnlyTest() - { - // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' - } - - /// - /// Test the property 'RequiredNullableEnumString' - /// - [Fact] - public void RequiredNullableEnumStringTest() - { - // TODO unit test for the property 'RequiredNullableEnumString' - } - - /// - /// Test the property 'RequiredNullableIntegerProp' - /// - [Fact] - public void RequiredNullableIntegerPropTest() - { - // TODO unit test for the property 'RequiredNullableIntegerProp' - } - - /// - /// Test the property 'RequiredNullableOuterEnumDefaultValue' - /// - [Fact] - public void RequiredNullableOuterEnumDefaultValueTest() - { - // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' - } - - /// - /// Test the property 'RequiredNullableStringProp' - /// - [Fact] - public void RequiredNullableStringPropTest() - { - // TODO unit test for the property 'RequiredNullableStringProp' - } - - /// - /// Test the property 'RequiredNullableUuid' - /// - [Fact] - public void RequiredNullableUuidTest() - { - // TODO unit test for the property 'RequiredNullableUuid' - } - /// /// Test the property 'NotRequiredNotnullableDateProp' /// @@ -448,5 +349,104 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'NotrequiredNullableUuid' } + + /// + /// Test the property 'RequiredNullableArrayOfString' + /// + [Fact] + public void RequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNullableArrayOfString' + } + + /// + /// Test the property 'RequiredNullableBooleanProp' + /// + [Fact] + public void RequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNullableBooleanProp' + } + + /// + /// Test the property 'RequiredNullableDateProp' + /// + [Fact] + public void RequiredNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNullableDateProp' + } + + /// + /// Test the property 'RequiredNullableDatetimeProp' + /// + [Fact] + public void RequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNullableEnumInteger' + /// + [Fact] + public void RequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNullableEnumInteger' + } + + /// + /// Test the property 'RequiredNullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNullableEnumString' + /// + [Fact] + public void RequiredNullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNullableEnumString' + } + + /// + /// Test the property 'RequiredNullableIntegerProp' + /// + [Fact] + public void RequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'RequiredNullableIntegerProp' + } + + /// + /// Test the property 'RequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNullableStringProp' + /// + [Fact] + public void RequiredNullableStringPropTest() + { + // TODO unit test for the property 'RequiredNullableStringProp' + } + + /// + /// Test the property 'RequiredNullableUuid' + /// + [Fact] + public void RequiredNullableUuidTest() + { + // TODO unit test for the property 'RequiredNullableUuid' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 18474c10e19..bbea79ed951 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model //Assert.IsType(instance); } + /// + /// Test the property 'Lock' + /// + [Fact] + public void LockTest() + { + // TODO unit test for the property 'Lock' + } + + /// + /// Test the property 'Abstract' + /// + [Fact] + public void AbstractTest() + { + // TODO unit test for the property 'Abstract' + } + /// /// Test the property 'VarReturn' /// @@ -61,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'VarReturn' } + + /// + /// Test the property 'Unsafe' + /// + [Fact] + public void UnsafeTest() + { + // TODO unit test for the property 'Unsafe' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/ClientUtils.cs index 7c68fd649ff..0176499b291 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -206,12 +206,6 @@ namespace Org.OpenAPITools.Client return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); - if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) - return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) - return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) - return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) @@ -224,6 +218,12 @@ namespace Org.OpenAPITools.Client return RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.NotrequiredNullableEnumStringEnum requiredClassNotrequiredNullableEnumStringEnum) return RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClassNotrequiredNullableEnumStringEnum); + if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) + return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) + return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is Zebra.TypeEnum zebraTypeEnum) return Zebra.TypeEnumToJsonValue(zebraTypeEnum); if (obj is ZeroBasedEnum zeroBasedEnum) @@ -361,6 +361,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/HostConfiguration.cs index 6ab2ad09bbd..d96b864d782 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -88,6 +88,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs index 4912b6b209d..4ad0fb2c59a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activity, jsonSerializerOptions); + WriteProperties(writer, activity, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) { if (activity.ActivityOutputsOption.IsSet && activity.ActivityOutputs == null) throw new ArgumentNullException(nameof(activity.ActivityOutputs), "Property is required for class Activity."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index f0ae7cbe745..61ce42cec0f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activityOutputElementRepresentation, jsonSerializerOptions); + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) { if (activityOutputElementRepresentation.Prop1Option.IsSet && activityOutputElementRepresentation.Prop1 == null) throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop1), "Property is required for class ActivityOutputElementRepresentation."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 9a1e7089422..7e193b97f89 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -320,7 +320,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, additionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -331,7 +331,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (additionalPropertiesClass.EmptyMapOption.IsSet && additionalPropertiesClass.EmptyMap == null) throw new ArgumentNullException(nameof(additionalPropertiesClass.EmptyMap), "Property is required for class AdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Animal.cs index 2a09079e539..b6321f8a5fd 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Animal.cs @@ -34,12 +34,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, Option color = default) + public Animal(Option color = default) { - ClassName = className; ColorOption = color; OnCreated(); } @@ -47,10 +45,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets ClassName + /// The discriminator /// - [JsonPropertyName("className")] - public string ClassName { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; /// /// Used to track the state of Color @@ -79,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); @@ -132,6 +130,14 @@ namespace Org.OpenAPITools.Model Option className = default; Option color = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "className"); + + if (discriminator != null && discriminator.Equals("Cat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Dog")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -168,7 +174,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); - return new Animal(className.Value!, color); + return new Animal(color); } /// @@ -180,9 +186,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { + if (animal is Cat cat){ + JsonSerializer.Serialize(writer, cat, jsonSerializerOptions); + return; + } + + if (animal is Dog dog){ + JsonSerializer.Serialize(writer, dog, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, animal, jsonSerializerOptions); + WriteProperties(writer, animal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -193,11 +209,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { - if (animal.ClassName == null) - throw new ArgumentNullException(nameof(animal.ClassName), "Property is required for class Animal."); - if (animal.ColorOption.IsSet && animal.Color == null) throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs index 1b32fc13a9a..6224f2e1d3b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -200,7 +200,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apiResponse, jsonSerializerOptions); + WriteProperties(writer, apiResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -211,7 +211,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) { if (apiResponse.MessageOption.IsSet && apiResponse.Message == null) throw new ArgumentNullException(nameof(apiResponse.Message), "Property is required for class ApiResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Apple.cs index da8939681a9..407c1858d9a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Apple.cs @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.ColorCodeOption.IsSet && apple.ColorCode == null) throw new ArgumentNullException(nameof(apple.ColorCode), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs index e58d2fdbbff..422ed7a6308 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, appleReq, jsonSerializerOptions); + WriteProperties(writer, appleReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) { if (appleReq.Cultivar == null) throw new ArgumentNullException(nameof(appleReq.Cultivar), "Property is required for class AppleReq."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index afefccd4f4d..cf54e27c98e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet && arrayOfArrayOfNumberOnly.ArrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfArrayOfNumberOnly.ArrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ebd297aee9d..f8311fd47da 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfNumberOnly.ArrayNumberOption.IsSet && arrayOfNumberOnly.ArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfNumberOnly.ArrayNumber), "Property is required for class ArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs index 2a03034765c..10b89278cf4 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -202,7 +202,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayTest, jsonSerializerOptions); + WriteProperties(writer, arrayTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) { if (arrayTest.ArrayArrayOfIntegerOption.IsSet && arrayTest.ArrayArrayOfInteger == null) throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfInteger), "Property is required for class ArrayTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs index cc7df0f17db..1b9d4ad4b6d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.LengthCmOption.IsSet) writer.WriteNumber("lengthCm", banana.LengthCmOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs index 5c40df412a4..48f8d06506d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, bananaReq, jsonSerializerOptions); + WriteProperties(writer, bananaReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) { writer.WriteNumber("lengthCm", bananaReq.LengthCm); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BasquePig.cs index 6388a29478f..f523f75bffc 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BasquePig.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, basquePig, jsonSerializerOptions); + WriteProperties(writer, basquePig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) { if (basquePig.ClassName == null) throw new ArgumentNullException(nameof(basquePig.ClassName), "Property is required for class BasquePig."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Capitalization.cs index ed19ba8d748..0209e0ec34f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Capitalization.cs @@ -269,7 +269,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, capitalization, jsonSerializerOptions); + WriteProperties(writer, capitalization, jsonSerializerOptions); writer.WriteEndObject(); } @@ -280,7 +280,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) { if (capitalization.ATT_NAMEOption.IsSet && capitalization.ATT_NAME == null) throw new ArgumentNullException(nameof(capitalization.ATT_NAME), "Property is required for class Capitalization."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs index 4524364277c..0a184e3a55e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs @@ -34,11 +34,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") /// declawed [JsonConstructor] - public Cat(string className, Option color = default, Option declawed = default) : base(className, color) + public Cat(Option color = default, Option declawed = default) : base(color) { DeclawedOption = declawed; OnCreated(); @@ -46,6 +45,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Cat"; + /// /// Used to track the state of Declawed /// @@ -143,7 +149,7 @@ namespace Org.OpenAPITools.Model if (declawed.IsSet && declawed.Value == null) throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); - return new Cat(className.Value!, color, declawed); + return new Cat(color, declawed); } /// @@ -157,7 +163,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, cat, jsonSerializerOptions); + WriteProperties(writer, cat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -168,11 +174,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) { - if (cat.ClassName == null) - throw new ArgumentNullException(nameof(cat.ClassName), "Property is required for class Cat."); - if (cat.ColorOption.IsSet && cat.Color == null) throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs index 5f73a309fb2..4e71363b8e6 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, category, jsonSerializerOptions); + WriteProperties(writer, category, jsonSerializerOptions); writer.WriteEndObject(); } @@ -184,7 +184,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) { if (category.Name == null) throw new ArgumentNullException(nameof(category.Name), "Property is required for class Category."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ChildCat.cs index fdcd705495b..0c88f352be5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ChildCat.cs @@ -35,12 +35,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// name - /// petType (default to PetTypeEnum.ChildCat) [JsonConstructor] - public ChildCat(Option name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType)) + public ChildCat(Option name = default) : base() { NameOption = name; - PetType = petType; OnCreated(); } @@ -98,12 +96,6 @@ namespace Org.OpenAPITools.Model throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Gets or Sets PetType - /// - [JsonPropertyName("pet_type")] - public new PetTypeEnum PetType { get; set; } - /// /// Used to track the state of Name /// @@ -117,6 +109,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("name")] public string? Name { get { return this.NameOption; } set { this.NameOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new PetTypeEnum PetType { get; } = (PetTypeEnum)Enum.Parse(typeof(PetTypeEnum), "ChildCat"); + /// /// Returns the string presentation of the object /// @@ -127,7 +126,6 @@ namespace Org.OpenAPITools.Model sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -196,7 +194,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); - return new ChildCat(name, petType.Value!.Value!); + return new ChildCat(name); } /// @@ -210,7 +208,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, childCat, jsonSerializerOptions); + WriteProperties(writer, childCat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -221,7 +219,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) { if (childCat.NameOption.IsSet && childCat.Name == null) throw new ArgumentNullException(nameof(childCat.Name), "Property is required for class ChildCat."); @@ -229,8 +227,7 @@ namespace Org.OpenAPITools.Model if (childCat.NameOption.IsSet) writer.WriteString("name", childCat.Name); - var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType); - writer.WriteString("pet_type", petTypeRawValue); + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ClassModel.cs index 74c96842c0a..41acdb363b3 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ClassModel.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, classModel, jsonSerializerOptions); + WriteProperties(writer, classModel, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) { if (classModel.ClassOption.IsSet && classModel.Class == null) throw new ArgumentNullException(nameof(classModel.Class), "Property is required for class ClassModel."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 6e9034b20b2..629d2072a7c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, complexQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (complexQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(complexQuadrilateral.QuadrilateralType), "Property is required for class ComplexQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DanishPig.cs index cb41bcddcd6..a3c590d56ce 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DanishPig.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, danishPig, jsonSerializerOptions); + WriteProperties(writer, danishPig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) { if (danishPig.ClassName == null) throw new ArgumentNullException(nameof(danishPig.ClassName), "Property is required for class DanishPig."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 951238cee27..f28b51344de 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dateOnlyClass, jsonSerializerOptions); + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) { if (dateOnlyClass.DateOnlyPropertyOption.IsSet) writer.WriteString("dateOnlyProperty", dateOnlyClass.DateOnlyPropertyOption.Value!.Value.ToString(DateOnlyPropertyFormat)); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 01fbd05864c..33b840488f4 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, deprecatedObject, jsonSerializerOptions); + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) { if (deprecatedObject.NameOption.IsSet && deprecatedObject.Name == null) throw new ArgumentNullException(nameof(deprecatedObject.Name), "Property is required for class DeprecatedObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Dog.cs index 4367b8d84be..82c15b68b72 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Dog.cs @@ -34,11 +34,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// breed /// color (default to "red") [JsonConstructor] - public Dog(string className, Option breed = default, Option color = default) : base(className, color) + public Dog(Option breed = default, Option color = default) : base(color) { BreedOption = breed; OnCreated(); @@ -46,6 +45,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Dog"; + /// /// Used to track the state of Breed /// @@ -142,7 +148,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); - return new Dog(className.Value!, breed, color); + return new Dog(breed, color); } /// @@ -156,7 +162,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dog, jsonSerializerOptions); + WriteProperties(writer, dog, jsonSerializerOptions); writer.WriteEndObject(); } @@ -167,11 +173,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) { - if (dog.ClassName == null) - throw new ArgumentNullException(nameof(dog.ClassName), "Property is required for class Dog."); - if (dog.BreedOption.IsSet && dog.Breed == null) throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs index e388e542958..768e72260b5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs @@ -220,7 +220,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, drawing, jsonSerializerOptions); + WriteProperties(writer, drawing, jsonSerializerOptions); writer.WriteEndObject(); } @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) { if (drawing.MainShapeOption.IsSet && drawing.MainShape == null) throw new ArgumentNullException(nameof(drawing.MainShape), "Property is required for class Drawing."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs index 4b4caf55849..f5dd6f17edf 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -311,7 +311,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumArrays, jsonSerializerOptions); + WriteProperties(writer, enumArrays, jsonSerializerOptions); writer.WriteEndObject(); } @@ -322,7 +322,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) { if (enumArrays.ArrayEnumOption.IsSet && enumArrays.ArrayEnum == null) throw new ArgumentNullException(nameof(enumArrays.ArrayEnum), "Property is required for class EnumArrays."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs index 4cea89ad285..043c5900459 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs @@ -829,7 +829,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumTest, jsonSerializerOptions); + WriteProperties(writer, enumTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -840,7 +840,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) { var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); writer.WriteString("enum_string_required", enumStringRequiredRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 67be73e69d8..15e0e9658b5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, equilateralTriangle, jsonSerializerOptions); + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) { if (equilateralTriangle.ShapeType == null) throw new ArgumentNullException(nameof(equilateralTriangle.ShapeType), "Property is required for class EquilateralTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/File.cs index e80532f6ca5..83a46bd772f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/File.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, file, jsonSerializerOptions); + WriteProperties(writer, file, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) { if (file.SourceURIOption.IsSet && file.SourceURI == null) throw new ArgumentNullException(nameof(file.SourceURI), "Property is required for class File."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 05d6817a863..1aacce8091e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fileSchemaTestClass, jsonSerializerOptions); + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) { if (fileSchemaTestClass.FileOption.IsSet && fileSchemaTestClass.File == null) throw new ArgumentNullException(nameof(fileSchemaTestClass.File), "Property is required for class FileSchemaTestClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Foo.cs index 2a4d7b8ea54..ca885a9ae07 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Foo.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, foo, jsonSerializerOptions); + WriteProperties(writer, foo, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) { if (foo.BarOption.IsSet && foo.Bar == null) throw new ArgumentNullException(nameof(foo.Bar), "Property is required for class Foo."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 1034e678d00..1eb9f5b611c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fooGetDefaultResponse, jsonSerializerOptions); + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) { if (fooGetDefaultResponse.StringOption.IsSet && fooGetDefaultResponse.String == null) throw new ArgumentNullException(nameof(fooGetDefaultResponse.String), "Property is required for class FooGetDefaultResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index a36dbd28b87..03a96c36410 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -705,7 +705,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, formatTest, jsonSerializerOptions); + WriteProperties(writer, formatTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -716,7 +716,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) { if (formatTest.Byte == null) throw new ArgumentNullException(nameof(formatTest.Byte), "Property is required for class FormatTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Fruit.cs index 11be0a303ff..6f71ce3a1e2 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Fruit.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -208,7 +208,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FruitReq.cs index b8b8587d4bf..30390ff4efa 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FruitReq.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruitReq, jsonSerializerOptions); + WriteProperties(writer, fruitReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GmFruit.cs index 358462ae67e..ff9c67c07d8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GmFruit.cs @@ -205,16 +205,16 @@ namespace Org.OpenAPITools.Model if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, gmFruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, gmFruit.AppleOption.Value, jsonSerializerOptions); } if (gmFruit.BananaOption.IsSet && gmFruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, gmFruit, jsonSerializerOptions); + WriteProperties(writer, gmFruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -225,7 +225,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) { if (gmFruit.ColorOption.IsSet && gmFruit.Color == null) throw new ArgumentNullException(nameof(gmFruit.Color), "Property is required for class GmFruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index a0068cc6781..d92add7536e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -34,21 +34,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public GrandparentAnimal(string petType) + public GrandparentAnimal() { - PetType = petType; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public string PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; /// /// Gets or Sets additional properties @@ -64,7 +63,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -115,6 +113,14 @@ namespace Org.OpenAPITools.Model Option petType = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("ParentPet")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -145,7 +151,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); - return new GrandparentAnimal(petType.Value!); + return new GrandparentAnimal(); } /// @@ -157,9 +163,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { + if (grandparentAnimal is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + if (grandparentAnimal is ParentPet parentPet){ + JsonSerializer.Serialize(writer, parentPet, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, grandparentAnimal, jsonSerializerOptions); + WriteProperties(writer, grandparentAnimal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -170,11 +186,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { - if (grandparentAnimal.PetType == null) - throw new ArgumentNullException(nameof(grandparentAnimal.PetType), "Property is required for class GrandparentAnimal."); - writer.WriteString("pet_type", grandparentAnimal.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 6be2aaf2318..4d44dedfd4a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -217,7 +217,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, hasOnlyReadOnly, jsonSerializerOptions); + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) { if (hasOnlyReadOnly.BarOption.IsSet && hasOnlyReadOnly.Bar == null) throw new ArgumentNullException(nameof(hasOnlyReadOnly.Bar), "Property is required for class HasOnlyReadOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 4918784fef5..aeeb1a06d61 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, healthCheckResult, jsonSerializerOptions); + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) { if (healthCheckResult.NullableMessageOption.IsSet) if (healthCheckResult.NullableMessageOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 378561b5e32..d32a7e6d99b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, isoscelesTriangle, jsonSerializerOptions); + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) { if (isoscelesTriangle.ShapeType == null) throw new ArgumentNullException(nameof(isoscelesTriangle.ShapeType), "Property is required for class IsoscelesTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/List.cs index 64ac2f96292..da1f349c9bd 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/List.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, list, jsonSerializerOptions); + WriteProperties(writer, list, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) { if (list.Var123ListOption.IsSet && list.Var123List == null) throw new ArgumentNullException(nameof(list.Var123List), "Property is required for class List."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 34ce30c99fc..64a2eb499d1 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, literalStringClass, jsonSerializerOptions); + WriteProperties(writer, literalStringClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) { if (literalStringClass.EscapedLiteralStringOption.IsSet && literalStringClass.EscapedLiteralString == null) throw new ArgumentNullException(nameof(literalStringClass.EscapedLiteralString), "Property is required for class LiteralStringClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Mammal.cs index 5b6c5f2e58e..f80ef9bd3eb 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Mammal.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Whale whale, string className) + public Mammal(Whale whale) { Whale = whale; - ClassName = className; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Zebra zebra, string className) + public Mammal(Zebra zebra) { Zebra = zebra; - ClassName = className; OnCreated(); } @@ -59,11 +55,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Pig pig, string className) + public Mammal(Pig pig) { Pig = pig; - ClassName = className; OnCreated(); } @@ -84,12 +78,6 @@ namespace Org.OpenAPITools.Model /// public Pig? Pig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -104,7 +92,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Mammal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -225,13 +212,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); if (pig != null) - return new Mammal(pig, className.Value!); + return new Mammal(pig); if (whale != null) - return new Mammal(whale, className.Value!); + return new Mammal(whale); if (zebra != null) - return new Mammal(zebra, className.Value!); + return new Mammal(zebra); throw new JsonException(); } @@ -249,20 +236,20 @@ namespace Org.OpenAPITools.Model if (mammal.Whale != null) { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); - whaleJsonConverter.WriteProperties(ref writer, mammal.Whale, jsonSerializerOptions); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } if (mammal.Zebra != null) { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); - zebraJsonConverter.WriteProperties(ref writer, mammal.Zebra, jsonSerializerOptions); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } if (mammal.Pig != null) { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); - pigJsonConverter.WriteProperties(ref writer, mammal.Pig, jsonSerializerOptions); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } - WriteProperties(ref writer, mammal, jsonSerializerOptions); + WriteProperties(writer, mammal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -273,12 +260,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) { - if (mammal.ClassName == null) - throw new ArgumentNullException(nameof(mammal.ClassName), "Property is required for class Mammal."); - writer.WriteString("className", mammal.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs index bcde97b6534..fdb5cd9a373 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs @@ -292,7 +292,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mapTest, jsonSerializerOptions); + WriteProperties(writer, mapTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -303,7 +303,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) { if (mapTest.DirectMapOption.IsSet && mapTest.DirectMap == null) throw new ArgumentNullException(nameof(mapTest.DirectMap), "Property is required for class MapTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..7beb5db0dd4 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1029 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + public partial class MixLog : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// description + /// formulaVersionDate + /// id + /// mixDate + /// totalOverPoors + /// totalRecalculations + /// totalSkips + /// totalUnderPours + /// batchNumber + /// BrandCode is only required for non-color mixes + /// BrandId is only required for color mixes + /// BrandName is only required for color mixes + /// CategoryCode is not used anymore + /// Color is only required for color mixes + /// colorDescription + /// comment + /// commercialProductCode + /// country + /// createdBy + /// createdByFirstName + /// createdByLastName + /// deltaECalculationRepaired + /// deltaECalculationSprayout + /// ownColorVariantNumber + /// primerProductId + /// ProductId is only required for color mixes + /// ProductLineCode is only required for color mixes + /// ProductName is only required for color mixes + /// selectedVersionIndex + /// shopId + /// SomeCode is only required for color mixes + /// totalPrice + [JsonConstructor] + public MixLog(string description, DateTime formulaVersionDate, Guid id, DateTime mixDate, int totalOverPoors, int totalRecalculations, int totalSkips, int totalUnderPours, Option batchNumber = default, Option brandCode = default, Option brandId = default, Option brandName = default, Option categoryCode = default, Option color = default, Option colorDescription = default, Option comment = default, Option commercialProductCode = default, Option country = default, Option createdBy = default, Option createdByFirstName = default, Option createdByLastName = default, Option deltaECalculationRepaired = default, Option deltaECalculationSprayout = default, Option ownColorVariantNumber = default, Option primerProductId = default, Option productId = default, Option productLineCode = default, Option productName = default, Option selectedVersionIndex = default, Option shopId = default, Option someCode = default, Option totalPrice = default) + { + Description = description; + FormulaVersionDate = formulaVersionDate; + Id = id; + MixDate = mixDate; + TotalOverPoors = totalOverPoors; + TotalRecalculations = totalRecalculations; + TotalSkips = totalSkips; + TotalUnderPours = totalUnderPours; + BatchNumberOption = batchNumber; + BrandCodeOption = brandCode; + BrandIdOption = brandId; + BrandNameOption = brandName; + CategoryCodeOption = categoryCode; + ColorOption = color; + ColorDescriptionOption = colorDescription; + CommentOption = comment; + CommercialProductCodeOption = commercialProductCode; + CountryOption = country; + CreatedByOption = createdBy; + CreatedByFirstNameOption = createdByFirstName; + CreatedByLastNameOption = createdByLastName; + DeltaECalculationRepairedOption = deltaECalculationRepaired; + DeltaECalculationSprayoutOption = deltaECalculationSprayout; + OwnColorVariantNumberOption = ownColorVariantNumber; + PrimerProductIdOption = primerProductId; + ProductIdOption = productId; + ProductLineCodeOption = productLineCode; + ProductNameOption = productName; + SelectedVersionIndexOption = selectedVersionIndex; + ShopIdOption = shopId; + SomeCodeOption = someCode; + TotalPriceOption = totalPrice; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [JsonPropertyName("formulaVersionDate")] + public DateTime FormulaVersionDate { get; set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public Guid Id { get; set; } + + /// + /// Gets or Sets MixDate + /// + [JsonPropertyName("mixDate")] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [JsonPropertyName("totalOverPoors")] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [JsonPropertyName("totalRecalculations")] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [JsonPropertyName("totalSkips")] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [JsonPropertyName("totalUnderPours")] + public int TotalUnderPours { get; set; } + + /// + /// Used to track the state of BatchNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BatchNumberOption { get; private set; } + + /// + /// Gets or Sets BatchNumber + /// + [JsonPropertyName("batchNumber")] + public string? BatchNumber { get { return this.BatchNumberOption; } set { this.BatchNumberOption = new(value); } } + + /// + /// Used to track the state of BrandCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandCodeOption { get; private set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [JsonPropertyName("brandCode")] + public string? BrandCode { get { return this.BrandCodeOption; } set { this.BrandCodeOption = new(value); } } + + /// + /// Used to track the state of BrandId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandIdOption { get; private set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [JsonPropertyName("brandId")] + public string? BrandId { get { return this.BrandIdOption; } set { this.BrandIdOption = new(value); } } + + /// + /// Used to track the state of BrandName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandNameOption { get; private set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [JsonPropertyName("brandName")] + public string? BrandName { get { return this.BrandNameOption; } set { this.BrandNameOption = new(value); } } + + /// + /// Used to track the state of CategoryCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryCodeOption { get; private set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [JsonPropertyName("categoryCode")] + public string? CategoryCode { get { return this.CategoryCodeOption; } set { this.CategoryCodeOption = new(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [JsonPropertyName("color")] + public string? Color { get { return this.ColorOption; } set { this.ColorOption = new(value); } } + + /// + /// Used to track the state of ColorDescription + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorDescriptionOption { get; private set; } + + /// + /// Gets or Sets ColorDescription + /// + [JsonPropertyName("colorDescription")] + public string? ColorDescription { get { return this.ColorDescriptionOption; } set { this.ColorDescriptionOption = new(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string? Comment { get { return this.CommentOption; } set { this.CommentOption = new(value); } } + + /// + /// Used to track the state of CommercialProductCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommercialProductCodeOption { get; private set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [JsonPropertyName("commercialProductCode")] + public string? CommercialProductCode { get { return this.CommercialProductCodeOption; } set { this.CommercialProductCodeOption = new(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } + + /// + /// Gets or Sets Country + /// + [JsonPropertyName("country")] + public string? Country { get { return this.CountryOption; } set { this.CountryOption = new(value); } } + + /// + /// Used to track the state of CreatedBy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByOption { get; private set; } + + /// + /// Gets or Sets CreatedBy + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get { return this.CreatedByOption; } set { this.CreatedByOption = new(value); } } + + /// + /// Used to track the state of CreatedByFirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByFirstNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [JsonPropertyName("createdByFirstName")] + public string? CreatedByFirstName { get { return this.CreatedByFirstNameOption; } set { this.CreatedByFirstNameOption = new(value); } } + + /// + /// Used to track the state of CreatedByLastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByLastNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [JsonPropertyName("createdByLastName")] + public string? CreatedByLastName { get { return this.CreatedByLastNameOption; } set { this.CreatedByLastNameOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationRepaired + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationRepairedOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [JsonPropertyName("deltaECalculationRepaired")] + public string? DeltaECalculationRepaired { get { return this.DeltaECalculationRepairedOption; } set { this.DeltaECalculationRepairedOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationSprayout + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationSprayoutOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [JsonPropertyName("deltaECalculationSprayout")] + public string? DeltaECalculationSprayout { get { return this.DeltaECalculationSprayoutOption; } set { this.DeltaECalculationSprayoutOption = new(value); } } + + /// + /// Used to track the state of OwnColorVariantNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnColorVariantNumberOption { get; private set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [JsonPropertyName("ownColorVariantNumber")] + public int? OwnColorVariantNumber { get { return this.OwnColorVariantNumberOption; } set { this.OwnColorVariantNumberOption = new(value); } } + + /// + /// Used to track the state of PrimerProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PrimerProductIdOption { get; private set; } + + /// + /// Gets or Sets PrimerProductId + /// + [JsonPropertyName("primerProductId")] + public string? PrimerProductId { get { return this.PrimerProductIdOption; } set { this.PrimerProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductIdOption { get; private set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [JsonPropertyName("productId")] + public string? ProductId { get { return this.ProductIdOption; } set { this.ProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductLineCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductLineCodeOption { get; private set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [JsonPropertyName("productLineCode")] + public string? ProductLineCode { get { return this.ProductLineCodeOption; } set { this.ProductLineCodeOption = new(value); } } + + /// + /// Used to track the state of ProductName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductNameOption { get; private set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [JsonPropertyName("productName")] + public string? ProductName { get { return this.ProductNameOption; } set { this.ProductNameOption = new(value); } } + + /// + /// Used to track the state of SelectedVersionIndex + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedVersionIndexOption { get; private set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [JsonPropertyName("selectedVersionIndex")] + public int? SelectedVersionIndex { get { return this.SelectedVersionIndexOption; } set { this.SelectedVersionIndexOption = new(value); } } + + /// + /// Used to track the state of ShopId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopIdOption { get; private set; } + + /// + /// Gets or Sets ShopId + /// + [JsonPropertyName("shopId")] + public Guid? ShopId { get { return this.ShopIdOption; } set { this.ShopIdOption = new(value); } } + + /// + /// Used to track the state of SomeCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomeCodeOption { get; private set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [JsonPropertyName("someCode")] + public string? SomeCode { get { return this.SomeCodeOption; } set { this.SomeCodeOption = new(value); } } + + /// + /// Used to track the state of TotalPrice + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalPriceOption { get; private set; } + + /// + /// Gets or Sets TotalPrice + /// + [JsonPropertyName("totalPrice")] + public float? TotalPrice { get { return this.TotalPriceOption; } set { this.TotalPriceOption = new(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixLogJsonConverter : JsonConverter + { + /// + /// The format to use to serialize FormulaVersionDate + /// + public static string FormulaVersionDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize MixDate + /// + public static string MixDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixLog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option description = default; + Option formulaVersionDate = default; + Option id = default; + Option mixDate = default; + Option totalOverPoors = default; + Option totalRecalculations = default; + Option totalSkips = default; + Option totalUnderPours = default; + Option batchNumber = default; + Option brandCode = default; + Option brandId = default; + Option brandName = default; + Option categoryCode = default; + Option color = default; + Option colorDescription = default; + Option comment = default; + Option commercialProductCode = default; + Option country = default; + Option createdBy = default; + Option createdByFirstName = default; + Option createdByLastName = default; + Option deltaECalculationRepaired = default; + Option deltaECalculationSprayout = default; + Option ownColorVariantNumber = default; + Option primerProductId = default; + Option productId = default; + Option productLineCode = default; + Option productName = default; + Option selectedVersionIndex = default; + Option shopId = default; + Option someCode = default; + Option totalPrice = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "description": + description = new Option(utf8JsonReader.GetString()!); + break; + case "formulaVersionDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + formulaVersionDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetGuid()); + break; + case "mixDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mixDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalOverPoors": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalOverPoors = new Option(utf8JsonReader.GetInt32()); + break; + case "totalRecalculations": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalRecalculations = new Option(utf8JsonReader.GetInt32()); + break; + case "totalSkips": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalSkips = new Option(utf8JsonReader.GetInt32()); + break; + case "totalUnderPours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalUnderPours = new Option(utf8JsonReader.GetInt32()); + break; + case "batchNumber": + batchNumber = new Option(utf8JsonReader.GetString()!); + break; + case "brandCode": + brandCode = new Option(utf8JsonReader.GetString()!); + break; + case "brandId": + brandId = new Option(utf8JsonReader.GetString()!); + break; + case "brandName": + brandName = new Option(utf8JsonReader.GetString()!); + break; + case "categoryCode": + categoryCode = new Option(utf8JsonReader.GetString()!); + break; + case "color": + color = new Option(utf8JsonReader.GetString()!); + break; + case "colorDescription": + colorDescription = new Option(utf8JsonReader.GetString()!); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()!); + break; + case "commercialProductCode": + commercialProductCode = new Option(utf8JsonReader.GetString()!); + break; + case "country": + country = new Option(utf8JsonReader.GetString()!); + break; + case "createdBy": + createdBy = new Option(utf8JsonReader.GetString()!); + break; + case "createdByFirstName": + createdByFirstName = new Option(utf8JsonReader.GetString()!); + break; + case "createdByLastName": + createdByLastName = new Option(utf8JsonReader.GetString()!); + break; + case "deltaECalculationRepaired": + deltaECalculationRepaired = new Option(utf8JsonReader.GetString()!); + break; + case "deltaECalculationSprayout": + deltaECalculationSprayout = new Option(utf8JsonReader.GetString()!); + break; + case "ownColorVariantNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ownColorVariantNumber = new Option(utf8JsonReader.GetInt32()); + break; + case "primerProductId": + primerProductId = new Option(utf8JsonReader.GetString()!); + break; + case "productId": + productId = new Option(utf8JsonReader.GetString()!); + break; + case "productLineCode": + productLineCode = new Option(utf8JsonReader.GetString()!); + break; + case "productName": + productName = new Option(utf8JsonReader.GetString()!); + break; + case "selectedVersionIndex": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selectedVersionIndex = new Option(utf8JsonReader.GetInt32()); + break; + case "shopId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopId = new Option(utf8JsonReader.GetGuid()); + break; + case "someCode": + someCode = new Option(utf8JsonReader.GetString()); + break; + case "totalPrice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalPrice = new Option((float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!description.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(description)); + + if (!formulaVersionDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(formulaVersionDate)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(id)); + + if (!mixDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(mixDate)); + + if (!totalOverPoors.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalOverPoors)); + + if (!totalRecalculations.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalRecalculations)); + + if (!totalSkips.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalSkips)); + + if (!totalUnderPours.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalUnderPours)); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class MixLog."); + + if (formulaVersionDate.IsSet && formulaVersionDate.Value == null) + throw new ArgumentNullException(nameof(formulaVersionDate), "Property is not nullable for class MixLog."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixLog."); + + if (mixDate.IsSet && mixDate.Value == null) + throw new ArgumentNullException(nameof(mixDate), "Property is not nullable for class MixLog."); + + if (totalOverPoors.IsSet && totalOverPoors.Value == null) + throw new ArgumentNullException(nameof(totalOverPoors), "Property is not nullable for class MixLog."); + + if (totalRecalculations.IsSet && totalRecalculations.Value == null) + throw new ArgumentNullException(nameof(totalRecalculations), "Property is not nullable for class MixLog."); + + if (totalSkips.IsSet && totalSkips.Value == null) + throw new ArgumentNullException(nameof(totalSkips), "Property is not nullable for class MixLog."); + + if (totalUnderPours.IsSet && totalUnderPours.Value == null) + throw new ArgumentNullException(nameof(totalUnderPours), "Property is not nullable for class MixLog."); + + if (batchNumber.IsSet && batchNumber.Value == null) + throw new ArgumentNullException(nameof(batchNumber), "Property is not nullable for class MixLog."); + + if (brandCode.IsSet && brandCode.Value == null) + throw new ArgumentNullException(nameof(brandCode), "Property is not nullable for class MixLog."); + + if (brandId.IsSet && brandId.Value == null) + throw new ArgumentNullException(nameof(brandId), "Property is not nullable for class MixLog."); + + if (brandName.IsSet && brandName.Value == null) + throw new ArgumentNullException(nameof(brandName), "Property is not nullable for class MixLog."); + + if (categoryCode.IsSet && categoryCode.Value == null) + throw new ArgumentNullException(nameof(categoryCode), "Property is not nullable for class MixLog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class MixLog."); + + if (colorDescription.IsSet && colorDescription.Value == null) + throw new ArgumentNullException(nameof(colorDescription), "Property is not nullable for class MixLog."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class MixLog."); + + if (commercialProductCode.IsSet && commercialProductCode.Value == null) + throw new ArgumentNullException(nameof(commercialProductCode), "Property is not nullable for class MixLog."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class MixLog."); + + if (createdBy.IsSet && createdBy.Value == null) + throw new ArgumentNullException(nameof(createdBy), "Property is not nullable for class MixLog."); + + if (createdByFirstName.IsSet && createdByFirstName.Value == null) + throw new ArgumentNullException(nameof(createdByFirstName), "Property is not nullable for class MixLog."); + + if (createdByLastName.IsSet && createdByLastName.Value == null) + throw new ArgumentNullException(nameof(createdByLastName), "Property is not nullable for class MixLog."); + + if (deltaECalculationRepaired.IsSet && deltaECalculationRepaired.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationRepaired), "Property is not nullable for class MixLog."); + + if (deltaECalculationSprayout.IsSet && deltaECalculationSprayout.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationSprayout), "Property is not nullable for class MixLog."); + + if (primerProductId.IsSet && primerProductId.Value == null) + throw new ArgumentNullException(nameof(primerProductId), "Property is not nullable for class MixLog."); + + if (productId.IsSet && productId.Value == null) + throw new ArgumentNullException(nameof(productId), "Property is not nullable for class MixLog."); + + if (productLineCode.IsSet && productLineCode.Value == null) + throw new ArgumentNullException(nameof(productLineCode), "Property is not nullable for class MixLog."); + + if (productName.IsSet && productName.Value == null) + throw new ArgumentNullException(nameof(productName), "Property is not nullable for class MixLog."); + + if (selectedVersionIndex.IsSet && selectedVersionIndex.Value == null) + throw new ArgumentNullException(nameof(selectedVersionIndex), "Property is not nullable for class MixLog."); + + if (shopId.IsSet && shopId.Value == null) + throw new ArgumentNullException(nameof(shopId), "Property is not nullable for class MixLog."); + + return new MixLog(description.Value!, formulaVersionDate.Value!.Value!, id.Value!.Value!, mixDate.Value!.Value!, totalOverPoors.Value!.Value!, totalRecalculations.Value!.Value!, totalSkips.Value!.Value!, totalUnderPours.Value!.Value!, batchNumber, brandCode, brandId, brandName, categoryCode, color, colorDescription, comment, commercialProductCode, country, createdBy, createdByFirstName, createdByLastName, deltaECalculationRepaired, deltaECalculationSprayout, ownColorVariantNumber, primerProductId, productId, productLineCode, productName, selectedVersionIndex, shopId, someCode, totalPrice); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixLog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + if (mixLog.Description == null) + throw new ArgumentNullException(nameof(mixLog.Description), "Property is required for class MixLog."); + + if (mixLog.BatchNumberOption.IsSet && mixLog.BatchNumber == null) + throw new ArgumentNullException(nameof(mixLog.BatchNumber), "Property is required for class MixLog."); + + if (mixLog.BrandCodeOption.IsSet && mixLog.BrandCode == null) + throw new ArgumentNullException(nameof(mixLog.BrandCode), "Property is required for class MixLog."); + + if (mixLog.BrandIdOption.IsSet && mixLog.BrandId == null) + throw new ArgumentNullException(nameof(mixLog.BrandId), "Property is required for class MixLog."); + + if (mixLog.BrandNameOption.IsSet && mixLog.BrandName == null) + throw new ArgumentNullException(nameof(mixLog.BrandName), "Property is required for class MixLog."); + + if (mixLog.CategoryCodeOption.IsSet && mixLog.CategoryCode == null) + throw new ArgumentNullException(nameof(mixLog.CategoryCode), "Property is required for class MixLog."); + + if (mixLog.ColorOption.IsSet && mixLog.Color == null) + throw new ArgumentNullException(nameof(mixLog.Color), "Property is required for class MixLog."); + + if (mixLog.ColorDescriptionOption.IsSet && mixLog.ColorDescription == null) + throw new ArgumentNullException(nameof(mixLog.ColorDescription), "Property is required for class MixLog."); + + if (mixLog.CommentOption.IsSet && mixLog.Comment == null) + throw new ArgumentNullException(nameof(mixLog.Comment), "Property is required for class MixLog."); + + if (mixLog.CommercialProductCodeOption.IsSet && mixLog.CommercialProductCode == null) + throw new ArgumentNullException(nameof(mixLog.CommercialProductCode), "Property is required for class MixLog."); + + if (mixLog.CountryOption.IsSet && mixLog.Country == null) + throw new ArgumentNullException(nameof(mixLog.Country), "Property is required for class MixLog."); + + if (mixLog.CreatedByOption.IsSet && mixLog.CreatedBy == null) + throw new ArgumentNullException(nameof(mixLog.CreatedBy), "Property is required for class MixLog."); + + if (mixLog.CreatedByFirstNameOption.IsSet && mixLog.CreatedByFirstName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByFirstName), "Property is required for class MixLog."); + + if (mixLog.CreatedByLastNameOption.IsSet && mixLog.CreatedByLastName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByLastName), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationRepairedOption.IsSet && mixLog.DeltaECalculationRepaired == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationRepaired), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet && mixLog.DeltaECalculationSprayout == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationSprayout), "Property is required for class MixLog."); + + if (mixLog.PrimerProductIdOption.IsSet && mixLog.PrimerProductId == null) + throw new ArgumentNullException(nameof(mixLog.PrimerProductId), "Property is required for class MixLog."); + + if (mixLog.ProductIdOption.IsSet && mixLog.ProductId == null) + throw new ArgumentNullException(nameof(mixLog.ProductId), "Property is required for class MixLog."); + + if (mixLog.ProductLineCodeOption.IsSet && mixLog.ProductLineCode == null) + throw new ArgumentNullException(nameof(mixLog.ProductLineCode), "Property is required for class MixLog."); + + if (mixLog.ProductNameOption.IsSet && mixLog.ProductName == null) + throw new ArgumentNullException(nameof(mixLog.ProductName), "Property is required for class MixLog."); + + writer.WriteString("description", mixLog.Description); + + writer.WriteString("formulaVersionDate", mixLog.FormulaVersionDate.ToString(FormulaVersionDateFormat)); + + writer.WriteString("id", mixLog.Id); + + writer.WriteString("mixDate", mixLog.MixDate.ToString(MixDateFormat)); + + writer.WriteNumber("totalOverPoors", mixLog.TotalOverPoors); + + writer.WriteNumber("totalRecalculations", mixLog.TotalRecalculations); + + writer.WriteNumber("totalSkips", mixLog.TotalSkips); + + writer.WriteNumber("totalUnderPours", mixLog.TotalUnderPours); + + if (mixLog.BatchNumberOption.IsSet) + writer.WriteString("batchNumber", mixLog.BatchNumber); + + if (mixLog.BrandCodeOption.IsSet) + writer.WriteString("brandCode", mixLog.BrandCode); + + if (mixLog.BrandIdOption.IsSet) + writer.WriteString("brandId", mixLog.BrandId); + + if (mixLog.BrandNameOption.IsSet) + writer.WriteString("brandName", mixLog.BrandName); + + if (mixLog.CategoryCodeOption.IsSet) + writer.WriteString("categoryCode", mixLog.CategoryCode); + + if (mixLog.ColorOption.IsSet) + writer.WriteString("color", mixLog.Color); + + if (mixLog.ColorDescriptionOption.IsSet) + writer.WriteString("colorDescription", mixLog.ColorDescription); + + if (mixLog.CommentOption.IsSet) + writer.WriteString("comment", mixLog.Comment); + + if (mixLog.CommercialProductCodeOption.IsSet) + writer.WriteString("commercialProductCode", mixLog.CommercialProductCode); + + if (mixLog.CountryOption.IsSet) + writer.WriteString("country", mixLog.Country); + + if (mixLog.CreatedByOption.IsSet) + writer.WriteString("createdBy", mixLog.CreatedBy); + + if (mixLog.CreatedByFirstNameOption.IsSet) + writer.WriteString("createdByFirstName", mixLog.CreatedByFirstName); + + if (mixLog.CreatedByLastNameOption.IsSet) + writer.WriteString("createdByLastName", mixLog.CreatedByLastName); + + if (mixLog.DeltaECalculationRepairedOption.IsSet) + writer.WriteString("deltaECalculationRepaired", mixLog.DeltaECalculationRepaired); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet) + writer.WriteString("deltaECalculationSprayout", mixLog.DeltaECalculationSprayout); + + if (mixLog.OwnColorVariantNumberOption.IsSet) + if (mixLog.OwnColorVariantNumberOption.Value != null) + writer.WriteNumber("ownColorVariantNumber", mixLog.OwnColorVariantNumberOption.Value!.Value); + else + writer.WriteNull("ownColorVariantNumber"); + + if (mixLog.PrimerProductIdOption.IsSet) + writer.WriteString("primerProductId", mixLog.PrimerProductId); + + if (mixLog.ProductIdOption.IsSet) + writer.WriteString("productId", mixLog.ProductId); + + if (mixLog.ProductLineCodeOption.IsSet) + writer.WriteString("productLineCode", mixLog.ProductLineCode); + + if (mixLog.ProductNameOption.IsSet) + writer.WriteString("productName", mixLog.ProductName); + + if (mixLog.SelectedVersionIndexOption.IsSet) + writer.WriteNumber("selectedVersionIndex", mixLog.SelectedVersionIndexOption.Value!.Value); + + if (mixLog.ShopIdOption.IsSet) + writer.WriteString("shopId", mixLog.ShopIdOption.Value!.Value); + + if (mixLog.SomeCodeOption.IsSet) + if (mixLog.SomeCodeOption.Value != null) + writer.WriteString("someCode", mixLog.SomeCode); + else + writer.WriteNull("someCode"); + + if (mixLog.TotalPriceOption.IsSet) + if (mixLog.TotalPriceOption.Value != null) + writer.WriteNumber("totalPrice", mixLog.TotalPriceOption.Value!.Value); + else + writer.WriteNull("totalPrice"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 0315c45e9bc..01ef25c69ce 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -238,7 +238,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -249,7 +249,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet && mixedPropertiesAndAdditionalPropertiesClass.Map == null) throw new ArgumentNullException(nameof(mixedPropertiesAndAdditionalPropertiesClass.Map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs index c2d66e9873f..4cec514e74a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, model200Response, jsonSerializerOptions); + WriteProperties(writer, model200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) { if (model200Response.ClassOption.IsSet && model200Response.Class == null) throw new ArgumentNullException(nameof(model200Response.Class), "Property is required for class Model200Response."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ModelClient.cs index 149e4bffc40..4c59b5d68c7 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ModelClient.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, modelClient, jsonSerializerOptions); + WriteProperties(writer, modelClient, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) { if (modelClient.VarClientOption.IsSet && modelClient.VarClient == null) throw new ArgumentNullException(nameof(modelClient.VarClient), "Property is required for class ModelClient."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs index 12fe5a128e0..a21af022df6 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs @@ -262,7 +262,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, name, jsonSerializerOptions); + WriteProperties(writer, name, jsonSerializerOptions); writer.WriteEndObject(); } @@ -273,7 +273,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { if (name.PropertyOption.IsSet && name.Property == null) throw new ArgumentNullException(nameof(name.Property), "Property is required for class Name."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index 0be2516e511..f1322013ba8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); writer.WriteEndObject(); } @@ -181,7 +181,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) { if (notificationtestGetElementsV1ResponseMPayload.AObjVariableobject == null) throw new ArgumentNullException(nameof(notificationtestGetElementsV1ResponseMPayload.AObjVariableobject), "Property is required for class NotificationtestGetElementsV1ResponseMPayload."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs index 5c4648d213f..c674ba10f1b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs @@ -397,7 +397,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableClass, jsonSerializerOptions); + WriteProperties(writer, nullableClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -408,7 +408,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableClass.ArrayItemsNullableOption.IsSet && nullableClass.ArrayItemsNullable == null) throw new ArgumentNullException(nameof(nullableClass.ArrayItemsNullable), "Property is required for class NullableClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs index d32d8c31dbf..6d21b7213d1 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableGuidClass, jsonSerializerOptions); + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableGuidClass.UuidOption.IsSet) if (nullableGuidClass.UuidOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableShape.cs index f77cc1947a1..5cb7a024bb8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableShape.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Triangle triangle, string shapeType) + public NullableShape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Quadrilateral quadrilateral, string shapeType) + public NullableShape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -67,12 +63,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -87,7 +77,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class NullableShape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -202,10 +191,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); if (quadrilateral != null) - return new NullableShape(quadrilateral, shapeType.Value!); + return new NullableShape(quadrilateral); if (triangle != null) - return new NullableShape(triangle, shapeType.Value!); + return new NullableShape(triangle); throw new JsonException(); } @@ -223,15 +212,15 @@ namespace Org.OpenAPITools.Model if (nullableShape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, nullableShape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } if (nullableShape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, nullableShape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, nullableShape, jsonSerializerOptions); + WriteProperties(writer, nullableShape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -242,12 +231,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) { - if (nullableShape.ShapeType == null) - throw new ArgumentNullException(nameof(nullableShape.ShapeType), "Property is required for class NullableShape."); - writer.WriteString("shapeType", nullableShape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs index d11523b38f5..639f9226a10 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, numberOnly, jsonSerializerOptions); + WriteProperties(writer, numberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) { if (numberOnly.JustNumberOption.IsSet) writer.WriteNumber("JustNumber", numberOnly.JustNumberOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index c20167f0f36..8798637d31e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -228,7 +228,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, objectWithDeprecatedFields, jsonSerializerOptions); + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); writer.WriteEndObject(); } @@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) { if (objectWithDeprecatedFields.BarsOption.IsSet && objectWithDeprecatedFields.Bars == null) throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Bars), "Property is required for class ObjectWithDeprecatedFields."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OneOfString.cs index abab41e9e99..a2ab3d33880 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OneOfString.cs @@ -34,19 +34,19 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal OneOfString(string varString) + /// + internal OneOfString(string @string) { - VarString = varString; + String = @string; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string? VarString { get; set; } + public string? String { get; set; } /// /// Gets or Sets additional properties @@ -140,7 +140,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, oneOfString, jsonSerializerOptions); + WriteProperties(writer, oneOfString, jsonSerializerOptions); writer.WriteEndObject(); } @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs index df1d550cbf2..6fa4f95a8d9 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs @@ -363,7 +363,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, order, jsonSerializerOptions); + WriteProperties(writer, order, jsonSerializerOptions); writer.WriteEndObject(); } @@ -374,7 +374,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) { if (order.CompleteOption.IsSet) writer.WriteBoolean("complete", order.CompleteOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs index 6470fde6a2b..8827863e100 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, outerComposite, jsonSerializerOptions); + WriteProperties(writer, outerComposite, jsonSerializerOptions); writer.WriteEndObject(); } @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) { if (outerComposite.MyStringOption.IsSet && outerComposite.MyString == null) throw new ArgumentNullException(nameof(outerComposite.MyString), "Property is required for class OuterComposite."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ParentPet.cs index de4aa64ceab..1b84966fe9b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ParentPet.cs @@ -34,15 +34,21 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public ParentPet(string petType) : base(petType) + public ParentPet() : base() { OnCreated(); } partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string PetType { get; } = "ParentPet"; + /// /// Returns the string presentation of the object /// @@ -81,6 +87,11 @@ namespace Org.OpenAPITools.Model Option petType = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -111,7 +122,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); - return new ParentPet(petType.Value!); + return new ParentPet(); } /// @@ -123,9 +134,14 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, parentPet, jsonSerializerOptions); + WriteProperties(writer, parentPet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -136,11 +152,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { - if (parentPet.PetType == null) - throw new ArgumentNullException(nameof(parentPet.PetType), "Property is required for class ParentPet."); - writer.WriteString("pet_type", parentPet.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs index c04caa9bdec..02c14e86b3d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs @@ -349,7 +349,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, pet, jsonSerializerOptions); + WriteProperties(writer, pet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -360,7 +360,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) { if (pet.Name == null) throw new ArgumentNullException(nameof(pet.Name), "Property is required for class Pet."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pig.cs index 727999c5928..0a26dc0fb34 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pig.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(BasquePig basquePig, string className) + public Pig(BasquePig basquePig) { BasquePig = basquePig; - ClassName = className; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(DanishPig danishPig, string className) + public Pig(DanishPig danishPig) { DanishPig = danishPig; - ClassName = className; OnCreated(); } @@ -67,12 +63,6 @@ namespace Org.OpenAPITools.Model /// public DanishPig? DanishPig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -87,7 +77,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Pig {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -202,10 +191,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); if (basquePig != null) - return new Pig(basquePig, className.Value!); + return new Pig(basquePig); if (danishPig != null) - return new Pig(danishPig, className.Value!); + return new Pig(danishPig); throw new JsonException(); } @@ -223,15 +212,15 @@ namespace Org.OpenAPITools.Model if (pig.BasquePig != null) { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); - basquePigJsonConverter.WriteProperties(ref writer, pig.BasquePig, jsonSerializerOptions); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } if (pig.DanishPig != null) { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); - danishPigJsonConverter.WriteProperties(ref writer, pig.DanishPig, jsonSerializerOptions); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } - WriteProperties(ref writer, pig, jsonSerializerOptions); + WriteProperties(writer, pig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -242,12 +231,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) { - if (pig.ClassName == null) - throw new ArgumentNullException(nameof(pig.ClassName), "Property is required for class Pig."); - writer.WriteString("className", pig.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index dceaef0f4f7..4466ad3cfe8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -34,20 +34,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(bool varBool) + /// + internal PolymorphicProperty(bool @bool) { - VarBool = varBool; + Bool = @bool; OnCreated(); } /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(string varString) + /// + internal PolymorphicProperty(string @string) { - VarString = varString; + String = @string; OnCreated(); } @@ -74,14 +74,14 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets VarBool + /// Gets or Sets Bool /// - public bool? VarBool { get; set; } + public bool? Bool { get; set; } /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string? VarString { get; set; } + public string? String { get; set; } /// /// Gets or Sets Object @@ -161,11 +161,11 @@ namespace Org.OpenAPITools.Model if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); - Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model } if (varBool != null) - return new PolymorphicProperty(varBool); + return new PolymorphicProperty(varBool.Value); if (varString != null) return new PolymorphicProperty(varString); @@ -222,7 +222,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, polymorphicProperty, jsonSerializerOptions); + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); writer.WriteEndObject(); } @@ -233,7 +233,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Quadrilateral.cs index e5bf2ef2a02..bb00a21cf69 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral, string quadrilateralType) + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) { SimpleQuadrilateral = simpleQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(ComplexQuadrilateral complexQuadrilateral, string quadrilateralType) + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) { ComplexQuadrilateral = complexQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -67,12 +63,6 @@ namespace Org.OpenAPITools.Model /// public ComplexQuadrilateral? ComplexQuadrilateral { get; set; } - /// - /// Gets or Sets QuadrilateralType - /// - [JsonPropertyName("quadrilateralType")] - public string QuadrilateralType { get; set; } - /// /// Gets or Sets additional properties /// @@ -87,7 +77,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Quadrilateral {\n"); - sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -202,10 +191,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); if (complexQuadrilateral != null) - return new Quadrilateral(complexQuadrilateral, quadrilateralType.Value!); + return new Quadrilateral(complexQuadrilateral); if (simpleQuadrilateral != null) - return new Quadrilateral(simpleQuadrilateral, quadrilateralType.Value!); + return new Quadrilateral(simpleQuadrilateral); throw new JsonException(); } @@ -223,15 +212,15 @@ namespace Org.OpenAPITools.Model if (quadrilateral.SimpleQuadrilateral != null) { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); - simpleQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } if (quadrilateral.ComplexQuadrilateral != null) { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); - complexQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, quadrilateral, jsonSerializerOptions); + WriteProperties(writer, quadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -242,12 +231,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) { - if (quadrilateral.QuadrilateralType == null) - throw new ArgumentNullException(nameof(quadrilateral.QuadrilateralType), "Property is required for class Quadrilateral."); - writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9a15b8828a3..bc88c7d5919 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, quadrilateralInterface, jsonSerializerOptions); + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) { if (quadrilateralInterface.QuadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralInterface.QuadrilateralType), "Property is required for class QuadrilateralInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index c34d7d3e309..ad4b61f5e02 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -214,7 +214,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, readOnlyFirst, jsonSerializerOptions); + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); writer.WriteEndObject(); } @@ -225,7 +225,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) { if (readOnlyFirst.BarOption.IsSet && readOnlyFirst.Bar == null) throw new ArgumentNullException(nameof(readOnlyFirst.Bar), "Property is required for class ReadOnlyFirst."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs index 87283acb06b..d62124ac11e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -45,17 +45,6 @@ namespace Org.OpenAPITools.Model /// requiredNotnullableStringProp /// requiredNotnullableUuid /// requiredNotnullableintegerProp - /// requiredNullableArrayOfString - /// requiredNullableBooleanProp - /// requiredNullableDateProp - /// requiredNullableDatetimeProp - /// requiredNullableEnumInteger - /// requiredNullableEnumIntegerOnly - /// requiredNullableEnumString - /// requiredNullableIntegerProp - /// requiredNullableOuterEnumDefaultValue - /// requiredNullableStringProp - /// requiredNullableUuid /// notRequiredNotnullableDateProp /// notRequiredNotnullableintegerProp /// notRequiredNullableDateProp @@ -78,8 +67,19 @@ namespace Org.OpenAPITools.Model /// notrequiredNullableOuterEnumDefaultValue /// notrequiredNullableStringProp /// notrequiredNullableUuid + /// requiredNullableArrayOfString + /// requiredNullableBooleanProp + /// requiredNullableDateProp + /// requiredNullableDatetimeProp + /// requiredNullableEnumInteger + /// requiredNullableEnumIntegerOnly + /// requiredNullableEnumString + /// requiredNullableIntegerProp + /// requiredNullableOuterEnumDefaultValue + /// requiredNullableStringProp + /// requiredNullableUuid [JsonConstructor] - public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, List? requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string? requiredNullableStringProp = default, Guid? requiredNullableUuid = default, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option?> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option?> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default) + public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option?> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option?> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default, List? requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string? requiredNullableStringProp = default, Guid? requiredNullableUuid = default) { RequiredNotNullableDateProp = requiredNotNullableDateProp; RequiredNotnullableArrayOfString = requiredNotnullableArrayOfString; @@ -92,17 +92,6 @@ namespace Org.OpenAPITools.Model RequiredNotnullableStringProp = requiredNotnullableStringProp; RequiredNotnullableUuid = requiredNotnullableUuid; RequiredNotnullableintegerProp = requiredNotnullableintegerProp; - RequiredNullableArrayOfString = requiredNullableArrayOfString; - RequiredNullableBooleanProp = requiredNullableBooleanProp; - RequiredNullableDateProp = requiredNullableDateProp; - RequiredNullableDatetimeProp = requiredNullableDatetimeProp; - RequiredNullableEnumInteger = requiredNullableEnumInteger; - RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; - RequiredNullableEnumString = requiredNullableEnumString; - RequiredNullableIntegerProp = requiredNullableIntegerProp; - RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; - RequiredNullableStringProp = requiredNullableStringProp; - RequiredNullableUuid = requiredNullableUuid; NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; NotRequiredNullableDatePropOption = notRequiredNullableDateProp; @@ -125,6 +114,17 @@ namespace Org.OpenAPITools.Model NotrequiredNullableOuterEnumDefaultValueOption = notrequiredNullableOuterEnumDefaultValue; NotrequiredNullableStringPropOption = notrequiredNullableStringProp; NotrequiredNullableUuidOption = notrequiredNullableUuid; + RequiredNullableArrayOfString = requiredNullableArrayOfString; + RequiredNullableBooleanProp = requiredNullableBooleanProp; + RequiredNullableDateProp = requiredNullableDateProp; + RequiredNullableDatetimeProp = requiredNullableDatetimeProp; + RequiredNullableEnumInteger = requiredNullableEnumInteger; + RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; + RequiredNullableEnumString = requiredNullableEnumString; + RequiredNullableIntegerProp = requiredNullableIntegerProp; + RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; + RequiredNullableStringProp = requiredNullableStringProp; + RequiredNullableUuid = requiredNullableUuid; OnCreated(); } @@ -422,301 +422,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } - /// - /// Defines RequiredNullableEnumInteger - /// - public enum RequiredNullableEnumIntegerEnum - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - - /// - /// Enum NUMBER_MINUS_1 for value: -1 - /// - NUMBER_MINUS_1 = -1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumInteger - /// - [JsonPropertyName("required_nullable_enum_integer")] - public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } - - /// - /// Defines RequiredNullableEnumIntegerOnly - /// - public enum RequiredNullableEnumIntegerOnlyEnum - { - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - - /// - /// Enum NUMBER_MINUS_2 for value: -2 - /// - NUMBER_MINUS_2 = -2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumIntegerOnly - /// - [JsonPropertyName("required_nullable_enum_integer_only")] - public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } - - /// - /// Defines RequiredNullableEnumString - /// - public enum RequiredNullableEnumStringEnum - { - /// - /// Enum UPPER for value: UPPER - /// - UPPER = 1, - - /// - /// Enum Lower for value: lower - /// - Lower = 2, - - /// - /// Enum Empty for value: - /// - Empty = 3, - - /// - /// Enum ValuewithTab for value: Value\twith tab - /// - ValuewithTab = 4, - - /// - /// Enum ValueWithQuote for value: Value with \" quote - /// - ValueWithQuote = 5, - - /// - /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote - /// - ValueWithEscapedQuote = 6, - - /// - /// Enum Duplicatevalue for value: Duplicate\nvalue - /// - Duplicatevalue = 7, - - /// - /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue - /// - Duplicatevalue2 = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string? RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) - { - if (value == null) - return null; - - if (value == RequiredNullableEnumStringEnum.UPPER) - return "UPPER"; - - if (value == RequiredNullableEnumStringEnum.Lower) - return "lower"; - - if (value == RequiredNullableEnumStringEnum.Empty) - return ""; - - if (value == RequiredNullableEnumStringEnum.ValuewithTab) - return "Value\twith tab"; - - if (value == RequiredNullableEnumStringEnum.ValueWithQuote) - return "Value with \" quote"; - - if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) - return "Value with escaped \" quote"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue) - return "Duplicate\nvalue"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) - return "Duplicate\r\nvalue"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Gets or Sets RequiredNullableEnumString - /// - [JsonPropertyName("required_nullable_enum_string")] - public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } - - /// - /// Gets or Sets RequiredNullableOuterEnumDefaultValue - /// - [JsonPropertyName("required_nullable_outerEnumDefaultValue")] - public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } - /// /// Defines NotrequiredNotnullableEnumInteger /// @@ -1360,6 +1065,301 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new(value); } } + /// + /// Defines RequiredNullableEnumInteger + /// + public enum RequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumInteger + /// + [JsonPropertyName("required_nullable_enum_integer")] + public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } + + /// + /// Defines RequiredNullableEnumIntegerOnly + /// + public enum RequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("required_nullable_enum_integer_only")] + public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNullableEnumString + /// + public enum RequiredNullableEnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2, + + /// + /// Enum Empty for value: + /// + Empty = 3, + + /// + /// Enum ValuewithTab for value: Value\twith tab + /// + ValuewithTab = 4, + + /// + /// Enum ValueWithQuote for value: Value with \" quote + /// + ValueWithQuote = 5, + + /// + /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote + /// + ValueWithEscapedQuote = 6, + + /// + /// Enum Duplicatevalue for value: Duplicate\nvalue + /// + Duplicatevalue = 7, + + /// + /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue + /// + Duplicatevalue2 = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string? RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == RequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNullableEnumString + /// + [JsonPropertyName("required_nullable_enum_string")] + public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } + /// /// Gets or Sets RequiredNotNullableDateProp /// @@ -1403,49 +1403,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullableinteger_prop")] public int RequiredNotnullableintegerProp { get; set; } - /// - /// Gets or Sets RequiredNullableArrayOfString - /// - [JsonPropertyName("required_nullable_array_of_string")] - public List? RequiredNullableArrayOfString { get; set; } - - /// - /// Gets or Sets RequiredNullableBooleanProp - /// - [JsonPropertyName("required_nullable_boolean_prop")] - public bool? RequiredNullableBooleanProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDateProp - /// - [JsonPropertyName("required_nullable_date_prop")] - public DateOnly? RequiredNullableDateProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDatetimeProp - /// - [JsonPropertyName("required_nullable_datetime_prop")] - public DateTime? RequiredNullableDatetimeProp { get; set; } - - /// - /// Gets or Sets RequiredNullableIntegerProp - /// - [JsonPropertyName("required_nullable_integer_prop")] - public int? RequiredNullableIntegerProp { get; set; } - - /// - /// Gets or Sets RequiredNullableStringProp - /// - [JsonPropertyName("required_nullable_string_prop")] - public string? RequiredNullableStringProp { get; set; } - - /// - /// Gets or Sets RequiredNullableUuid - /// - /// 72f98069-206d-4f12-9f12-3d1e525a8e84 - [JsonPropertyName("required_nullable_uuid")] - public Guid? RequiredNullableUuid { get; set; } - /// /// Used to track the state of NotRequiredNotnullableDateProp /// @@ -1630,6 +1587,49 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_uuid")] public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new(value); } } + /// + /// Gets or Sets RequiredNullableArrayOfString + /// + [JsonPropertyName("required_nullable_array_of_string")] + public List? RequiredNullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNullableBooleanProp + /// + [JsonPropertyName("required_nullable_boolean_prop")] + public bool? RequiredNullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDateProp + /// + [JsonPropertyName("required_nullable_date_prop")] + public DateOnly? RequiredNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDatetimeProp + /// + [JsonPropertyName("required_nullable_datetime_prop")] + public DateTime? RequiredNullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNullableIntegerProp + /// + [JsonPropertyName("required_nullable_integer_prop")] + public int? RequiredNullableIntegerProp { get; set; } + + /// + /// Gets or Sets RequiredNullableStringProp + /// + [JsonPropertyName("required_nullable_string_prop")] + public string? RequiredNullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_nullable_uuid")] + public Guid? RequiredNullableUuid { get; set; } + /// /// Gets or Sets additional properties /// @@ -1655,17 +1655,6 @@ namespace Org.OpenAPITools.Model sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); - sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); - sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); - sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); - sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); - sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); - sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); - sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); - sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); - sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); - sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); - sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); @@ -1688,6 +1677,17 @@ namespace Org.OpenAPITools.Model sb.Append(" NotrequiredNullableOuterEnumDefaultValue: ").Append(NotrequiredNullableOuterEnumDefaultValue).Append("\n"); sb.Append(" NotrequiredNullableStringProp: ").Append(NotrequiredNullableStringProp).Append("\n"); sb.Append(" NotrequiredNullableUuid: ").Append(NotrequiredNullableUuid).Append("\n"); + sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); + sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); + sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); + sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); + sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); + sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); + sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); + sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -1719,16 +1719,6 @@ namespace Org.OpenAPITools.Model /// public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// - /// The format to use to serialize RequiredNullableDateProp - /// - public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize RequiredNullableDatetimeProp - /// - public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// /// The format to use to serialize NotRequiredNotnullableDateProp /// @@ -1749,6 +1739,16 @@ namespace Org.OpenAPITools.Model /// public static string NotrequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// + /// The format to use to serialize RequiredNullableDateProp + /// + public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNullableDatetimeProp + /// + public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// /// Deserializes json to /// @@ -1777,17 +1777,6 @@ namespace Org.OpenAPITools.Model Option requiredNotnullableStringProp = default; Option requiredNotnullableUuid = default; Option requiredNotnullableintegerProp = default; - Option?> requiredNullableArrayOfString = default; - Option requiredNullableBooleanProp = default; - Option requiredNullableDateProp = default; - Option requiredNullableDatetimeProp = default; - Option requiredNullableEnumInteger = default; - Option requiredNullableEnumIntegerOnly = default; - Option requiredNullableEnumString = default; - Option requiredNullableIntegerProp = default; - Option requiredNullableOuterEnumDefaultValue = default; - Option requiredNullableStringProp = default; - Option requiredNullableUuid = default; Option notRequiredNotnullableDateProp = default; Option notRequiredNotnullableintegerProp = default; Option notRequiredNullableDateProp = default; @@ -1810,6 +1799,17 @@ namespace Org.OpenAPITools.Model Option notrequiredNullableOuterEnumDefaultValue = default; Option notrequiredNullableStringProp = default; Option notrequiredNullableUuid = default; + Option?> requiredNullableArrayOfString = default; + Option requiredNullableBooleanProp = default; + Option requiredNullableDateProp = default; + Option requiredNullableDatetimeProp = default; + Option requiredNullableEnumInteger = default; + Option requiredNullableEnumIntegerOnly = default; + Option requiredNullableEnumString = default; + Option requiredNullableIntegerProp = default; + Option requiredNullableOuterEnumDefaultValue = default; + Option requiredNullableStringProp = default; + Option requiredNullableUuid = default; while (utf8JsonReader.Read()) { @@ -1871,51 +1871,6 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); break; - case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); - break; - case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_string": - string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumStringRawValue != null) - requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); - break; - case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); - break; - case "required_nullable_outerEnumDefaultValue": - string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); - break; - case "required_nullable_string_prop": - requiredNullableStringProp = new Option(utf8JsonReader.GetString()); - break; - case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); - break; case "not_required_notnullable_date_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -2006,6 +1961,51 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); break; + case "required_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_string": + string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumStringRawValue != null) + requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); + break; + case "required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "required_nullable_outerEnumDefaultValue": + string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); + break; + case "required_nullable_string_prop": + requiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_nullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + break; default: break; } @@ -2144,7 +2144,7 @@ namespace Org.OpenAPITools.Model if (notrequiredNotnullableUuid.IsSet && notrequiredNotnullableUuid.Value == null) throw new ArgumentNullException(nameof(notrequiredNotnullableUuid), "Property is not nullable for class RequiredClass."); - return new RequiredClass(requiredNotNullableDateProp.Value!.Value!, requiredNotnullableArrayOfString.Value!, requiredNotnullableBooleanProp.Value!.Value!, requiredNotnullableDatetimeProp.Value!.Value!, requiredNotnullableEnumInteger.Value!.Value!, requiredNotnullableEnumIntegerOnly.Value!.Value!, requiredNotnullableEnumString.Value!.Value!, requiredNotnullableOuterEnumDefaultValue.Value!.Value!, requiredNotnullableStringProp.Value!, requiredNotnullableUuid.Value!.Value!, requiredNotnullableintegerProp.Value!.Value!, requiredNullableArrayOfString.Value!, requiredNullableBooleanProp.Value!, requiredNullableDateProp.Value!, requiredNullableDatetimeProp.Value!, requiredNullableEnumInteger.Value!, requiredNullableEnumIntegerOnly.Value!, requiredNullableEnumString.Value!, requiredNullableIntegerProp.Value!, requiredNullableOuterEnumDefaultValue.Value!, requiredNullableStringProp.Value!, requiredNullableUuid.Value!, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid); + return new RequiredClass(requiredNotNullableDateProp.Value!.Value!, requiredNotnullableArrayOfString.Value!, requiredNotnullableBooleanProp.Value!.Value!, requiredNotnullableDatetimeProp.Value!.Value!, requiredNotnullableEnumInteger.Value!.Value!, requiredNotnullableEnumIntegerOnly.Value!.Value!, requiredNotnullableEnumString.Value!.Value!, requiredNotnullableOuterEnumDefaultValue.Value!.Value!, requiredNotnullableStringProp.Value!, requiredNotnullableUuid.Value!.Value!, requiredNotnullableintegerProp.Value!.Value!, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid, requiredNullableArrayOfString.Value!, requiredNullableBooleanProp.Value!, requiredNullableDateProp.Value!, requiredNullableDatetimeProp.Value!, requiredNullableEnumInteger.Value!, requiredNullableEnumIntegerOnly.Value!, requiredNullableEnumString.Value!, requiredNullableIntegerProp.Value!, requiredNullableOuterEnumDefaultValue.Value!, requiredNullableStringProp.Value!, requiredNullableUuid.Value!); } /// @@ -2158,7 +2158,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, requiredClass, jsonSerializerOptions); + WriteProperties(writer, requiredClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -2169,7 +2169,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) { if (requiredClass.RequiredNotnullableArrayOfString == null) throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); @@ -2206,70 +2206,6 @@ namespace Org.OpenAPITools.Model writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); - if (requiredClass.RequiredNullableArrayOfString != null) - { - writer.WritePropertyName("required_nullable_array_of_string"); - JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); - } - else - writer.WriteNull("required_nullable_array_of_string"); - if (requiredClass.RequiredNullableBooleanProp != null) - writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); - else - writer.WriteNull("required_nullable_boolean_prop"); - - if (requiredClass.RequiredNullableDateProp != null) - writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); - else - writer.WriteNull("required_nullable_date_prop"); - - if (requiredClass.RequiredNullableDatetimeProp != null) - writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); - else - writer.WriteNull("required_nullable_datetime_prop"); - - if (requiredClass.RequiredNullableEnumInteger != null) - writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); - else - writer.WriteNull("required_nullable_enum_integer"); - - if (requiredClass.RequiredNullableEnumIntegerOnly != null) - writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); - else - writer.WriteNull("required_nullable_enum_integer_only"); - - var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString!.Value); - if (requiredNullableEnumStringRawValue != null) - writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); - else - writer.WriteNull("required_nullable_enum_string"); - - if (requiredClass.RequiredNullableIntegerProp != null) - writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); - else - writer.WriteNull("required_nullable_integer_prop"); - - if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - else - { - var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); - else - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - } - - if (requiredClass.RequiredNullableStringProp != null) - writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); - else - writer.WriteNull("required_nullable_string_prop"); - - if (requiredClass.RequiredNullableUuid != null) - writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); - else - writer.WriteNull("required_nullable_uuid"); - if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value!.Value.ToString(NotRequiredNotnullableDatePropFormat)); @@ -2375,6 +2311,70 @@ namespace Org.OpenAPITools.Model writer.WriteString("notrequired_nullable_uuid", requiredClass.NotrequiredNullableUuidOption.Value!.Value); else writer.WriteNull("notrequired_nullable_uuid"); + + if (requiredClass.RequiredNullableArrayOfString != null) + { + writer.WritePropertyName("required_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("required_nullable_array_of_string"); + if (requiredClass.RequiredNullableBooleanProp != null) + writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); + else + writer.WriteNull("required_nullable_boolean_prop"); + + if (requiredClass.RequiredNullableDateProp != null) + writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); + else + writer.WriteNull("required_nullable_date_prop"); + + if (requiredClass.RequiredNullableDatetimeProp != null) + writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); + else + writer.WriteNull("required_nullable_datetime_prop"); + + if (requiredClass.RequiredNullableEnumInteger != null) + writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); + else + writer.WriteNull("required_nullable_enum_integer"); + + if (requiredClass.RequiredNullableEnumIntegerOnly != null) + writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); + else + writer.WriteNull("required_nullable_enum_integer_only"); + + var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString!.Value); + if (requiredNullableEnumStringRawValue != null) + writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); + else + writer.WriteNull("required_nullable_enum_string"); + + if (requiredClass.RequiredNullableIntegerProp != null) + writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); + else + writer.WriteNull("required_nullable_integer_prop"); + + if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + else + { + var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); + else + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + } + + if (requiredClass.RequiredNullableStringProp != null) + writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); + else + writer.WriteNull("required_nullable_string_prop"); + + if (requiredClass.RequiredNullableUuid != null) + writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); + else + writer.WriteNull("required_nullable_uuid"); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs index f1be8615789..858b9afb4f5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, varReturn, jsonSerializerOptions); + WriteProperties(writer, varReturn, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) { if (varReturn.Lock == null) throw new ArgumentNullException(nameof(varReturn.Lock), "Property is required for class Return."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 6bd85b0b2fb..a542e79114b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHash.RoleOption.IsSet && rolesReportsHash.Role == null) throw new ArgumentNullException(nameof(rolesReportsHash.Role), "Property is required for class RolesReportsHash."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index b25f95d28d9..b7e2f743a1d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHashRole.NameOption.IsSet && rolesReportsHashRole.Name == null) throw new ArgumentNullException(nameof(rolesReportsHashRole.Name), "Property is required for class RolesReportsHashRole."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 4cdb6d4aa46..3cec323bc5d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, scaleneTriangle, jsonSerializerOptions); + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) { if (scaleneTriangle.ShapeType == null) throw new ArgumentNullException(nameof(scaleneTriangle.ShapeType), "Property is required for class ScaleneTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Shape.cs index a8043ce2c4c..c19f3a8af06 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Shape.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Triangle triangle, string shapeType) + public Shape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Quadrilateral quadrilateral, string shapeType) + public Shape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -67,12 +63,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -87,7 +77,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Shape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -202,10 +191,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); if (quadrilateral != null) - return new Shape(quadrilateral, shapeType.Value!); + return new Shape(quadrilateral); if (triangle != null) - return new Shape(triangle, shapeType.Value!); + return new Shape(triangle); throw new JsonException(); } @@ -223,15 +212,15 @@ namespace Org.OpenAPITools.Model if (shape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } if (shape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shape, jsonSerializerOptions); + WriteProperties(writer, shape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -242,12 +231,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) { - if (shape.ShapeType == null) - throw new ArgumentNullException(nameof(shape.ShapeType), "Property is required for class Shape."); - writer.WriteString("shapeType", shape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeInterface.cs index 2780ac574a8..449c74ed596 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, shapeInterface, jsonSerializerOptions); + WriteProperties(writer, shapeInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) { if (shapeInterface.ShapeType == null) throw new ArgumentNullException(nameof(shapeInterface.ShapeType), "Property is required for class ShapeInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d05ff4a70d7..e6d8735bd1b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Triangle triangle, string shapeType) + public ShapeOrNull(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Quadrilateral quadrilateral, string shapeType) + public ShapeOrNull(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -67,12 +63,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -87,7 +77,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class ShapeOrNull {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -202,10 +191,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); if (quadrilateral != null) - return new ShapeOrNull(quadrilateral, shapeType.Value!); + return new ShapeOrNull(quadrilateral); if (triangle != null) - return new ShapeOrNull(triangle, shapeType.Value!); + return new ShapeOrNull(triangle); throw new JsonException(); } @@ -223,15 +212,15 @@ namespace Org.OpenAPITools.Model if (shapeOrNull.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shapeOrNull.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } if (shapeOrNull.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shapeOrNull, jsonSerializerOptions); + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); writer.WriteEndObject(); } @@ -242,12 +231,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) { - if (shapeOrNull.ShapeType == null) - throw new ArgumentNullException(nameof(shapeOrNull.ShapeType), "Property is required for class ShapeOrNull."); - writer.WriteString("shapeType", shapeOrNull.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 279d0b1faa0..1ccbce2b791 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, simpleQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (simpleQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(simpleQuadrilateral.QuadrilateralType), "Property is required for class SimpleQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs index 4d20d3fb6e1..3af779a4e60 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, specialModelName, jsonSerializerOptions); + WriteProperties(writer, specialModelName, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) { if (specialModelName.VarSpecialModelNameOption.IsSet && specialModelName.VarSpecialModelName == null) throw new ArgumentNullException(nameof(specialModelName.VarSpecialModelName), "Property is required for class SpecialModelName."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs index e2b68cf0ef2..8878770aede 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, tag, jsonSerializerOptions); + WriteProperties(writer, tag, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) { if (tag.NameOption.IsSet && tag.Name == null) throw new ArgumentNullException(nameof(tag.Name), "Property is required for class Tag."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 8906009c84e..9b7baf9d290 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordList, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordList.ValueOption.IsSet && testCollectionEndingWithWordList.Value == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList.Value), "Property is required for class TestCollectionEndingWithWordList."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 9fc973037f6..1ec54dc3f9a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet && testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index d4ebe81bb05..b1ff0c9f49d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) { if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet && testInlineFreeformAdditionalPropertiesRequest.SomeProperty == null) throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest.SomeProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Triangle.cs index 303afee787d..4d8f03d60a0 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Triangle.cs @@ -35,11 +35,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(EquilateralTriangle equilateralTriangle, string triangleType) + public Triangle(EquilateralTriangle equilateralTriangle) { EquilateralTriangle = equilateralTriangle; - TriangleType = triangleType; OnCreated(); } @@ -47,11 +45,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(IsoscelesTriangle isoscelesTriangle, string triangleType) + public Triangle(IsoscelesTriangle isoscelesTriangle) { IsoscelesTriangle = isoscelesTriangle; - TriangleType = triangleType; OnCreated(); } @@ -59,11 +55,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(ScaleneTriangle scaleneTriangle, string triangleType) + public Triangle(ScaleneTriangle scaleneTriangle) { ScaleneTriangle = scaleneTriangle; - TriangleType = triangleType; OnCreated(); } @@ -84,12 +78,6 @@ namespace Org.OpenAPITools.Model /// public ScaleneTriangle? ScaleneTriangle { get; set; } - /// - /// Gets or Sets TriangleType - /// - [JsonPropertyName("triangleType")] - public string TriangleType { get; set; } - /// /// Gets or Sets additional properties /// @@ -104,7 +92,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Triangle {\n"); - sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -225,13 +212,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); if (equilateralTriangle != null) - return new Triangle(equilateralTriangle, triangleType.Value!); + return new Triangle(equilateralTriangle); if (isoscelesTriangle != null) - return new Triangle(isoscelesTriangle, triangleType.Value!); + return new Triangle(isoscelesTriangle); if (scaleneTriangle != null) - return new Triangle(scaleneTriangle, triangleType.Value!); + return new Triangle(scaleneTriangle); throw new JsonException(); } @@ -249,20 +236,20 @@ namespace Org.OpenAPITools.Model if (triangle.EquilateralTriangle != null) { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); - equilateralTriangleJsonConverter.WriteProperties(ref writer, triangle.EquilateralTriangle, jsonSerializerOptions); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } if (triangle.IsoscelesTriangle != null) { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); - isoscelesTriangleJsonConverter.WriteProperties(ref writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } if (triangle.ScaleneTriangle != null) { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); - scaleneTriangleJsonConverter.WriteProperties(ref writer, triangle.ScaleneTriangle, jsonSerializerOptions); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } - WriteProperties(ref writer, triangle, jsonSerializerOptions); + WriteProperties(writer, triangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -273,12 +260,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) { - if (triangle.TriangleType == null) - throw new ArgumentNullException(nameof(triangle.TriangleType), "Property is required for class Triangle."); - writer.WriteString("triangleType", triangle.TriangleType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TriangleInterface.cs index f5bb5d307c8..056926c5eda 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, triangleInterface, jsonSerializerOptions); + WriteProperties(writer, triangleInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -160,7 +160,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) { if (triangleInterface.TriangleType == null) throw new ArgumentNullException(nameof(triangleInterface.TriangleType), "Property is required for class TriangleInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs index 2fa45a9c00a..384fc9e1cc5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs @@ -408,7 +408,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, user, jsonSerializerOptions); + WriteProperties(writer, user, jsonSerializerOptions); writer.WriteEndObject(); } @@ -419,7 +419,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) { if (user.EmailOption.IsSet && user.Email == null) throw new ArgumentNullException(nameof(user.Email), "Property is required for class User."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs index 6f1ab62d256..b30219575b8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, whale, jsonSerializerOptions); + WriteProperties(writer, whale, jsonSerializerOptions); writer.WriteEndObject(); } @@ -208,7 +208,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) { if (whale.ClassName == null) throw new ArgumentNullException(nameof(whale.ClassName), "Property is required for class Whale."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Zebra.cs index 92726ea411e..06b58fe1955 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Zebra.cs @@ -254,7 +254,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zebra, jsonSerializerOptions); + WriteProperties(writer, zebra, jsonSerializerOptions); writer.WriteEndObject(); } @@ -265,7 +265,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) { if (zebra.ClassName == null) throw new ArgumentNullException(nameof(zebra.ClassName), "Property is required for class Zebra."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 3c4832e9a36..bb38eafb468 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zeroBasedEnumClass, jsonSerializerOptions); + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -232,7 +232,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) { var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value!.Value); writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 82d2a297384..2fa1be128cc 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/README.md index e1181306145..e9440f04b95 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/README.md @@ -179,7 +179,6 @@ Authentication schemes defined for the API: - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs index 57169a68de3..906cd993717 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -266,6 +266,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Apple.cs index e933186d8e0..c887090b6ca 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Apple.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.KindOption.IsSet && apple.Kind == null) throw new ArgumentNullException(nameof(apple.Kind), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs index 102dc422c2e..ad5d19ad12d 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.CountOption.IsSet) writer.WriteNumber("count", banana.CountOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs index bd718d56cbe..c39e0c72912 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -204,7 +204,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 82d2a297384..2fa1be128cc 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/README.md index f99d3ae5d09..5fcead230b8 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/README.md @@ -133,7 +133,6 @@ Endpoints do not require authorization. - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES index 0c900b9c260..a94acc41bff 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/.openapi-generator/FILES @@ -54,6 +54,7 @@ docs/models/List.md docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md +docs/models/MixLog.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md docs/models/Model200Response.md docs/models/ModelClient.md @@ -184,6 +185,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**FormulaVersionDate** | **DateTime** | | +**Id** | **Guid** | | +**MixDate** | **DateTime** | | +**TotalOverPoors** | **int** | | +**TotalRecalculations** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] +**ShopId** | **Guid** | | [optional] +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**TotalPrice** | **float** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/RequiredClass.md index bbdf6d8407b..990aeb5de3d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/RequiredClass.md +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/RequiredClass.md @@ -15,17 +15,6 @@ Name | Type | Description | Notes **RequiredNotnullableStringProp** | **string** | | **RequiredNotnullableUuid** | **Guid** | | **RequiredNotnullableintegerProp** | **int** | | -**RequiredNullableArrayOfString** | **List<string>** | | -**RequiredNullableBooleanProp** | **bool** | | -**RequiredNullableDateProp** | **DateOnly** | | -**RequiredNullableDatetimeProp** | **DateTime** | | -**RequiredNullableEnumInteger** | **int** | | -**RequiredNullableEnumIntegerOnly** | **int** | | -**RequiredNullableEnumString** | **string** | | -**RequiredNullableIntegerProp** | **int** | | -**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | -**RequiredNullableStringProp** | **string** | | -**RequiredNullableUuid** | **Guid** | | **NotRequiredNotnullableDateProp** | **DateOnly** | | [optional] **NotRequiredNotnullableintegerProp** | **int** | | [optional] **NotRequiredNullableDateProp** | **DateOnly** | | [optional] @@ -48,6 +37,17 @@ Name | Type | Description | Notes **NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] **NotrequiredNullableStringProp** | **string** | | [optional] **NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateOnly** | | +**RequiredNullableDatetimeProp** | **DateTime** | | +**RequiredNullableEnumInteger** | **int** | | +**RequiredNullableEnumIntegerOnly** | **int** | | +**RequiredNullableEnumString** | **string** | | +**RequiredNullableIntegerProp** | **int** | | +**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNullableStringProp** | **string** | | +**RequiredNullableUuid** | **Guid** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index f5c8415481d..e982dbf36e3 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -121,6 +121,16 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + /// /// Test TestBodyWithFileSchema /// @@ -257,5 +267,15 @@ namespace Org.OpenAPITools.Test.Api Client.Option notRequiredNullable = default; await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); } + + /// + /// Test TestStringMapReference + /// + [Fact (Skip = "not implemented")] + public async Task TestStringMapReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestStringMapReferenceAsync(requestBody); + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index d29d1dfd846..a866bfbe242 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index 210069f6ad3..55086a7cf24 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 164baa8862b..b658f317f1c 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarByte' + /// Test the property 'Byte' /// [Fact] - public void VarByteTest() + public void ByteTest() { - // TODO unit test for the property 'VarByte' + // TODO unit test for the property 'Byte' } /// @@ -108,30 +108,30 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarDecimal' + /// Test the property 'Decimal' /// [Fact] - public void VarDecimalTest() + public void DecimalTest() { - // TODO unit test for the property 'VarDecimal' + // TODO unit test for the property 'Decimal' } /// - /// Test the property 'VarDouble' + /// Test the property 'Double' /// [Fact] - public void VarDoubleTest() + public void DoubleTest() { - // TODO unit test for the property 'VarDouble' + // TODO unit test for the property 'Double' } /// - /// Test the property 'VarFloat' + /// Test the property 'Float' /// [Fact] - public void VarFloatTest() + public void FloatTest() { - // TODO unit test for the property 'VarFloat' + // TODO unit test for the property 'Float' } /// @@ -189,12 +189,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs deleted file mode 100644 index e27750c9c1f..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedEnumType - //private MixedEnumType instance; - - public MixedEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedEnumType - //instance = new MixedEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedEnumType - /// - [Fact] - public void MixedEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs deleted file mode 100644 index 1513de7a320..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedNullableEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedNullableEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedNullableEnumType - //private MixedNullableEnumType instance; - - public MixedNullableEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedNullableEnumType - //instance = new MixedNullableEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedNullableEnumType - /// - [Fact] - public void MixedNullableEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedNullableEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs deleted file mode 100644 index 2ed728a41b8..00000000000 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedSubId - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedSubIdTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedSubId - //private MixedSubId instance; - - public MixedSubIdTests() - { - // TODO uncomment below to create an instance of MixedSubId - //instance = new MixedSubId(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedSubId - /// - [Fact] - public void MixedSubIdInstanceTest() - { - // TODO uncomment below to test "IsType" MixedSubId - //Assert.IsType(instance); - } - - /// - /// Test the property 'Id' - /// - [Fact] - public void IdTest() - { - // TODO unit test for the property 'Id' - } - } -} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index fda0e5b588c..3b5e94c5f8f 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs index e5186391592..d1da68281ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'RequiredNotnullableintegerProp' } - /// - /// Test the property 'RequiredNullableArrayOfString' - /// - [Fact] - public void RequiredNullableArrayOfStringTest() - { - // TODO unit test for the property 'RequiredNullableArrayOfString' - } - - /// - /// Test the property 'RequiredNullableBooleanProp' - /// - [Fact] - public void RequiredNullableBooleanPropTest() - { - // TODO unit test for the property 'RequiredNullableBooleanProp' - } - - /// - /// Test the property 'RequiredNullableDateProp' - /// - [Fact] - public void RequiredNullableDatePropTest() - { - // TODO unit test for the property 'RequiredNullableDateProp' - } - - /// - /// Test the property 'RequiredNullableDatetimeProp' - /// - [Fact] - public void RequiredNullableDatetimePropTest() - { - // TODO unit test for the property 'RequiredNullableDatetimeProp' - } - - /// - /// Test the property 'RequiredNullableEnumInteger' - /// - [Fact] - public void RequiredNullableEnumIntegerTest() - { - // TODO unit test for the property 'RequiredNullableEnumInteger' - } - - /// - /// Test the property 'RequiredNullableEnumIntegerOnly' - /// - [Fact] - public void RequiredNullableEnumIntegerOnlyTest() - { - // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' - } - - /// - /// Test the property 'RequiredNullableEnumString' - /// - [Fact] - public void RequiredNullableEnumStringTest() - { - // TODO unit test for the property 'RequiredNullableEnumString' - } - - /// - /// Test the property 'RequiredNullableIntegerProp' - /// - [Fact] - public void RequiredNullableIntegerPropTest() - { - // TODO unit test for the property 'RequiredNullableIntegerProp' - } - - /// - /// Test the property 'RequiredNullableOuterEnumDefaultValue' - /// - [Fact] - public void RequiredNullableOuterEnumDefaultValueTest() - { - // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' - } - - /// - /// Test the property 'RequiredNullableStringProp' - /// - [Fact] - public void RequiredNullableStringPropTest() - { - // TODO unit test for the property 'RequiredNullableStringProp' - } - - /// - /// Test the property 'RequiredNullableUuid' - /// - [Fact] - public void RequiredNullableUuidTest() - { - // TODO unit test for the property 'RequiredNullableUuid' - } - /// /// Test the property 'NotRequiredNotnullableDateProp' /// @@ -448,5 +349,104 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'NotrequiredNullableUuid' } + + /// + /// Test the property 'RequiredNullableArrayOfString' + /// + [Fact] + public void RequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNullableArrayOfString' + } + + /// + /// Test the property 'RequiredNullableBooleanProp' + /// + [Fact] + public void RequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNullableBooleanProp' + } + + /// + /// Test the property 'RequiredNullableDateProp' + /// + [Fact] + public void RequiredNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNullableDateProp' + } + + /// + /// Test the property 'RequiredNullableDatetimeProp' + /// + [Fact] + public void RequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNullableEnumInteger' + /// + [Fact] + public void RequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNullableEnumInteger' + } + + /// + /// Test the property 'RequiredNullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNullableEnumString' + /// + [Fact] + public void RequiredNullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNullableEnumString' + } + + /// + /// Test the property 'RequiredNullableIntegerProp' + /// + [Fact] + public void RequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'RequiredNullableIntegerProp' + } + + /// + /// Test the property 'RequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNullableStringProp' + /// + [Fact] + public void RequiredNullableStringPropTest() + { + // TODO unit test for the property 'RequiredNullableStringProp' + } + + /// + /// Test the property 'RequiredNullableUuid' + /// + [Fact] + public void RequiredNullableUuidTest() + { + // TODO unit test for the property 'RequiredNullableUuid' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 18474c10e19..bbea79ed951 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model //Assert.IsType(instance); } + /// + /// Test the property 'Lock' + /// + [Fact] + public void LockTest() + { + // TODO unit test for the property 'Lock' + } + + /// + /// Test the property 'Abstract' + /// + [Fact] + public void AbstractTest() + { + // TODO unit test for the property 'Abstract' + } + /// /// Test the property 'VarReturn' /// @@ -61,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'VarReturn' } + + /// + /// Test the property 'Unsafe' + /// + [Fact] + public void UnsafeTest() + { + // TODO unit test for the property 'Unsafe' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs index a3bedb42929..730ac69a333 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -204,12 +204,6 @@ namespace Org.OpenAPITools.Client return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); - if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) - return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) - return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) - return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) @@ -222,6 +216,12 @@ namespace Org.OpenAPITools.Client return RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.NotrequiredNullableEnumStringEnum requiredClassNotrequiredNullableEnumStringEnum) return RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClassNotrequiredNullableEnumStringEnum); + if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) + return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) + return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is Zebra.TypeEnum zebraTypeEnum) return Zebra.TypeEnumToJsonValue(zebraTypeEnum); if (obj is ZeroBasedEnum zeroBasedEnum) @@ -359,6 +359,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs index 063d20ae7ac..968f832b045 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -86,6 +86,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs index 2ed0cacfe1e..b746b781c3e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activity, jsonSerializerOptions); + WriteProperties(writer, activity, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) { if (activity.ActivityOutputsOption.IsSet && activity.ActivityOutputs == null) throw new ArgumentNullException(nameof(activity.ActivityOutputs), "Property is required for class Activity."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index e51af3a1a80..3afdabfc6d5 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activityOutputElementRepresentation, jsonSerializerOptions); + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) { if (activityOutputElementRepresentation.Prop1Option.IsSet && activityOutputElementRepresentation.Prop1 == null) throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop1), "Property is required for class ActivityOutputElementRepresentation."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8aecec6328e..b422890b171 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -318,7 +318,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, additionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -329,7 +329,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (additionalPropertiesClass.EmptyMapOption.IsSet && additionalPropertiesClass.EmptyMap == null) throw new ArgumentNullException(nameof(additionalPropertiesClass.EmptyMap), "Property is required for class AdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Animal.cs index 700f201cf89..aea74905748 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -32,12 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, Option color = default) + public Animal(Option color = default) { - ClassName = className; ColorOption = color; OnCreated(); } @@ -45,10 +43,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets ClassName + /// The discriminator /// - [JsonPropertyName("className")] - public string ClassName { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; /// /// Used to track the state of Color @@ -77,7 +76,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); @@ -130,6 +128,14 @@ namespace Org.OpenAPITools.Model Option className = default; Option color = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "className"); + + if (discriminator != null && discriminator.Equals("Cat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Dog")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -166,7 +172,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); - return new Animal(className.Value, color); + return new Animal(color); } /// @@ -178,9 +184,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { + if (animal is Cat cat){ + JsonSerializer.Serialize(writer, cat, jsonSerializerOptions); + return; + } + + if (animal is Dog dog){ + JsonSerializer.Serialize(writer, dog, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, animal, jsonSerializerOptions); + WriteProperties(writer, animal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -191,11 +207,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { - if (animal.ClassName == null) - throw new ArgumentNullException(nameof(animal.ClassName), "Property is required for class Animal."); - if (animal.ColorOption.IsSet && animal.Color == null) throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 84fa6eef72c..02c11a9a77e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apiResponse, jsonSerializerOptions); + WriteProperties(writer, apiResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) { if (apiResponse.MessageOption.IsSet && apiResponse.Message == null) throw new ArgumentNullException(nameof(apiResponse.Message), "Property is required for class ApiResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 233ec205fd3..59e078d0a8d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -227,7 +227,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -238,7 +238,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.ColorCodeOption.IsSet && apple.ColorCode == null) throw new ArgumentNullException(nameof(apple.ColorCode), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index eccab20bd13..9801b197763 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, appleReq, jsonSerializerOptions); + WriteProperties(writer, appleReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) { if (appleReq.Cultivar == null) throw new ArgumentNullException(nameof(appleReq.Cultivar), "Property is required for class AppleReq."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 2935b372eee..7decd736dd6 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet && arrayOfArrayOfNumberOnly.ArrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfArrayOfNumberOnly.ArrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 1e028acb226..d9c4bbd05e4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfNumberOnly.ArrayNumberOption.IsSet && arrayOfNumberOnly.ArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfNumberOnly.ArrayNumber), "Property is required for class ArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index f0990197e1d..0d5cf364c0b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -200,7 +200,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayTest, jsonSerializerOptions); + WriteProperties(writer, arrayTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -211,7 +211,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) { if (arrayTest.ArrayArrayOfIntegerOption.IsSet && arrayTest.ArrayArrayOfInteger == null) throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfInteger), "Property is required for class ArrayTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 773f3d09bf9..5deb7b3cabb 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.LengthCmOption.IsSet) writer.WriteNumber("lengthCm", banana.LengthCmOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index d8b91e33ae2..1ead980e60a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, bananaReq, jsonSerializerOptions); + WriteProperties(writer, bananaReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) { writer.WriteNumber("lengthCm", bananaReq.LengthCm); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 53c20a25cd1..863cc82bc78 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, basquePig, jsonSerializerOptions); + WriteProperties(writer, basquePig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) { if (basquePig.ClassName == null) throw new ArgumentNullException(nameof(basquePig.ClassName), "Property is required for class BasquePig."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index fe9e72647b7..5ee27d790d1 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, capitalization, jsonSerializerOptions); + WriteProperties(writer, capitalization, jsonSerializerOptions); writer.WriteEndObject(); } @@ -278,7 +278,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) { if (capitalization.ATT_NAMEOption.IsSet && capitalization.ATT_NAME == null) throw new ArgumentNullException(nameof(capitalization.ATT_NAME), "Property is required for class Capitalization."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs index b60c6b69a4e..33d826fa7ea 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") /// declawed [JsonConstructor] - public Cat(string className, Option color = default, Option declawed = default) : base(className, color) + public Cat(Option color = default, Option declawed = default) : base(color) { DeclawedOption = declawed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Cat"; + /// /// Used to track the state of Declawed /// @@ -141,7 +147,7 @@ namespace Org.OpenAPITools.Model if (declawed.IsSet && declawed.Value == null) throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); - return new Cat(className.Value, color, declawed); + return new Cat(color, declawed); } /// @@ -155,7 +161,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, cat, jsonSerializerOptions); + WriteProperties(writer, cat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,11 +172,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) { - if (cat.ClassName == null) - throw new ArgumentNullException(nameof(cat.ClassName), "Property is required for class Cat."); - if (cat.ColorOption.IsSet && cat.Color == null) throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs index a880d914ef0..646d804623a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, category, jsonSerializerOptions); + WriteProperties(writer, category, jsonSerializerOptions); writer.WriteEndObject(); } @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) { if (category.Name == null) throw new ArgumentNullException(nameof(category.Name), "Property is required for class Category."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 4c6932c5672..af2778ca546 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -33,12 +33,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// name - /// petType (default to PetTypeEnum.ChildCat) [JsonConstructor] - public ChildCat(Option name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType)) + public ChildCat(Option name = default) : base() { NameOption = name; - PetType = petType; OnCreated(); } @@ -96,12 +94,6 @@ namespace Org.OpenAPITools.Model throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Gets or Sets PetType - /// - [JsonPropertyName("pet_type")] - public new PetTypeEnum PetType { get; set; } - /// /// Used to track the state of Name /// @@ -115,6 +107,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("name")] public string Name { get { return this.NameOption; } set { this.NameOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new PetTypeEnum PetType { get; } = (PetTypeEnum)Enum.Parse(typeof(PetTypeEnum), "ChildCat"); + /// /// Returns the string presentation of the object /// @@ -125,7 +124,6 @@ namespace Org.OpenAPITools.Model sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -194,7 +192,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); - return new ChildCat(name, petType.Value.Value); + return new ChildCat(name); } /// @@ -208,7 +206,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, childCat, jsonSerializerOptions); + WriteProperties(writer, childCat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -219,7 +217,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) { if (childCat.NameOption.IsSet && childCat.Name == null) throw new ArgumentNullException(nameof(childCat.Name), "Property is required for class ChildCat."); @@ -227,8 +225,7 @@ namespace Org.OpenAPITools.Model if (childCat.NameOption.IsSet) writer.WriteString("name", childCat.Name); - var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType); - writer.WriteString("pet_type", petTypeRawValue); + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index 31f98f66f50..3740f80f7c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, classModel, jsonSerializerOptions); + WriteProperties(writer, classModel, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) { if (classModel.ClassOption.IsSet && classModel.Class == null) throw new ArgumentNullException(nameof(classModel.Class), "Property is required for class ClassModel."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 747b36ec65b..1a42f967ca9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, complexQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (complexQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(complexQuadrilateral.QuadrilateralType), "Property is required for class ComplexQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index c28634e4e13..9eb8b733358 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, danishPig, jsonSerializerOptions); + WriteProperties(writer, danishPig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) { if (danishPig.ClassName == null) throw new ArgumentNullException(nameof(danishPig.ClassName), "Property is required for class DanishPig."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 7d7789e3d8d..4f3c74c26d9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dateOnlyClass, jsonSerializerOptions); + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) { if (dateOnlyClass.DateOnlyPropertyOption.IsSet) writer.WriteString("dateOnlyProperty", dateOnlyClass.DateOnlyPropertyOption.Value.Value.ToString(DateOnlyPropertyFormat)); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 2db62c460fc..1ffcd1e09a8 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, deprecatedObject, jsonSerializerOptions); + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) { if (deprecatedObject.NameOption.IsSet && deprecatedObject.Name == null) throw new ArgumentNullException(nameof(deprecatedObject.Name), "Property is required for class DeprecatedObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Dog.cs index cafd49dfda8..ee6d230b265 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// breed /// color (default to "red") [JsonConstructor] - public Dog(string className, Option breed = default, Option color = default) : base(className, color) + public Dog(Option breed = default, Option color = default) : base(color) { BreedOption = breed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Dog"; + /// /// Used to track the state of Breed /// @@ -140,7 +146,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); - return new Dog(className.Value, breed, color); + return new Dog(breed, color); } /// @@ -154,7 +160,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dog, jsonSerializerOptions); + WriteProperties(writer, dog, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,11 +171,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) { - if (dog.ClassName == null) - throw new ArgumentNullException(nameof(dog.ClassName), "Property is required for class Dog."); - if (dog.BreedOption.IsSet && dog.Breed == null) throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 29aaebc2075..e5f2fb7e025 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, drawing, jsonSerializerOptions); + WriteProperties(writer, drawing, jsonSerializerOptions); writer.WriteEndObject(); } @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) { if (drawing.MainShapeOption.IsSet && drawing.MainShape == null) throw new ArgumentNullException(nameof(drawing.MainShape), "Property is required for class Drawing."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 06bce62a389..5a16d41c18a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -309,7 +309,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumArrays, jsonSerializerOptions); + WriteProperties(writer, enumArrays, jsonSerializerOptions); writer.WriteEndObject(); } @@ -320,7 +320,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) { if (enumArrays.ArrayEnumOption.IsSet && enumArrays.ArrayEnum == null) throw new ArgumentNullException(nameof(enumArrays.ArrayEnum), "Property is required for class EnumArrays."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 9fadfdcbf35..7d899ce5232 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -827,7 +827,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumTest, jsonSerializerOptions); + WriteProperties(writer, enumTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -838,7 +838,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) { var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); writer.WriteString("enum_string_required", enumStringRequiredRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index bbf4bf8f8e0..b84f89b531d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, equilateralTriangle, jsonSerializerOptions); + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) { if (equilateralTriangle.ShapeType == null) throw new ArgumentNullException(nameof(equilateralTriangle.ShapeType), "Property is required for class EquilateralTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/File.cs index dc4ffdfe56b..49cc4b73830 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, file, jsonSerializerOptions); + WriteProperties(writer, file, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) { if (file.SourceURIOption.IsSet && file.SourceURI == null) throw new ArgumentNullException(nameof(file.SourceURI), "Property is required for class File."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 29f6d03ffd0..4c22995b605 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fileSchemaTestClass, jsonSerializerOptions); + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) { if (fileSchemaTestClass.FileOption.IsSet && fileSchemaTestClass.File == null) throw new ArgumentNullException(nameof(fileSchemaTestClass.File), "Property is required for class FileSchemaTestClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 21dba921663..2b59206330a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, foo, jsonSerializerOptions); + WriteProperties(writer, foo, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) { if (foo.BarOption.IsSet && foo.Bar == null) throw new ArgumentNullException(nameof(foo.Bar), "Property is required for class Foo."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 21585e839d6..42d40f715ec 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fooGetDefaultResponse, jsonSerializerOptions); + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) { if (fooGetDefaultResponse.StringOption.IsSet && fooGetDefaultResponse.String == null) throw new ArgumentNullException(nameof(fooGetDefaultResponse.String), "Property is required for class FooGetDefaultResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 24cc7c3f39b..545fe1a83b6 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -703,7 +703,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, formatTest, jsonSerializerOptions); + WriteProperties(writer, formatTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) { if (formatTest.Byte == null) throw new ArgumentNullException(nameof(formatTest.Byte), "Property is required for class FormatTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index 1c491c62a5a..d39d2a29ad8 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 03ef926c47d..f5dd6d56278 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruitReq, jsonSerializerOptions); + WriteProperties(writer, fruitReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index b0ff469057d..95772b5635b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -203,16 +203,16 @@ namespace Org.OpenAPITools.Model if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, gmFruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, gmFruit.AppleOption.Value, jsonSerializerOptions); } if (gmFruit.BananaOption.IsSet && gmFruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, gmFruit, jsonSerializerOptions); + WriteProperties(writer, gmFruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) { if (gmFruit.ColorOption.IsSet && gmFruit.Color == null) throw new ArgumentNullException(nameof(gmFruit.Color), "Property is required for class GmFruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 6b7d7ae8da6..86246ae5457 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -32,21 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public GrandparentAnimal(string petType) + public GrandparentAnimal() { - PetType = petType; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public string PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; /// /// Gets or Sets additional properties @@ -62,7 +61,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -113,6 +111,14 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("ParentPet")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -143,7 +149,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); - return new GrandparentAnimal(petType.Value); + return new GrandparentAnimal(); } /// @@ -155,9 +161,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { + if (grandparentAnimal is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + if (grandparentAnimal is ParentPet parentPet){ + JsonSerializer.Serialize(writer, parentPet, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, grandparentAnimal, jsonSerializerOptions); + WriteProperties(writer, grandparentAnimal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -168,11 +184,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { - if (grandparentAnimal.PetType == null) - throw new ArgumentNullException(nameof(grandparentAnimal.PetType), "Property is required for class GrandparentAnimal."); - writer.WriteString("pet_type", grandparentAnimal.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index a58bd756968..88c5d4274ea 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, hasOnlyReadOnly, jsonSerializerOptions); + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) { if (hasOnlyReadOnly.BarOption.IsSet && hasOnlyReadOnly.Bar == null) throw new ArgumentNullException(nameof(hasOnlyReadOnly.Bar), "Property is required for class HasOnlyReadOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 2c741269251..0c916b0a208 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -148,7 +148,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, healthCheckResult, jsonSerializerOptions); + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) { if (healthCheckResult.NullableMessageOption.IsSet) if (healthCheckResult.NullableMessageOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3f4aa3229c4..384e48f3a15 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, isoscelesTriangle, jsonSerializerOptions); + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) { if (isoscelesTriangle.ShapeType == null) throw new ArgumentNullException(nameof(isoscelesTriangle.ShapeType), "Property is required for class IsoscelesTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/List.cs index cbdf361981b..b4f4f31b7fd 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, list, jsonSerializerOptions); + WriteProperties(writer, list, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) { if (list.Var123ListOption.IsSet && list.Var123List == null) throw new ArgumentNullException(nameof(list.Var123List), "Property is required for class List."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 25c7ef39a73..9e1a7878ad5 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, literalStringClass, jsonSerializerOptions); + WriteProperties(writer, literalStringClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -185,7 +185,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) { if (literalStringClass.EscapedLiteralStringOption.IsSet && literalStringClass.EscapedLiteralString == null) throw new ArgumentNullException(nameof(literalStringClass.EscapedLiteralString), "Property is required for class LiteralStringClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index 05e439a9c3e..1be5661d993 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Whale whale, string className) + public Mammal(Whale whale) { Whale = whale; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Zebra zebra, string className) + public Mammal(Zebra zebra) { Zebra = zebra; - ClassName = className; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Pig pig, string className) + public Mammal(Pig pig) { Pig = pig; - ClassName = className; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public Pig Pig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Mammal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); if (pig != null) - return new Mammal(pig, className.Value); + return new Mammal(pig); if (whale != null) - return new Mammal(whale, className.Value); + return new Mammal(whale); if (zebra != null) - return new Mammal(zebra, className.Value); + return new Mammal(zebra); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (mammal.Whale != null) { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); - whaleJsonConverter.WriteProperties(ref writer, mammal.Whale, jsonSerializerOptions); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } if (mammal.Zebra != null) { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); - zebraJsonConverter.WriteProperties(ref writer, mammal.Zebra, jsonSerializerOptions); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } if (mammal.Pig != null) { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); - pigJsonConverter.WriteProperties(ref writer, mammal.Pig, jsonSerializerOptions); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } - WriteProperties(ref writer, mammal, jsonSerializerOptions); + WriteProperties(writer, mammal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) { - if (mammal.ClassName == null) - throw new ArgumentNullException(nameof(mammal.ClassName), "Property is required for class Mammal."); - writer.WriteString("className", mammal.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 14614620d4e..6fa8d54e7f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mapTest, jsonSerializerOptions); + WriteProperties(writer, mapTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -301,7 +301,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) { if (mapTest.DirectMapOption.IsSet && mapTest.DirectMap == null) throw new ArgumentNullException(nameof(mapTest.DirectMap), "Property is required for class MapTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..44130823a00 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1027 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + public partial class MixLog : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// description + /// formulaVersionDate + /// id + /// mixDate + /// totalOverPoors + /// totalRecalculations + /// totalSkips + /// totalUnderPours + /// batchNumber + /// BrandCode is only required for non-color mixes + /// BrandId is only required for color mixes + /// BrandName is only required for color mixes + /// CategoryCode is not used anymore + /// Color is only required for color mixes + /// colorDescription + /// comment + /// commercialProductCode + /// country + /// createdBy + /// createdByFirstName + /// createdByLastName + /// deltaECalculationRepaired + /// deltaECalculationSprayout + /// ownColorVariantNumber + /// primerProductId + /// ProductId is only required for color mixes + /// ProductLineCode is only required for color mixes + /// ProductName is only required for color mixes + /// selectedVersionIndex + /// shopId + /// SomeCode is only required for color mixes + /// totalPrice + [JsonConstructor] + public MixLog(string description, DateTime formulaVersionDate, Guid id, DateTime mixDate, int totalOverPoors, int totalRecalculations, int totalSkips, int totalUnderPours, Option batchNumber = default, Option brandCode = default, Option brandId = default, Option brandName = default, Option categoryCode = default, Option color = default, Option colorDescription = default, Option comment = default, Option commercialProductCode = default, Option country = default, Option createdBy = default, Option createdByFirstName = default, Option createdByLastName = default, Option deltaECalculationRepaired = default, Option deltaECalculationSprayout = default, Option ownColorVariantNumber = default, Option primerProductId = default, Option productId = default, Option productLineCode = default, Option productName = default, Option selectedVersionIndex = default, Option shopId = default, Option someCode = default, Option totalPrice = default) + { + Description = description; + FormulaVersionDate = formulaVersionDate; + Id = id; + MixDate = mixDate; + TotalOverPoors = totalOverPoors; + TotalRecalculations = totalRecalculations; + TotalSkips = totalSkips; + TotalUnderPours = totalUnderPours; + BatchNumberOption = batchNumber; + BrandCodeOption = brandCode; + BrandIdOption = brandId; + BrandNameOption = brandName; + CategoryCodeOption = categoryCode; + ColorOption = color; + ColorDescriptionOption = colorDescription; + CommentOption = comment; + CommercialProductCodeOption = commercialProductCode; + CountryOption = country; + CreatedByOption = createdBy; + CreatedByFirstNameOption = createdByFirstName; + CreatedByLastNameOption = createdByLastName; + DeltaECalculationRepairedOption = deltaECalculationRepaired; + DeltaECalculationSprayoutOption = deltaECalculationSprayout; + OwnColorVariantNumberOption = ownColorVariantNumber; + PrimerProductIdOption = primerProductId; + ProductIdOption = productId; + ProductLineCodeOption = productLineCode; + ProductNameOption = productName; + SelectedVersionIndexOption = selectedVersionIndex; + ShopIdOption = shopId; + SomeCodeOption = someCode; + TotalPriceOption = totalPrice; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [JsonPropertyName("formulaVersionDate")] + public DateTime FormulaVersionDate { get; set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public Guid Id { get; set; } + + /// + /// Gets or Sets MixDate + /// + [JsonPropertyName("mixDate")] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [JsonPropertyName("totalOverPoors")] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [JsonPropertyName("totalRecalculations")] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [JsonPropertyName("totalSkips")] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [JsonPropertyName("totalUnderPours")] + public int TotalUnderPours { get; set; } + + /// + /// Used to track the state of BatchNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BatchNumberOption { get; private set; } + + /// + /// Gets or Sets BatchNumber + /// + [JsonPropertyName("batchNumber")] + public string BatchNumber { get { return this.BatchNumberOption; } set { this.BatchNumberOption = new(value); } } + + /// + /// Used to track the state of BrandCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandCodeOption { get; private set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [JsonPropertyName("brandCode")] + public string BrandCode { get { return this.BrandCodeOption; } set { this.BrandCodeOption = new(value); } } + + /// + /// Used to track the state of BrandId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandIdOption { get; private set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [JsonPropertyName("brandId")] + public string BrandId { get { return this.BrandIdOption; } set { this.BrandIdOption = new(value); } } + + /// + /// Used to track the state of BrandName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandNameOption { get; private set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [JsonPropertyName("brandName")] + public string BrandName { get { return this.BrandNameOption; } set { this.BrandNameOption = new(value); } } + + /// + /// Used to track the state of CategoryCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryCodeOption { get; private set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [JsonPropertyName("categoryCode")] + public string CategoryCode { get { return this.CategoryCodeOption; } set { this.CategoryCodeOption = new(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new(value); } } + + /// + /// Used to track the state of ColorDescription + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorDescriptionOption { get; private set; } + + /// + /// Gets or Sets ColorDescription + /// + [JsonPropertyName("colorDescription")] + public string ColorDescription { get { return this.ColorDescriptionOption; } set { this.ColorDescriptionOption = new(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string Comment { get { return this.CommentOption; } set { this.CommentOption = new(value); } } + + /// + /// Used to track the state of CommercialProductCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommercialProductCodeOption { get; private set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [JsonPropertyName("commercialProductCode")] + public string CommercialProductCode { get { return this.CommercialProductCodeOption; } set { this.CommercialProductCodeOption = new(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } + + /// + /// Gets or Sets Country + /// + [JsonPropertyName("country")] + public string Country { get { return this.CountryOption; } set { this.CountryOption = new(value); } } + + /// + /// Used to track the state of CreatedBy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByOption { get; private set; } + + /// + /// Gets or Sets CreatedBy + /// + [JsonPropertyName("createdBy")] + public string CreatedBy { get { return this.CreatedByOption; } set { this.CreatedByOption = new(value); } } + + /// + /// Used to track the state of CreatedByFirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByFirstNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [JsonPropertyName("createdByFirstName")] + public string CreatedByFirstName { get { return this.CreatedByFirstNameOption; } set { this.CreatedByFirstNameOption = new(value); } } + + /// + /// Used to track the state of CreatedByLastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByLastNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [JsonPropertyName("createdByLastName")] + public string CreatedByLastName { get { return this.CreatedByLastNameOption; } set { this.CreatedByLastNameOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationRepaired + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationRepairedOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [JsonPropertyName("deltaECalculationRepaired")] + public string DeltaECalculationRepaired { get { return this.DeltaECalculationRepairedOption; } set { this.DeltaECalculationRepairedOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationSprayout + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationSprayoutOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [JsonPropertyName("deltaECalculationSprayout")] + public string DeltaECalculationSprayout { get { return this.DeltaECalculationSprayoutOption; } set { this.DeltaECalculationSprayoutOption = new(value); } } + + /// + /// Used to track the state of OwnColorVariantNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnColorVariantNumberOption { get; private set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [JsonPropertyName("ownColorVariantNumber")] + public int? OwnColorVariantNumber { get { return this.OwnColorVariantNumberOption; } set { this.OwnColorVariantNumberOption = new(value); } } + + /// + /// Used to track the state of PrimerProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PrimerProductIdOption { get; private set; } + + /// + /// Gets or Sets PrimerProductId + /// + [JsonPropertyName("primerProductId")] + public string PrimerProductId { get { return this.PrimerProductIdOption; } set { this.PrimerProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductIdOption { get; private set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [JsonPropertyName("productId")] + public string ProductId { get { return this.ProductIdOption; } set { this.ProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductLineCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductLineCodeOption { get; private set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [JsonPropertyName("productLineCode")] + public string ProductLineCode { get { return this.ProductLineCodeOption; } set { this.ProductLineCodeOption = new(value); } } + + /// + /// Used to track the state of ProductName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductNameOption { get; private set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [JsonPropertyName("productName")] + public string ProductName { get { return this.ProductNameOption; } set { this.ProductNameOption = new(value); } } + + /// + /// Used to track the state of SelectedVersionIndex + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedVersionIndexOption { get; private set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [JsonPropertyName("selectedVersionIndex")] + public int? SelectedVersionIndex { get { return this.SelectedVersionIndexOption; } set { this.SelectedVersionIndexOption = new(value); } } + + /// + /// Used to track the state of ShopId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopIdOption { get; private set; } + + /// + /// Gets or Sets ShopId + /// + [JsonPropertyName("shopId")] + public Guid? ShopId { get { return this.ShopIdOption; } set { this.ShopIdOption = new(value); } } + + /// + /// Used to track the state of SomeCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomeCodeOption { get; private set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [JsonPropertyName("someCode")] + public string SomeCode { get { return this.SomeCodeOption; } set { this.SomeCodeOption = new(value); } } + + /// + /// Used to track the state of TotalPrice + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalPriceOption { get; private set; } + + /// + /// Gets or Sets TotalPrice + /// + [JsonPropertyName("totalPrice")] + public float? TotalPrice { get { return this.TotalPriceOption; } set { this.TotalPriceOption = new(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixLogJsonConverter : JsonConverter + { + /// + /// The format to use to serialize FormulaVersionDate + /// + public static string FormulaVersionDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize MixDate + /// + public static string MixDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixLog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option description = default; + Option formulaVersionDate = default; + Option id = default; + Option mixDate = default; + Option totalOverPoors = default; + Option totalRecalculations = default; + Option totalSkips = default; + Option totalUnderPours = default; + Option batchNumber = default; + Option brandCode = default; + Option brandId = default; + Option brandName = default; + Option categoryCode = default; + Option color = default; + Option colorDescription = default; + Option comment = default; + Option commercialProductCode = default; + Option country = default; + Option createdBy = default; + Option createdByFirstName = default; + Option createdByLastName = default; + Option deltaECalculationRepaired = default; + Option deltaECalculationSprayout = default; + Option ownColorVariantNumber = default; + Option primerProductId = default; + Option productId = default; + Option productLineCode = default; + Option productName = default; + Option selectedVersionIndex = default; + Option shopId = default; + Option someCode = default; + Option totalPrice = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "formulaVersionDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + formulaVersionDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetGuid()); + break; + case "mixDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mixDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalOverPoors": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalOverPoors = new Option(utf8JsonReader.GetInt32()); + break; + case "totalRecalculations": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalRecalculations = new Option(utf8JsonReader.GetInt32()); + break; + case "totalSkips": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalSkips = new Option(utf8JsonReader.GetInt32()); + break; + case "totalUnderPours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalUnderPours = new Option(utf8JsonReader.GetInt32()); + break; + case "batchNumber": + batchNumber = new Option(utf8JsonReader.GetString()); + break; + case "brandCode": + brandCode = new Option(utf8JsonReader.GetString()); + break; + case "brandId": + brandId = new Option(utf8JsonReader.GetString()); + break; + case "brandName": + brandName = new Option(utf8JsonReader.GetString()); + break; + case "categoryCode": + categoryCode = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "colorDescription": + colorDescription = new Option(utf8JsonReader.GetString()); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()); + break; + case "commercialProductCode": + commercialProductCode = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "createdBy": + createdBy = new Option(utf8JsonReader.GetString()); + break; + case "createdByFirstName": + createdByFirstName = new Option(utf8JsonReader.GetString()); + break; + case "createdByLastName": + createdByLastName = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationRepaired": + deltaECalculationRepaired = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationSprayout": + deltaECalculationSprayout = new Option(utf8JsonReader.GetString()); + break; + case "ownColorVariantNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ownColorVariantNumber = new Option(utf8JsonReader.GetInt32()); + break; + case "primerProductId": + primerProductId = new Option(utf8JsonReader.GetString()); + break; + case "productId": + productId = new Option(utf8JsonReader.GetString()); + break; + case "productLineCode": + productLineCode = new Option(utf8JsonReader.GetString()); + break; + case "productName": + productName = new Option(utf8JsonReader.GetString()); + break; + case "selectedVersionIndex": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selectedVersionIndex = new Option(utf8JsonReader.GetInt32()); + break; + case "shopId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopId = new Option(utf8JsonReader.GetGuid()); + break; + case "someCode": + someCode = new Option(utf8JsonReader.GetString()); + break; + case "totalPrice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalPrice = new Option((float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!description.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(description)); + + if (!formulaVersionDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(formulaVersionDate)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(id)); + + if (!mixDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(mixDate)); + + if (!totalOverPoors.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalOverPoors)); + + if (!totalRecalculations.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalRecalculations)); + + if (!totalSkips.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalSkips)); + + if (!totalUnderPours.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalUnderPours)); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class MixLog."); + + if (formulaVersionDate.IsSet && formulaVersionDate.Value == null) + throw new ArgumentNullException(nameof(formulaVersionDate), "Property is not nullable for class MixLog."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixLog."); + + if (mixDate.IsSet && mixDate.Value == null) + throw new ArgumentNullException(nameof(mixDate), "Property is not nullable for class MixLog."); + + if (totalOverPoors.IsSet && totalOverPoors.Value == null) + throw new ArgumentNullException(nameof(totalOverPoors), "Property is not nullable for class MixLog."); + + if (totalRecalculations.IsSet && totalRecalculations.Value == null) + throw new ArgumentNullException(nameof(totalRecalculations), "Property is not nullable for class MixLog."); + + if (totalSkips.IsSet && totalSkips.Value == null) + throw new ArgumentNullException(nameof(totalSkips), "Property is not nullable for class MixLog."); + + if (totalUnderPours.IsSet && totalUnderPours.Value == null) + throw new ArgumentNullException(nameof(totalUnderPours), "Property is not nullable for class MixLog."); + + if (batchNumber.IsSet && batchNumber.Value == null) + throw new ArgumentNullException(nameof(batchNumber), "Property is not nullable for class MixLog."); + + if (brandCode.IsSet && brandCode.Value == null) + throw new ArgumentNullException(nameof(brandCode), "Property is not nullable for class MixLog."); + + if (brandId.IsSet && brandId.Value == null) + throw new ArgumentNullException(nameof(brandId), "Property is not nullable for class MixLog."); + + if (brandName.IsSet && brandName.Value == null) + throw new ArgumentNullException(nameof(brandName), "Property is not nullable for class MixLog."); + + if (categoryCode.IsSet && categoryCode.Value == null) + throw new ArgumentNullException(nameof(categoryCode), "Property is not nullable for class MixLog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class MixLog."); + + if (colorDescription.IsSet && colorDescription.Value == null) + throw new ArgumentNullException(nameof(colorDescription), "Property is not nullable for class MixLog."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class MixLog."); + + if (commercialProductCode.IsSet && commercialProductCode.Value == null) + throw new ArgumentNullException(nameof(commercialProductCode), "Property is not nullable for class MixLog."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class MixLog."); + + if (createdBy.IsSet && createdBy.Value == null) + throw new ArgumentNullException(nameof(createdBy), "Property is not nullable for class MixLog."); + + if (createdByFirstName.IsSet && createdByFirstName.Value == null) + throw new ArgumentNullException(nameof(createdByFirstName), "Property is not nullable for class MixLog."); + + if (createdByLastName.IsSet && createdByLastName.Value == null) + throw new ArgumentNullException(nameof(createdByLastName), "Property is not nullable for class MixLog."); + + if (deltaECalculationRepaired.IsSet && deltaECalculationRepaired.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationRepaired), "Property is not nullable for class MixLog."); + + if (deltaECalculationSprayout.IsSet && deltaECalculationSprayout.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationSprayout), "Property is not nullable for class MixLog."); + + if (primerProductId.IsSet && primerProductId.Value == null) + throw new ArgumentNullException(nameof(primerProductId), "Property is not nullable for class MixLog."); + + if (productId.IsSet && productId.Value == null) + throw new ArgumentNullException(nameof(productId), "Property is not nullable for class MixLog."); + + if (productLineCode.IsSet && productLineCode.Value == null) + throw new ArgumentNullException(nameof(productLineCode), "Property is not nullable for class MixLog."); + + if (productName.IsSet && productName.Value == null) + throw new ArgumentNullException(nameof(productName), "Property is not nullable for class MixLog."); + + if (selectedVersionIndex.IsSet && selectedVersionIndex.Value == null) + throw new ArgumentNullException(nameof(selectedVersionIndex), "Property is not nullable for class MixLog."); + + if (shopId.IsSet && shopId.Value == null) + throw new ArgumentNullException(nameof(shopId), "Property is not nullable for class MixLog."); + + return new MixLog(description.Value, formulaVersionDate.Value.Value, id.Value.Value, mixDate.Value.Value, totalOverPoors.Value.Value, totalRecalculations.Value.Value, totalSkips.Value.Value, totalUnderPours.Value.Value, batchNumber, brandCode, brandId, brandName, categoryCode, color, colorDescription, comment, commercialProductCode, country, createdBy, createdByFirstName, createdByLastName, deltaECalculationRepaired, deltaECalculationSprayout, ownColorVariantNumber, primerProductId, productId, productLineCode, productName, selectedVersionIndex, shopId, someCode, totalPrice); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixLog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + if (mixLog.Description == null) + throw new ArgumentNullException(nameof(mixLog.Description), "Property is required for class MixLog."); + + if (mixLog.BatchNumberOption.IsSet && mixLog.BatchNumber == null) + throw new ArgumentNullException(nameof(mixLog.BatchNumber), "Property is required for class MixLog."); + + if (mixLog.BrandCodeOption.IsSet && mixLog.BrandCode == null) + throw new ArgumentNullException(nameof(mixLog.BrandCode), "Property is required for class MixLog."); + + if (mixLog.BrandIdOption.IsSet && mixLog.BrandId == null) + throw new ArgumentNullException(nameof(mixLog.BrandId), "Property is required for class MixLog."); + + if (mixLog.BrandNameOption.IsSet && mixLog.BrandName == null) + throw new ArgumentNullException(nameof(mixLog.BrandName), "Property is required for class MixLog."); + + if (mixLog.CategoryCodeOption.IsSet && mixLog.CategoryCode == null) + throw new ArgumentNullException(nameof(mixLog.CategoryCode), "Property is required for class MixLog."); + + if (mixLog.ColorOption.IsSet && mixLog.Color == null) + throw new ArgumentNullException(nameof(mixLog.Color), "Property is required for class MixLog."); + + if (mixLog.ColorDescriptionOption.IsSet && mixLog.ColorDescription == null) + throw new ArgumentNullException(nameof(mixLog.ColorDescription), "Property is required for class MixLog."); + + if (mixLog.CommentOption.IsSet && mixLog.Comment == null) + throw new ArgumentNullException(nameof(mixLog.Comment), "Property is required for class MixLog."); + + if (mixLog.CommercialProductCodeOption.IsSet && mixLog.CommercialProductCode == null) + throw new ArgumentNullException(nameof(mixLog.CommercialProductCode), "Property is required for class MixLog."); + + if (mixLog.CountryOption.IsSet && mixLog.Country == null) + throw new ArgumentNullException(nameof(mixLog.Country), "Property is required for class MixLog."); + + if (mixLog.CreatedByOption.IsSet && mixLog.CreatedBy == null) + throw new ArgumentNullException(nameof(mixLog.CreatedBy), "Property is required for class MixLog."); + + if (mixLog.CreatedByFirstNameOption.IsSet && mixLog.CreatedByFirstName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByFirstName), "Property is required for class MixLog."); + + if (mixLog.CreatedByLastNameOption.IsSet && mixLog.CreatedByLastName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByLastName), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationRepairedOption.IsSet && mixLog.DeltaECalculationRepaired == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationRepaired), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet && mixLog.DeltaECalculationSprayout == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationSprayout), "Property is required for class MixLog."); + + if (mixLog.PrimerProductIdOption.IsSet && mixLog.PrimerProductId == null) + throw new ArgumentNullException(nameof(mixLog.PrimerProductId), "Property is required for class MixLog."); + + if (mixLog.ProductIdOption.IsSet && mixLog.ProductId == null) + throw new ArgumentNullException(nameof(mixLog.ProductId), "Property is required for class MixLog."); + + if (mixLog.ProductLineCodeOption.IsSet && mixLog.ProductLineCode == null) + throw new ArgumentNullException(nameof(mixLog.ProductLineCode), "Property is required for class MixLog."); + + if (mixLog.ProductNameOption.IsSet && mixLog.ProductName == null) + throw new ArgumentNullException(nameof(mixLog.ProductName), "Property is required for class MixLog."); + + writer.WriteString("description", mixLog.Description); + + writer.WriteString("formulaVersionDate", mixLog.FormulaVersionDate.ToString(FormulaVersionDateFormat)); + + writer.WriteString("id", mixLog.Id); + + writer.WriteString("mixDate", mixLog.MixDate.ToString(MixDateFormat)); + + writer.WriteNumber("totalOverPoors", mixLog.TotalOverPoors); + + writer.WriteNumber("totalRecalculations", mixLog.TotalRecalculations); + + writer.WriteNumber("totalSkips", mixLog.TotalSkips); + + writer.WriteNumber("totalUnderPours", mixLog.TotalUnderPours); + + if (mixLog.BatchNumberOption.IsSet) + writer.WriteString("batchNumber", mixLog.BatchNumber); + + if (mixLog.BrandCodeOption.IsSet) + writer.WriteString("brandCode", mixLog.BrandCode); + + if (mixLog.BrandIdOption.IsSet) + writer.WriteString("brandId", mixLog.BrandId); + + if (mixLog.BrandNameOption.IsSet) + writer.WriteString("brandName", mixLog.BrandName); + + if (mixLog.CategoryCodeOption.IsSet) + writer.WriteString("categoryCode", mixLog.CategoryCode); + + if (mixLog.ColorOption.IsSet) + writer.WriteString("color", mixLog.Color); + + if (mixLog.ColorDescriptionOption.IsSet) + writer.WriteString("colorDescription", mixLog.ColorDescription); + + if (mixLog.CommentOption.IsSet) + writer.WriteString("comment", mixLog.Comment); + + if (mixLog.CommercialProductCodeOption.IsSet) + writer.WriteString("commercialProductCode", mixLog.CommercialProductCode); + + if (mixLog.CountryOption.IsSet) + writer.WriteString("country", mixLog.Country); + + if (mixLog.CreatedByOption.IsSet) + writer.WriteString("createdBy", mixLog.CreatedBy); + + if (mixLog.CreatedByFirstNameOption.IsSet) + writer.WriteString("createdByFirstName", mixLog.CreatedByFirstName); + + if (mixLog.CreatedByLastNameOption.IsSet) + writer.WriteString("createdByLastName", mixLog.CreatedByLastName); + + if (mixLog.DeltaECalculationRepairedOption.IsSet) + writer.WriteString("deltaECalculationRepaired", mixLog.DeltaECalculationRepaired); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet) + writer.WriteString("deltaECalculationSprayout", mixLog.DeltaECalculationSprayout); + + if (mixLog.OwnColorVariantNumberOption.IsSet) + if (mixLog.OwnColorVariantNumberOption.Value != null) + writer.WriteNumber("ownColorVariantNumber", mixLog.OwnColorVariantNumberOption.Value.Value); + else + writer.WriteNull("ownColorVariantNumber"); + + if (mixLog.PrimerProductIdOption.IsSet) + writer.WriteString("primerProductId", mixLog.PrimerProductId); + + if (mixLog.ProductIdOption.IsSet) + writer.WriteString("productId", mixLog.ProductId); + + if (mixLog.ProductLineCodeOption.IsSet) + writer.WriteString("productLineCode", mixLog.ProductLineCode); + + if (mixLog.ProductNameOption.IsSet) + writer.WriteString("productName", mixLog.ProductName); + + if (mixLog.SelectedVersionIndexOption.IsSet) + writer.WriteNumber("selectedVersionIndex", mixLog.SelectedVersionIndexOption.Value.Value); + + if (mixLog.ShopIdOption.IsSet) + writer.WriteString("shopId", mixLog.ShopIdOption.Value.Value); + + if (mixLog.SomeCodeOption.IsSet) + if (mixLog.SomeCodeOption.Value != null) + writer.WriteString("someCode", mixLog.SomeCode); + else + writer.WriteNull("someCode"); + + if (mixLog.TotalPriceOption.IsSet) + if (mixLog.TotalPriceOption.Value != null) + writer.WriteNumber("totalPrice", mixLog.TotalPriceOption.Value.Value); + else + writer.WriteNull("totalPrice"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 5effb3c63c5..ae423667629 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -236,7 +236,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -247,7 +247,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet && mixedPropertiesAndAdditionalPropertiesClass.Map == null) throw new ArgumentNullException(nameof(mixedPropertiesAndAdditionalPropertiesClass.Map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index 6447826e7d8..f503204de20 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, model200Response, jsonSerializerOptions); + WriteProperties(writer, model200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) { if (model200Response.ClassOption.IsSet && model200Response.Class == null) throw new ArgumentNullException(nameof(model200Response.Class), "Property is required for class Model200Response."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 1c3b4cf30db..cac0963a201 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, modelClient, jsonSerializerOptions); + WriteProperties(writer, modelClient, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) { if (modelClient.VarClientOption.IsSet && modelClient.VarClient == null) throw new ArgumentNullException(nameof(modelClient.VarClient), "Property is required for class ModelClient."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs index 083a7233e15..86bbf24f53a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, name, jsonSerializerOptions); + WriteProperties(writer, name, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,7 +271,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { if (name.PropertyOption.IsSet && name.Property == null) throw new ArgumentNullException(nameof(name.Property), "Property is required for class Name."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index cd1516104e3..d10268f2927 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) { if (notificationtestGetElementsV1ResponseMPayload.AObjVariableobject == null) throw new ArgumentNullException(nameof(notificationtestGetElementsV1ResponseMPayload.AObjVariableobject), "Property is required for class NotificationtestGetElementsV1ResponseMPayload."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index e5aa8354137..fcafbb94744 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -395,7 +395,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableClass, jsonSerializerOptions); + WriteProperties(writer, nullableClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableClass.ArrayItemsNullableOption.IsSet && nullableClass.ArrayItemsNullable == null) throw new ArgumentNullException(nameof(nullableClass.ArrayItemsNullable), "Property is required for class NullableClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index e4ecd87be6a..4b5f815656a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableGuidClass, jsonSerializerOptions); + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableGuidClass.UuidOption.IsSet) if (nullableGuidClass.UuidOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index d6659599426..10061a2c228 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Triangle triangle, string shapeType) + public NullableShape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Quadrilateral quadrilateral, string shapeType) + public NullableShape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class NullableShape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); if (quadrilateral != null) - return new NullableShape(quadrilateral, shapeType.Value); + return new NullableShape(quadrilateral); if (triangle != null) - return new NullableShape(triangle, shapeType.Value); + return new NullableShape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (nullableShape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, nullableShape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } if (nullableShape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, nullableShape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, nullableShape, jsonSerializerOptions); + WriteProperties(writer, nullableShape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) { - if (nullableShape.ShapeType == null) - throw new ArgumentNullException(nameof(nullableShape.ShapeType), "Property is required for class NullableShape."); - writer.WriteString("shapeType", nullableShape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index b54928bcca5..15c9e5cbfcb 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, numberOnly, jsonSerializerOptions); + WriteProperties(writer, numberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) { if (numberOnly.JustNumberOption.IsSet) writer.WriteNumber("JustNumber", numberOnly.JustNumberOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 8dc4e4d1b9e..b25d9e5fd87 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, objectWithDeprecatedFields, jsonSerializerOptions); + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); writer.WriteEndObject(); } @@ -237,7 +237,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) { if (objectWithDeprecatedFields.BarsOption.IsSet && objectWithDeprecatedFields.Bars == null) throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Bars), "Property is required for class ObjectWithDeprecatedFields."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index 6e94b861b23..0f4f13f311b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -32,19 +32,19 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal OneOfString(string varString) + /// + internal OneOfString(string @string) { - VarString = varString; + String = @string; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets additional properties @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, oneOfString, jsonSerializerOptions); + WriteProperties(writer, oneOfString, jsonSerializerOptions); writer.WriteEndObject(); } @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs index cb5255ea581..96177e75bb7 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -361,7 +361,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, order, jsonSerializerOptions); + WriteProperties(writer, order, jsonSerializerOptions); writer.WriteEndObject(); } @@ -372,7 +372,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) { if (order.CompleteOption.IsSet) writer.WriteBoolean("complete", order.CompleteOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index c4592b634a3..daa467e228b 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -199,7 +199,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, outerComposite, jsonSerializerOptions); + WriteProperties(writer, outerComposite, jsonSerializerOptions); writer.WriteEndObject(); } @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) { if (outerComposite.MyStringOption.IsSet && outerComposite.MyString == null) throw new ArgumentNullException(nameof(outerComposite.MyString), "Property is required for class OuterComposite."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index c451e1a8991..5d1cab769fa 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -32,15 +32,21 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public ParentPet(string petType) : base(petType) + public ParentPet() : base() { OnCreated(); } partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string PetType { get; } = "ParentPet"; + /// /// Returns the string presentation of the object /// @@ -79,6 +85,11 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -109,7 +120,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); - return new ParentPet(petType.Value); + return new ParentPet(); } /// @@ -121,9 +132,14 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, parentPet, jsonSerializerOptions); + WriteProperties(writer, parentPet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -134,11 +150,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { - if (parentPet.PetType == null) - throw new ArgumentNullException(nameof(parentPet.PetType), "Property is required for class ParentPet."); - writer.WriteString("pet_type", parentPet.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 2ed38395a76..bc11d7e054d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -347,7 +347,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, pet, jsonSerializerOptions); + WriteProperties(writer, pet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -358,7 +358,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) { if (pet.Name == null) throw new ArgumentNullException(nameof(pet.Name), "Property is required for class Pet."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pig.cs index d3bbeb8ff32..19e395f1de4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(BasquePig basquePig, string className) + public Pig(BasquePig basquePig) { BasquePig = basquePig; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(DanishPig danishPig, string className) + public Pig(DanishPig danishPig) { DanishPig = danishPig; - ClassName = className; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public DanishPig DanishPig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Pig {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); if (basquePig != null) - return new Pig(basquePig, className.Value); + return new Pig(basquePig); if (danishPig != null) - return new Pig(danishPig, className.Value); + return new Pig(danishPig); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (pig.BasquePig != null) { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); - basquePigJsonConverter.WriteProperties(ref writer, pig.BasquePig, jsonSerializerOptions); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } if (pig.DanishPig != null) { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); - danishPigJsonConverter.WriteProperties(ref writer, pig.DanishPig, jsonSerializerOptions); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } - WriteProperties(ref writer, pig, jsonSerializerOptions); + WriteProperties(writer, pig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) { - if (pig.ClassName == null) - throw new ArgumentNullException(nameof(pig.ClassName), "Property is required for class Pig."); - writer.WriteString("className", pig.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 85e19cd25d2..30edd0b77d2 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -32,20 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(bool varBool) + /// + internal PolymorphicProperty(bool @bool) { - VarBool = varBool; + Bool = @bool; OnCreated(); } /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(string varString) + /// + internal PolymorphicProperty(string @string) { - VarString = varString; + String = @string; OnCreated(); } @@ -72,14 +72,14 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets VarBool + /// Gets or Sets Bool /// - public bool? VarBool { get; set; } + public bool? Bool { get; set; } /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets Object @@ -159,11 +159,11 @@ namespace Org.OpenAPITools.Model if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); - Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model } if (varBool != null) - return new PolymorphicProperty(varBool); + return new PolymorphicProperty(varBool.Value); if (varString != null) return new PolymorphicProperty(varString); @@ -220,7 +220,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, polymorphicProperty, jsonSerializerOptions); + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); writer.WriteEndObject(); } @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index f3ef21718ae..3d333d7958f 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral, string quadrilateralType) + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) { SimpleQuadrilateral = simpleQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(ComplexQuadrilateral complexQuadrilateral, string quadrilateralType) + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) { ComplexQuadrilateral = complexQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public ComplexQuadrilateral ComplexQuadrilateral { get; set; } - /// - /// Gets or Sets QuadrilateralType - /// - [JsonPropertyName("quadrilateralType")] - public string QuadrilateralType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Quadrilateral {\n"); - sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); if (complexQuadrilateral != null) - return new Quadrilateral(complexQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(complexQuadrilateral); if (simpleQuadrilateral != null) - return new Quadrilateral(simpleQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(simpleQuadrilateral); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (quadrilateral.SimpleQuadrilateral != null) { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); - simpleQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } if (quadrilateral.ComplexQuadrilateral != null) { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); - complexQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, quadrilateral, jsonSerializerOptions); + WriteProperties(writer, quadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) { - if (quadrilateral.QuadrilateralType == null) - throw new ArgumentNullException(nameof(quadrilateral.QuadrilateralType), "Property is required for class Quadrilateral."); - writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 75b7e516cfc..610005a0540 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, quadrilateralInterface, jsonSerializerOptions); + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) { if (quadrilateralInterface.QuadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralInterface.QuadrilateralType), "Property is required for class QuadrilateralInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 46c7177ca57..5ef0b044807 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, readOnlyFirst, jsonSerializerOptions); + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) { if (readOnlyFirst.BarOption.IsSet && readOnlyFirst.Bar == null) throw new ArgumentNullException(nameof(readOnlyFirst.Bar), "Property is required for class ReadOnlyFirst."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index e534142196e..55c14ff4d5f 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -43,17 +43,6 @@ namespace Org.OpenAPITools.Model /// requiredNotnullableStringProp /// requiredNotnullableUuid /// requiredNotnullableintegerProp - /// requiredNullableArrayOfString - /// requiredNullableBooleanProp - /// requiredNullableDateProp - /// requiredNullableDatetimeProp - /// requiredNullableEnumInteger - /// requiredNullableEnumIntegerOnly - /// requiredNullableEnumString - /// requiredNullableIntegerProp - /// requiredNullableOuterEnumDefaultValue - /// requiredNullableStringProp - /// requiredNullableUuid /// notRequiredNotnullableDateProp /// notRequiredNotnullableintegerProp /// notRequiredNullableDateProp @@ -76,8 +65,19 @@ namespace Org.OpenAPITools.Model /// notrequiredNullableOuterEnumDefaultValue /// notrequiredNullableStringProp /// notrequiredNullableUuid + /// requiredNullableArrayOfString + /// requiredNullableBooleanProp + /// requiredNullableDateProp + /// requiredNullableDatetimeProp + /// requiredNullableEnumInteger + /// requiredNullableEnumIntegerOnly + /// requiredNullableEnumString + /// requiredNullableIntegerProp + /// requiredNullableOuterEnumDefaultValue + /// requiredNullableStringProp + /// requiredNullableUuid [JsonConstructor] - public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default) + public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default) { RequiredNotNullableDateProp = requiredNotNullableDateProp; RequiredNotnullableArrayOfString = requiredNotnullableArrayOfString; @@ -90,17 +90,6 @@ namespace Org.OpenAPITools.Model RequiredNotnullableStringProp = requiredNotnullableStringProp; RequiredNotnullableUuid = requiredNotnullableUuid; RequiredNotnullableintegerProp = requiredNotnullableintegerProp; - RequiredNullableArrayOfString = requiredNullableArrayOfString; - RequiredNullableBooleanProp = requiredNullableBooleanProp; - RequiredNullableDateProp = requiredNullableDateProp; - RequiredNullableDatetimeProp = requiredNullableDatetimeProp; - RequiredNullableEnumInteger = requiredNullableEnumInteger; - RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; - RequiredNullableEnumString = requiredNullableEnumString; - RequiredNullableIntegerProp = requiredNullableIntegerProp; - RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; - RequiredNullableStringProp = requiredNullableStringProp; - RequiredNullableUuid = requiredNullableUuid; NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; NotRequiredNullableDatePropOption = notRequiredNullableDateProp; @@ -123,6 +112,17 @@ namespace Org.OpenAPITools.Model NotrequiredNullableOuterEnumDefaultValueOption = notrequiredNullableOuterEnumDefaultValue; NotrequiredNullableStringPropOption = notrequiredNullableStringProp; NotrequiredNullableUuidOption = notrequiredNullableUuid; + RequiredNullableArrayOfString = requiredNullableArrayOfString; + RequiredNullableBooleanProp = requiredNullableBooleanProp; + RequiredNullableDateProp = requiredNullableDateProp; + RequiredNullableDatetimeProp = requiredNullableDatetimeProp; + RequiredNullableEnumInteger = requiredNullableEnumInteger; + RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; + RequiredNullableEnumString = requiredNullableEnumString; + RequiredNullableIntegerProp = requiredNullableIntegerProp; + RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; + RequiredNullableStringProp = requiredNullableStringProp; + RequiredNullableUuid = requiredNullableUuid; OnCreated(); } @@ -420,301 +420,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } - /// - /// Defines RequiredNullableEnumInteger - /// - public enum RequiredNullableEnumIntegerEnum - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - - /// - /// Enum NUMBER_MINUS_1 for value: -1 - /// - NUMBER_MINUS_1 = -1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumInteger - /// - [JsonPropertyName("required_nullable_enum_integer")] - public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } - - /// - /// Defines RequiredNullableEnumIntegerOnly - /// - public enum RequiredNullableEnumIntegerOnlyEnum - { - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - - /// - /// Enum NUMBER_MINUS_2 for value: -2 - /// - NUMBER_MINUS_2 = -2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumIntegerOnly - /// - [JsonPropertyName("required_nullable_enum_integer_only")] - public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } - - /// - /// Defines RequiredNullableEnumString - /// - public enum RequiredNullableEnumStringEnum - { - /// - /// Enum UPPER for value: UPPER - /// - UPPER = 1, - - /// - /// Enum Lower for value: lower - /// - Lower = 2, - - /// - /// Enum Empty for value: - /// - Empty = 3, - - /// - /// Enum ValuewithTab for value: Value\twith tab - /// - ValuewithTab = 4, - - /// - /// Enum ValueWithQuote for value: Value with \" quote - /// - ValueWithQuote = 5, - - /// - /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote - /// - ValueWithEscapedQuote = 6, - - /// - /// Enum Duplicatevalue for value: Duplicate\nvalue - /// - Duplicatevalue = 7, - - /// - /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue - /// - Duplicatevalue2 = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) - { - if (value == null) - return null; - - if (value == RequiredNullableEnumStringEnum.UPPER) - return "UPPER"; - - if (value == RequiredNullableEnumStringEnum.Lower) - return "lower"; - - if (value == RequiredNullableEnumStringEnum.Empty) - return ""; - - if (value == RequiredNullableEnumStringEnum.ValuewithTab) - return "Value\twith tab"; - - if (value == RequiredNullableEnumStringEnum.ValueWithQuote) - return "Value with \" quote"; - - if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) - return "Value with escaped \" quote"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue) - return "Duplicate\nvalue"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) - return "Duplicate\r\nvalue"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Gets or Sets RequiredNullableEnumString - /// - [JsonPropertyName("required_nullable_enum_string")] - public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } - - /// - /// Gets or Sets RequiredNullableOuterEnumDefaultValue - /// - [JsonPropertyName("required_nullable_outerEnumDefaultValue")] - public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } - /// /// Defines NotrequiredNotnullableEnumInteger /// @@ -1358,6 +1063,301 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new(value); } } + /// + /// Defines RequiredNullableEnumInteger + /// + public enum RequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumInteger + /// + [JsonPropertyName("required_nullable_enum_integer")] + public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } + + /// + /// Defines RequiredNullableEnumIntegerOnly + /// + public enum RequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("required_nullable_enum_integer_only")] + public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNullableEnumString + /// + public enum RequiredNullableEnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2, + + /// + /// Enum Empty for value: + /// + Empty = 3, + + /// + /// Enum ValuewithTab for value: Value\twith tab + /// + ValuewithTab = 4, + + /// + /// Enum ValueWithQuote for value: Value with \" quote + /// + ValueWithQuote = 5, + + /// + /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote + /// + ValueWithEscapedQuote = 6, + + /// + /// Enum Duplicatevalue for value: Duplicate\nvalue + /// + Duplicatevalue = 7, + + /// + /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue + /// + Duplicatevalue2 = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == RequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNullableEnumString + /// + [JsonPropertyName("required_nullable_enum_string")] + public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } + /// /// Gets or Sets RequiredNotNullableDateProp /// @@ -1401,49 +1401,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullableinteger_prop")] public int RequiredNotnullableintegerProp { get; set; } - /// - /// Gets or Sets RequiredNullableArrayOfString - /// - [JsonPropertyName("required_nullable_array_of_string")] - public List RequiredNullableArrayOfString { get; set; } - - /// - /// Gets or Sets RequiredNullableBooleanProp - /// - [JsonPropertyName("required_nullable_boolean_prop")] - public bool? RequiredNullableBooleanProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDateProp - /// - [JsonPropertyName("required_nullable_date_prop")] - public DateOnly? RequiredNullableDateProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDatetimeProp - /// - [JsonPropertyName("required_nullable_datetime_prop")] - public DateTime? RequiredNullableDatetimeProp { get; set; } - - /// - /// Gets or Sets RequiredNullableIntegerProp - /// - [JsonPropertyName("required_nullable_integer_prop")] - public int? RequiredNullableIntegerProp { get; set; } - - /// - /// Gets or Sets RequiredNullableStringProp - /// - [JsonPropertyName("required_nullable_string_prop")] - public string RequiredNullableStringProp { get; set; } - - /// - /// Gets or Sets RequiredNullableUuid - /// - /// 72f98069-206d-4f12-9f12-3d1e525a8e84 - [JsonPropertyName("required_nullable_uuid")] - public Guid? RequiredNullableUuid { get; set; } - /// /// Used to track the state of NotRequiredNotnullableDateProp /// @@ -1628,6 +1585,49 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_uuid")] public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new(value); } } + /// + /// Gets or Sets RequiredNullableArrayOfString + /// + [JsonPropertyName("required_nullable_array_of_string")] + public List RequiredNullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNullableBooleanProp + /// + [JsonPropertyName("required_nullable_boolean_prop")] + public bool? RequiredNullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDateProp + /// + [JsonPropertyName("required_nullable_date_prop")] + public DateOnly? RequiredNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDatetimeProp + /// + [JsonPropertyName("required_nullable_datetime_prop")] + public DateTime? RequiredNullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNullableIntegerProp + /// + [JsonPropertyName("required_nullable_integer_prop")] + public int? RequiredNullableIntegerProp { get; set; } + + /// + /// Gets or Sets RequiredNullableStringProp + /// + [JsonPropertyName("required_nullable_string_prop")] + public string RequiredNullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_nullable_uuid")] + public Guid? RequiredNullableUuid { get; set; } + /// /// Gets or Sets additional properties /// @@ -1653,17 +1653,6 @@ namespace Org.OpenAPITools.Model sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); - sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); - sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); - sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); - sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); - sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); - sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); - sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); - sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); - sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); - sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); - sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); @@ -1686,6 +1675,17 @@ namespace Org.OpenAPITools.Model sb.Append(" NotrequiredNullableOuterEnumDefaultValue: ").Append(NotrequiredNullableOuterEnumDefaultValue).Append("\n"); sb.Append(" NotrequiredNullableStringProp: ").Append(NotrequiredNullableStringProp).Append("\n"); sb.Append(" NotrequiredNullableUuid: ").Append(NotrequiredNullableUuid).Append("\n"); + sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); + sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); + sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); + sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); + sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); + sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); + sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); + sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -1717,16 +1717,6 @@ namespace Org.OpenAPITools.Model /// public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// - /// The format to use to serialize RequiredNullableDateProp - /// - public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize RequiredNullableDatetimeProp - /// - public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// /// The format to use to serialize NotRequiredNotnullableDateProp /// @@ -1747,6 +1737,16 @@ namespace Org.OpenAPITools.Model /// public static string NotrequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// + /// The format to use to serialize RequiredNullableDateProp + /// + public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNullableDatetimeProp + /// + public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// /// Deserializes json to /// @@ -1775,17 +1775,6 @@ namespace Org.OpenAPITools.Model Option requiredNotnullableStringProp = default; Option requiredNotnullableUuid = default; Option requiredNotnullableintegerProp = default; - Option> requiredNullableArrayOfString = default; - Option requiredNullableBooleanProp = default; - Option requiredNullableDateProp = default; - Option requiredNullableDatetimeProp = default; - Option requiredNullableEnumInteger = default; - Option requiredNullableEnumIntegerOnly = default; - Option requiredNullableEnumString = default; - Option requiredNullableIntegerProp = default; - Option requiredNullableOuterEnumDefaultValue = default; - Option requiredNullableStringProp = default; - Option requiredNullableUuid = default; Option notRequiredNotnullableDateProp = default; Option notRequiredNotnullableintegerProp = default; Option notRequiredNullableDateProp = default; @@ -1808,6 +1797,17 @@ namespace Org.OpenAPITools.Model Option notrequiredNullableOuterEnumDefaultValue = default; Option notrequiredNullableStringProp = default; Option notrequiredNullableUuid = default; + Option> requiredNullableArrayOfString = default; + Option requiredNullableBooleanProp = default; + Option requiredNullableDateProp = default; + Option requiredNullableDatetimeProp = default; + Option requiredNullableEnumInteger = default; + Option requiredNullableEnumIntegerOnly = default; + Option requiredNullableEnumString = default; + Option requiredNullableIntegerProp = default; + Option requiredNullableOuterEnumDefaultValue = default; + Option requiredNullableStringProp = default; + Option requiredNullableUuid = default; while (utf8JsonReader.Read()) { @@ -1869,51 +1869,6 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); break; - case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); - break; - case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_string": - string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumStringRawValue != null) - requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); - break; - case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); - break; - case "required_nullable_outerEnumDefaultValue": - string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); - break; - case "required_nullable_string_prop": - requiredNullableStringProp = new Option(utf8JsonReader.GetString()); - break; - case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); - break; case "not_required_notnullable_date_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -2004,6 +1959,51 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); break; + case "required_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_string": + string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumStringRawValue != null) + requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); + break; + case "required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "required_nullable_outerEnumDefaultValue": + string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); + break; + case "required_nullable_string_prop": + requiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_nullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + break; default: break; } @@ -2142,7 +2142,7 @@ namespace Org.OpenAPITools.Model if (notrequiredNotnullableUuid.IsSet && notrequiredNotnullableUuid.Value == null) throw new ArgumentNullException(nameof(notrequiredNotnullableUuid), "Property is not nullable for class RequiredClass."); - return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid); + return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value); } /// @@ -2156,7 +2156,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, requiredClass, jsonSerializerOptions); + WriteProperties(writer, requiredClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -2167,7 +2167,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) { if (requiredClass.RequiredNotnullableArrayOfString == null) throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); @@ -2204,70 +2204,6 @@ namespace Org.OpenAPITools.Model writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); - if (requiredClass.RequiredNullableArrayOfString != null) - { - writer.WritePropertyName("required_nullable_array_of_string"); - JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); - } - else - writer.WriteNull("required_nullable_array_of_string"); - if (requiredClass.RequiredNullableBooleanProp != null) - writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); - else - writer.WriteNull("required_nullable_boolean_prop"); - - if (requiredClass.RequiredNullableDateProp != null) - writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); - else - writer.WriteNull("required_nullable_date_prop"); - - if (requiredClass.RequiredNullableDatetimeProp != null) - writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); - else - writer.WriteNull("required_nullable_datetime_prop"); - - if (requiredClass.RequiredNullableEnumInteger != null) - writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); - else - writer.WriteNull("required_nullable_enum_integer"); - - if (requiredClass.RequiredNullableEnumIntegerOnly != null) - writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); - else - writer.WriteNull("required_nullable_enum_integer_only"); - - var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString.Value); - if (requiredNullableEnumStringRawValue != null) - writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); - else - writer.WriteNull("required_nullable_enum_string"); - - if (requiredClass.RequiredNullableIntegerProp != null) - writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); - else - writer.WriteNull("required_nullable_integer_prop"); - - if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - else - { - var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); - else - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - } - - if (requiredClass.RequiredNullableStringProp != null) - writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); - else - writer.WriteNull("required_nullable_string_prop"); - - if (requiredClass.RequiredNullableUuid != null) - writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); - else - writer.WriteNull("required_nullable_uuid"); - if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); @@ -2373,6 +2309,70 @@ namespace Org.OpenAPITools.Model writer.WriteString("notrequired_nullable_uuid", requiredClass.NotrequiredNullableUuidOption.Value.Value); else writer.WriteNull("notrequired_nullable_uuid"); + + if (requiredClass.RequiredNullableArrayOfString != null) + { + writer.WritePropertyName("required_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("required_nullable_array_of_string"); + if (requiredClass.RequiredNullableBooleanProp != null) + writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); + else + writer.WriteNull("required_nullable_boolean_prop"); + + if (requiredClass.RequiredNullableDateProp != null) + writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); + else + writer.WriteNull("required_nullable_date_prop"); + + if (requiredClass.RequiredNullableDatetimeProp != null) + writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); + else + writer.WriteNull("required_nullable_datetime_prop"); + + if (requiredClass.RequiredNullableEnumInteger != null) + writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); + else + writer.WriteNull("required_nullable_enum_integer"); + + if (requiredClass.RequiredNullableEnumIntegerOnly != null) + writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); + else + writer.WriteNull("required_nullable_enum_integer_only"); + + var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString.Value); + if (requiredNullableEnumStringRawValue != null) + writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); + else + writer.WriteNull("required_nullable_enum_string"); + + if (requiredClass.RequiredNullableIntegerProp != null) + writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); + else + writer.WriteNull("required_nullable_integer_prop"); + + if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + else + { + var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); + else + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + } + + if (requiredClass.RequiredNullableStringProp != null) + writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); + else + writer.WriteNull("required_nullable_string_prop"); + + if (requiredClass.RequiredNullableUuid != null) + writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); + else + writer.WriteNull("required_nullable_uuid"); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs index 5804b46eff2..30c6b4d7fe9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, varReturn, jsonSerializerOptions); + WriteProperties(writer, varReturn, jsonSerializerOptions); writer.WriteEndObject(); } @@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) { if (varReturn.Lock == null) throw new ArgumentNullException(nameof(varReturn.Lock), "Property is required for class Return."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 306c5b8f727..14e2d9ee12f 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHash.RoleOption.IsSet && rolesReportsHash.Role == null) throw new ArgumentNullException(nameof(rolesReportsHash.Role), "Property is required for class RolesReportsHash."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 763295f2497..1e19e81e55c 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHashRole.NameOption.IsSet && rolesReportsHashRole.Name == null) throw new ArgumentNullException(nameof(rolesReportsHashRole.Name), "Property is required for class RolesReportsHashRole."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 52a8e0d69c6..47081ede38e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, scaleneTriangle, jsonSerializerOptions); + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) { if (scaleneTriangle.ShapeType == null) throw new ArgumentNullException(nameof(scaleneTriangle.ShapeType), "Property is required for class ScaleneTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Shape.cs index ffd95a8fdff..d4883a363a2 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Triangle triangle, string shapeType) + public Shape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Quadrilateral quadrilateral, string shapeType) + public Shape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Shape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); if (quadrilateral != null) - return new Shape(quadrilateral, shapeType.Value); + return new Shape(quadrilateral); if (triangle != null) - return new Shape(triangle, shapeType.Value); + return new Shape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } if (shape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shape, jsonSerializerOptions); + WriteProperties(writer, shape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) { - if (shape.ShapeType == null) - throw new ArgumentNullException(nameof(shape.ShapeType), "Property is required for class Shape."); - writer.WriteString("shapeType", shape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index 5bd364cc6a4..3027d9142ba 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, shapeInterface, jsonSerializerOptions); + WriteProperties(writer, shapeInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) { if (shapeInterface.ShapeType == null) throw new ArgumentNullException(nameof(shapeInterface.ShapeType), "Property is required for class ShapeInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d60f396c70d..2d9fb2cbb33 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Triangle triangle, string shapeType) + public ShapeOrNull(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Quadrilateral quadrilateral, string shapeType) + public ShapeOrNull(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class ShapeOrNull {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); if (quadrilateral != null) - return new ShapeOrNull(quadrilateral, shapeType.Value); + return new ShapeOrNull(quadrilateral); if (triangle != null) - return new ShapeOrNull(triangle, shapeType.Value); + return new ShapeOrNull(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shapeOrNull.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shapeOrNull.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } if (shapeOrNull.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shapeOrNull, jsonSerializerOptions); + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) { - if (shapeOrNull.ShapeType == null) - throw new ArgumentNullException(nameof(shapeOrNull.ShapeType), "Property is required for class ShapeOrNull."); - writer.WriteString("shapeType", shapeOrNull.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index a00a87e2efa..3fa8bdc1917 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, simpleQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (simpleQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(simpleQuadrilateral.QuadrilateralType), "Property is required for class SimpleQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index e90c6487364..0cc19a946de 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, specialModelName, jsonSerializerOptions); + WriteProperties(writer, specialModelName, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) { if (specialModelName.VarSpecialModelNameOption.IsSet && specialModelName.VarSpecialModelName == null) throw new ArgumentNullException(nameof(specialModelName.VarSpecialModelName), "Property is required for class SpecialModelName."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs index 84f19a2c898..5c64df495c1 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, tag, jsonSerializerOptions); + WriteProperties(writer, tag, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) { if (tag.NameOption.IsSet && tag.Name == null) throw new ArgumentNullException(nameof(tag.Name), "Property is required for class Tag."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 73886a2eca0..c5e4293dca4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordList, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordList.ValueOption.IsSet && testCollectionEndingWithWordList.Value == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList.Value), "Property is required for class TestCollectionEndingWithWordList."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 599b515add9..798a4b835c9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet && testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index 1e3b57bfe36..e6590dd351d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) { if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet && testInlineFreeformAdditionalPropertiesRequest.SomeProperty == null) throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest.SomeProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 737124e080b..d31d2948c65 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(EquilateralTriangle equilateralTriangle, string triangleType) + public Triangle(EquilateralTriangle equilateralTriangle) { EquilateralTriangle = equilateralTriangle; - TriangleType = triangleType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(IsoscelesTriangle isoscelesTriangle, string triangleType) + public Triangle(IsoscelesTriangle isoscelesTriangle) { IsoscelesTriangle = isoscelesTriangle; - TriangleType = triangleType; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(ScaleneTriangle scaleneTriangle, string triangleType) + public Triangle(ScaleneTriangle scaleneTriangle) { ScaleneTriangle = scaleneTriangle; - TriangleType = triangleType; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public ScaleneTriangle ScaleneTriangle { get; set; } - /// - /// Gets or Sets TriangleType - /// - [JsonPropertyName("triangleType")] - public string TriangleType { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Triangle {\n"); - sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); if (equilateralTriangle != null) - return new Triangle(equilateralTriangle, triangleType.Value); + return new Triangle(equilateralTriangle); if (isoscelesTriangle != null) - return new Triangle(isoscelesTriangle, triangleType.Value); + return new Triangle(isoscelesTriangle); if (scaleneTriangle != null) - return new Triangle(scaleneTriangle, triangleType.Value); + return new Triangle(scaleneTriangle); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (triangle.EquilateralTriangle != null) { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); - equilateralTriangleJsonConverter.WriteProperties(ref writer, triangle.EquilateralTriangle, jsonSerializerOptions); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } if (triangle.IsoscelesTriangle != null) { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); - isoscelesTriangleJsonConverter.WriteProperties(ref writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } if (triangle.ScaleneTriangle != null) { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); - scaleneTriangleJsonConverter.WriteProperties(ref writer, triangle.ScaleneTriangle, jsonSerializerOptions); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } - WriteProperties(ref writer, triangle, jsonSerializerOptions); + WriteProperties(writer, triangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) { - if (triangle.TriangleType == null) - throw new ArgumentNullException(nameof(triangle.TriangleType), "Property is required for class Triangle."); - writer.WriteString("triangleType", triangle.TriangleType); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 270c598de61..aa6d31b9190 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, triangleInterface, jsonSerializerOptions); + WriteProperties(writer, triangleInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) { if (triangleInterface.TriangleType == null) throw new ArgumentNullException(nameof(triangleInterface.TriangleType), "Property is required for class TriangleInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs index 22330c4f5a8..ea5842d39f4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, user, jsonSerializerOptions); + WriteProperties(writer, user, jsonSerializerOptions); writer.WriteEndObject(); } @@ -417,7 +417,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) { if (user.EmailOption.IsSet && user.Email == null) throw new ArgumentNullException(nameof(user.Email), "Property is required for class User."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs index b130c0fbf88..258c1713bcc 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, whale, jsonSerializerOptions); + WriteProperties(writer, whale, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) { if (whale.ClassName == null) throw new ArgumentNullException(nameof(whale.ClassName), "Property is required for class Whale."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index b8be0d28b13..496d18a90ea 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -252,7 +252,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zebra, jsonSerializerOptions); + WriteProperties(writer, zebra, jsonSerializerOptions); writer.WriteEndObject(); } @@ -263,7 +263,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) { if (zebra.ClassName == null) throw new ArgumentNullException(nameof(zebra.ClassName), "Property is required for class Zebra."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 511fa98fa5f..d2b2ebeeb83 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zeroBasedEnumClass, jsonSerializerOptions); + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -230,7 +230,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) { var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value.Value); writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 73772d84956..a5ac63f5ad0 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/README.md index 014ef147baa..84d0c69c394 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/README.md @@ -179,7 +179,6 @@ Authentication schemes defined for the API: - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES index 0c900b9c260..a94acc41bff 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/.openapi-generator/FILES @@ -54,6 +54,7 @@ docs/models/List.md docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md +docs/models/MixLog.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md docs/models/Model200Response.md docs/models/ModelClient.md @@ -184,6 +185,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**FormulaVersionDate** | **DateTime** | | +**Id** | **Guid** | | +**MixDate** | **DateTime** | | +**TotalOverPoors** | **int** | | +**TotalRecalculations** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] +**ShopId** | **Guid** | | [optional] +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**TotalPrice** | **float** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/RequiredClass.md index bbdf6d8407b..990aeb5de3d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/RequiredClass.md +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/RequiredClass.md @@ -15,17 +15,6 @@ Name | Type | Description | Notes **RequiredNotnullableStringProp** | **string** | | **RequiredNotnullableUuid** | **Guid** | | **RequiredNotnullableintegerProp** | **int** | | -**RequiredNullableArrayOfString** | **List<string>** | | -**RequiredNullableBooleanProp** | **bool** | | -**RequiredNullableDateProp** | **DateOnly** | | -**RequiredNullableDatetimeProp** | **DateTime** | | -**RequiredNullableEnumInteger** | **int** | | -**RequiredNullableEnumIntegerOnly** | **int** | | -**RequiredNullableEnumString** | **string** | | -**RequiredNullableIntegerProp** | **int** | | -**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | -**RequiredNullableStringProp** | **string** | | -**RequiredNullableUuid** | **Guid** | | **NotRequiredNotnullableDateProp** | **DateOnly** | | [optional] **NotRequiredNotnullableintegerProp** | **int** | | [optional] **NotRequiredNullableDateProp** | **DateOnly** | | [optional] @@ -48,6 +37,17 @@ Name | Type | Description | Notes **NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] **NotrequiredNullableStringProp** | **string** | | [optional] **NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateOnly** | | +**RequiredNullableDatetimeProp** | **DateTime** | | +**RequiredNullableEnumInteger** | **int** | | +**RequiredNullableEnumIntegerOnly** | **int** | | +**RequiredNullableEnumString** | **string** | | +**RequiredNullableIntegerProp** | **int** | | +**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNullableStringProp** | **string** | | +**RequiredNullableUuid** | **Guid** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs index e5186391592..d1da68281ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'RequiredNotnullableintegerProp' } - /// - /// Test the property 'RequiredNullableArrayOfString' - /// - [Fact] - public void RequiredNullableArrayOfStringTest() - { - // TODO unit test for the property 'RequiredNullableArrayOfString' - } - - /// - /// Test the property 'RequiredNullableBooleanProp' - /// - [Fact] - public void RequiredNullableBooleanPropTest() - { - // TODO unit test for the property 'RequiredNullableBooleanProp' - } - - /// - /// Test the property 'RequiredNullableDateProp' - /// - [Fact] - public void RequiredNullableDatePropTest() - { - // TODO unit test for the property 'RequiredNullableDateProp' - } - - /// - /// Test the property 'RequiredNullableDatetimeProp' - /// - [Fact] - public void RequiredNullableDatetimePropTest() - { - // TODO unit test for the property 'RequiredNullableDatetimeProp' - } - - /// - /// Test the property 'RequiredNullableEnumInteger' - /// - [Fact] - public void RequiredNullableEnumIntegerTest() - { - // TODO unit test for the property 'RequiredNullableEnumInteger' - } - - /// - /// Test the property 'RequiredNullableEnumIntegerOnly' - /// - [Fact] - public void RequiredNullableEnumIntegerOnlyTest() - { - // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' - } - - /// - /// Test the property 'RequiredNullableEnumString' - /// - [Fact] - public void RequiredNullableEnumStringTest() - { - // TODO unit test for the property 'RequiredNullableEnumString' - } - - /// - /// Test the property 'RequiredNullableIntegerProp' - /// - [Fact] - public void RequiredNullableIntegerPropTest() - { - // TODO unit test for the property 'RequiredNullableIntegerProp' - } - - /// - /// Test the property 'RequiredNullableOuterEnumDefaultValue' - /// - [Fact] - public void RequiredNullableOuterEnumDefaultValueTest() - { - // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' - } - - /// - /// Test the property 'RequiredNullableStringProp' - /// - [Fact] - public void RequiredNullableStringPropTest() - { - // TODO unit test for the property 'RequiredNullableStringProp' - } - - /// - /// Test the property 'RequiredNullableUuid' - /// - [Fact] - public void RequiredNullableUuidTest() - { - // TODO unit test for the property 'RequiredNullableUuid' - } - /// /// Test the property 'NotRequiredNotnullableDateProp' /// @@ -448,5 +349,104 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'NotrequiredNullableUuid' } + + /// + /// Test the property 'RequiredNullableArrayOfString' + /// + [Fact] + public void RequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNullableArrayOfString' + } + + /// + /// Test the property 'RequiredNullableBooleanProp' + /// + [Fact] + public void RequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNullableBooleanProp' + } + + /// + /// Test the property 'RequiredNullableDateProp' + /// + [Fact] + public void RequiredNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNullableDateProp' + } + + /// + /// Test the property 'RequiredNullableDatetimeProp' + /// + [Fact] + public void RequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNullableEnumInteger' + /// + [Fact] + public void RequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNullableEnumInteger' + } + + /// + /// Test the property 'RequiredNullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNullableEnumString' + /// + [Fact] + public void RequiredNullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNullableEnumString' + } + + /// + /// Test the property 'RequiredNullableIntegerProp' + /// + [Fact] + public void RequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'RequiredNullableIntegerProp' + } + + /// + /// Test the property 'RequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNullableStringProp' + /// + [Fact] + public void RequiredNullableStringPropTest() + { + // TODO unit test for the property 'RequiredNullableStringProp' + } + + /// + /// Test the property 'RequiredNullableUuid' + /// + [Fact] + public void RequiredNullableUuidTest() + { + // TODO unit test for the property 'RequiredNullableUuid' + } } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/ClientUtils.cs index 7c68fd649ff..0176499b291 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -206,12 +206,6 @@ namespace Org.OpenAPITools.Client return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); - if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) - return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) - return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) - return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) @@ -224,6 +218,12 @@ namespace Org.OpenAPITools.Client return RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.NotrequiredNullableEnumStringEnum requiredClassNotrequiredNullableEnumStringEnum) return RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClassNotrequiredNullableEnumStringEnum); + if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) + return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) + return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is Zebra.TypeEnum zebraTypeEnum) return Zebra.TypeEnumToJsonValue(zebraTypeEnum); if (obj is ZeroBasedEnum zeroBasedEnum) @@ -361,6 +361,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/HostConfiguration.cs index a027dfc5a07..bb5e0663eb8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -88,6 +88,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); @@ -188,6 +189,7 @@ namespace Org.OpenAPITools.Client new LiteralStringClassSerializationContext(), new MammalSerializationContext(), new MapTestSerializationContext(), + new MixLogSerializationContext(), new MixedPropertiesAndAdditionalPropertiesClassSerializationContext(), new Model200ResponseSerializationContext(), new ModelClientSerializationContext(), diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs index 04a319484ff..5b176f5847b 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activity, jsonSerializerOptions); + WriteProperties(writer, activity, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) { if (activity.ActivityOutputsOption.IsSet && activity.ActivityOutputs == null) throw new ArgumentNullException(nameof(activity.ActivityOutputs), "Property is required for class Activity."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 5d8247aa3b3..4c1d4719e88 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activityOutputElementRepresentation, jsonSerializerOptions); + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) { if (activityOutputElementRepresentation.Prop1Option.IsSet && activityOutputElementRepresentation.Prop1 == null) throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop1), "Property is required for class ActivityOutputElementRepresentation."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 46263182a1d..6213c117b3d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -321,7 +321,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, additionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -332,7 +332,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (additionalPropertiesClass.EmptyMapOption.IsSet && additionalPropertiesClass.EmptyMap == null) throw new ArgumentNullException(nameof(additionalPropertiesClass.EmptyMap), "Property is required for class AdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Animal.cs index a82a1cc253c..950bb12e8ce 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Animal.cs @@ -35,12 +35,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, Option color = default) + public Animal(Option color = default) { - ClassName = className; ColorOption = color; OnCreated(); } @@ -48,10 +46,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets ClassName + /// The discriminator /// - [JsonPropertyName("className")] - public string ClassName { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; /// /// Used to track the state of Color @@ -80,7 +79,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); @@ -133,6 +131,14 @@ namespace Org.OpenAPITools.Model Option className = default; Option color = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "className"); + + if (discriminator != null && discriminator.Equals("Cat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Dog")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -169,7 +175,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); - return new Animal(className.Value!, color); + return new Animal(color); } /// @@ -181,9 +187,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { + if (animal is Cat cat){ + JsonSerializer.Serialize(writer, cat, jsonSerializerOptions); + return; + } + + if (animal is Dog dog){ + JsonSerializer.Serialize(writer, dog, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, animal, jsonSerializerOptions); + WriteProperties(writer, animal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -194,11 +210,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { - if (animal.ClassName == null) - throw new ArgumentNullException(nameof(animal.ClassName), "Property is required for class Animal."); - if (animal.ColorOption.IsSet && animal.Color == null) throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs index 794b53168b5..fe7efa6f1aa 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apiResponse, jsonSerializerOptions); + WriteProperties(writer, apiResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) { if (apiResponse.MessageOption.IsSet && apiResponse.Message == null) throw new ArgumentNullException(nameof(apiResponse.Message), "Property is required for class ApiResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Apple.cs index aa181299bc0..71ef8c147c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Apple.cs @@ -230,7 +230,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -241,7 +241,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.ColorCodeOption.IsSet && apple.ColorCode == null) throw new ArgumentNullException(nameof(apple.ColorCode), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs index 6107920df4b..7e88ecdde6b 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs @@ -167,7 +167,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, appleReq, jsonSerializerOptions); + WriteProperties(writer, appleReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) { if (appleReq.Cultivar == null) throw new ArgumentNullException(nameof(appleReq.Cultivar), "Property is required for class AppleReq."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index abbbaf46bfb..b19b1457e95 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet && arrayOfArrayOfNumberOnly.ArrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfArrayOfNumberOnly.ArrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 9488591f76e..db1e09392db 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfNumberOnly.ArrayNumberOption.IsSet && arrayOfNumberOnly.ArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfNumberOnly.ArrayNumber), "Property is required for class ArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs index b60359f3625..d2b761acf71 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -203,7 +203,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayTest, jsonSerializerOptions); + WriteProperties(writer, arrayTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -214,7 +214,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) { if (arrayTest.ArrayArrayOfIntegerOption.IsSet && arrayTest.ArrayArrayOfInteger == null) throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfInteger), "Property is required for class ArrayTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs index 9ebe18e0ea2..57ed00dc715 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.LengthCmOption.IsSet) writer.WriteNumber("lengthCm", banana.LengthCmOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs index fbb8eabc47f..4c3b455b4d8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, bananaReq, jsonSerializerOptions); + WriteProperties(writer, bananaReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) { writer.WriteNumber("lengthCm", bananaReq.LengthCm); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BasquePig.cs index bf0cea7cd56..51068cfa79a 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BasquePig.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, basquePig, jsonSerializerOptions); + WriteProperties(writer, basquePig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) { if (basquePig.ClassName == null) throw new ArgumentNullException(nameof(basquePig.ClassName), "Property is required for class BasquePig."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Capitalization.cs index 34db2b72386..052c859a180 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Capitalization.cs @@ -270,7 +270,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, capitalization, jsonSerializerOptions); + WriteProperties(writer, capitalization, jsonSerializerOptions); writer.WriteEndObject(); } @@ -281,7 +281,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) { if (capitalization.ATT_NAMEOption.IsSet && capitalization.ATT_NAME == null) throw new ArgumentNullException(nameof(capitalization.ATT_NAME), "Property is required for class Capitalization."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs index 0d2c9ae1f5c..359c2d98242 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs @@ -35,11 +35,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") /// declawed [JsonConstructor] - public Cat(string className, Option color = default, Option declawed = default) : base(className, color) + public Cat(Option color = default, Option declawed = default) : base(color) { DeclawedOption = declawed; OnCreated(); @@ -47,6 +46,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Cat"; + /// /// Used to track the state of Declawed /// @@ -144,7 +150,7 @@ namespace Org.OpenAPITools.Model if (declawed.IsSet && declawed.Value == null) throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); - return new Cat(className.Value!, color, declawed); + return new Cat(color, declawed); } /// @@ -158,7 +164,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, cat, jsonSerializerOptions); + WriteProperties(writer, cat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -169,11 +175,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) { - if (cat.ClassName == null) - throw new ArgumentNullException(nameof(cat.ClassName), "Property is required for class Cat."); - if (cat.ColorOption.IsSet && cat.Color == null) throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs index 6cec2c557de..90e66ff54e4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, category, jsonSerializerOptions); + WriteProperties(writer, category, jsonSerializerOptions); writer.WriteEndObject(); } @@ -185,7 +185,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) { if (category.Name == null) throw new ArgumentNullException(nameof(category.Name), "Property is required for class Category."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ChildCat.cs index 5c0e41fe82b..62bd1e47955 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ChildCat.cs @@ -36,12 +36,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// name - /// petType (default to PetTypeEnum.ChildCat) [JsonConstructor] - public ChildCat(Option name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType)) + public ChildCat(Option name = default) : base() { NameOption = name; - PetType = petType; OnCreated(); } @@ -99,12 +97,6 @@ namespace Org.OpenAPITools.Model throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Gets or Sets PetType - /// - [JsonPropertyName("pet_type")] - public new PetTypeEnum PetType { get; set; } - /// /// Used to track the state of Name /// @@ -118,6 +110,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("name")] public string? Name { get { return this.NameOption; } set { this.NameOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new PetTypeEnum PetType { get; } = (PetTypeEnum)Enum.Parse(typeof(PetTypeEnum), "ChildCat"); + /// /// Returns the string presentation of the object /// @@ -128,7 +127,6 @@ namespace Org.OpenAPITools.Model sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -197,7 +195,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); - return new ChildCat(name, petType.Value!.Value!); + return new ChildCat(name); } /// @@ -211,7 +209,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, childCat, jsonSerializerOptions); + WriteProperties(writer, childCat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -222,7 +220,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) { if (childCat.NameOption.IsSet && childCat.Name == null) throw new ArgumentNullException(nameof(childCat.Name), "Property is required for class ChildCat."); @@ -230,8 +228,7 @@ namespace Org.OpenAPITools.Model if (childCat.NameOption.IsSet) writer.WriteString("name", childCat.Name); - var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType); - writer.WriteString("pet_type", petTypeRawValue); + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ClassModel.cs index c0487274664..0a3fdbfb454 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ClassModel.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, classModel, jsonSerializerOptions); + WriteProperties(writer, classModel, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) { if (classModel.ClassOption.IsSet && classModel.Class == null) throw new ArgumentNullException(nameof(classModel.Class), "Property is required for class ClassModel."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 51888deccf7..07c7479edd9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, complexQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (complexQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(complexQuadrilateral.QuadrilateralType), "Property is required for class ComplexQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DanishPig.cs index eed526c69f5..e1f21a8c8d4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DanishPig.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, danishPig, jsonSerializerOptions); + WriteProperties(writer, danishPig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) { if (danishPig.ClassName == null) throw new ArgumentNullException(nameof(danishPig.ClassName), "Property is required for class DanishPig."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 61673c1d85e..c6c77d2d6a8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dateOnlyClass, jsonSerializerOptions); + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) { if (dateOnlyClass.DateOnlyPropertyOption.IsSet) writer.WriteString("dateOnlyProperty", dateOnlyClass.DateOnlyPropertyOption.Value!.Value.ToString(DateOnlyPropertyFormat)); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DeprecatedObject.cs index 5eba41f29d2..f2fecb27023 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, deprecatedObject, jsonSerializerOptions); + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) { if (deprecatedObject.NameOption.IsSet && deprecatedObject.Name == null) throw new ArgumentNullException(nameof(deprecatedObject.Name), "Property is required for class DeprecatedObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Dog.cs index e8f095cbf72..b0cf0bc10c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Dog.cs @@ -35,11 +35,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// breed /// color (default to "red") [JsonConstructor] - public Dog(string className, Option breed = default, Option color = default) : base(className, color) + public Dog(Option breed = default, Option color = default) : base(color) { BreedOption = breed; OnCreated(); @@ -47,6 +46,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Dog"; + /// /// Used to track the state of Breed /// @@ -143,7 +149,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); - return new Dog(className.Value!, breed, color); + return new Dog(breed, color); } /// @@ -157,7 +163,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dog, jsonSerializerOptions); + WriteProperties(writer, dog, jsonSerializerOptions); writer.WriteEndObject(); } @@ -168,11 +174,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) { - if (dog.ClassName == null) - throw new ArgumentNullException(nameof(dog.ClassName), "Property is required for class Dog."); - if (dog.BreedOption.IsSet && dog.Breed == null) throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs index 7121de5155a..f748a54b972 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs @@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, drawing, jsonSerializerOptions); + WriteProperties(writer, drawing, jsonSerializerOptions); writer.WriteEndObject(); } @@ -232,7 +232,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) { if (drawing.MainShapeOption.IsSet && drawing.MainShape == null) throw new ArgumentNullException(nameof(drawing.MainShape), "Property is required for class Drawing."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs index 2c2f2c2c5fc..da63470bbc7 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -312,7 +312,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumArrays, jsonSerializerOptions); + WriteProperties(writer, enumArrays, jsonSerializerOptions); writer.WriteEndObject(); } @@ -323,7 +323,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) { if (enumArrays.ArrayEnumOption.IsSet && enumArrays.ArrayEnum == null) throw new ArgumentNullException(nameof(enumArrays.ArrayEnum), "Property is required for class EnumArrays."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs index d7d18dcad39..d7d03540d33 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs @@ -830,7 +830,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumTest, jsonSerializerOptions); + WriteProperties(writer, enumTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -841,7 +841,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) { var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); writer.WriteString("enum_string_required", enumStringRequiredRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 6b6bfc6728b..39b32f1ba22 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, equilateralTriangle, jsonSerializerOptions); + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) { if (equilateralTriangle.ShapeType == null) throw new ArgumentNullException(nameof(equilateralTriangle.ShapeType), "Property is required for class EquilateralTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/File.cs index c9e1e253673..cc0ffd3e033 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/File.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, file, jsonSerializerOptions); + WriteProperties(writer, file, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) { if (file.SourceURIOption.IsSet && file.SourceURI == null) throw new ArgumentNullException(nameof(file.SourceURI), "Property is required for class File."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 37d56cfbb84..c48ca22ddc8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fileSchemaTestClass, jsonSerializerOptions); + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) { if (fileSchemaTestClass.FileOption.IsSet && fileSchemaTestClass.File == null) throw new ArgumentNullException(nameof(fileSchemaTestClass.File), "Property is required for class FileSchemaTestClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Foo.cs index d7b6cae2587..65826736eb9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Foo.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, foo, jsonSerializerOptions); + WriteProperties(writer, foo, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) { if (foo.BarOption.IsSet && foo.Bar == null) throw new ArgumentNullException(nameof(foo.Bar), "Property is required for class Foo."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 78fc7266917..ca7d6abeade 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fooGetDefaultResponse, jsonSerializerOptions); + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) { if (fooGetDefaultResponse.StringOption.IsSet && fooGetDefaultResponse.String == null) throw new ArgumentNullException(nameof(fooGetDefaultResponse.String), "Property is required for class FooGetDefaultResponse."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index f5b11b31afe..2274b53efdf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -706,7 +706,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, formatTest, jsonSerializerOptions); + WriteProperties(writer, formatTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -717,7 +717,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) { if (formatTest.Byte == null) throw new ArgumentNullException(nameof(formatTest.Byte), "Property is required for class FormatTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Fruit.cs index 582edf903a4..3331b736cfc 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Fruit.cs @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FruitReq.cs index 570b86e0050..c2942aea0f4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FruitReq.cs @@ -172,7 +172,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruitReq, jsonSerializerOptions); + WriteProperties(writer, fruitReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -183,7 +183,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GmFruit.cs index e00086e3d47..112112a55b5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GmFruit.cs @@ -206,16 +206,16 @@ namespace Org.OpenAPITools.Model if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, gmFruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, gmFruit.AppleOption.Value, jsonSerializerOptions); } if (gmFruit.BananaOption.IsSet && gmFruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, gmFruit, jsonSerializerOptions); + WriteProperties(writer, gmFruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) { if (gmFruit.ColorOption.IsSet && gmFruit.Color == null) throw new ArgumentNullException(nameof(gmFruit.Color), "Property is required for class GmFruit."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index e2a86feac42..12a7ac828e2 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -35,21 +35,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public GrandparentAnimal(string petType) + public GrandparentAnimal() { - PetType = petType; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public string PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; /// /// Gets or Sets additional properties @@ -65,7 +64,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -116,6 +114,14 @@ namespace Org.OpenAPITools.Model Option petType = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("ParentPet")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -146,7 +152,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); - return new GrandparentAnimal(petType.Value!); + return new GrandparentAnimal(); } /// @@ -158,9 +164,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { + if (grandparentAnimal is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + if (grandparentAnimal is ParentPet parentPet){ + JsonSerializer.Serialize(writer, parentPet, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, grandparentAnimal, jsonSerializerOptions); + WriteProperties(writer, grandparentAnimal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -171,11 +187,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { - if (grandparentAnimal.PetType == null) - throw new ArgumentNullException(nameof(grandparentAnimal.PetType), "Property is required for class GrandparentAnimal."); - writer.WriteString("pet_type", grandparentAnimal.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 0f313e776a4..4b3fca9fef5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, hasOnlyReadOnly, jsonSerializerOptions); + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) { if (hasOnlyReadOnly.BarOption.IsSet && hasOnlyReadOnly.Bar == null) throw new ArgumentNullException(nameof(hasOnlyReadOnly.Bar), "Property is required for class HasOnlyReadOnly."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HealthCheckResult.cs index 3e9090daf3a..cff257a9cb5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, healthCheckResult, jsonSerializerOptions); + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) { if (healthCheckResult.NullableMessageOption.IsSet) if (healthCheckResult.NullableMessageOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index a4015cfa38f..fdc2bd927d0 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, isoscelesTriangle, jsonSerializerOptions); + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -173,7 +173,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) { if (isoscelesTriangle.ShapeType == null) throw new ArgumentNullException(nameof(isoscelesTriangle.ShapeType), "Property is required for class IsoscelesTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/List.cs index 526f27528ec..e188a49d3f5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/List.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, list, jsonSerializerOptions); + WriteProperties(writer, list, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) { if (list.Var123ListOption.IsSet && list.Var123List == null) throw new ArgumentNullException(nameof(list.Var123List), "Property is required for class List."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/LiteralStringClass.cs index 843719eba58..5fa48501291 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, literalStringClass, jsonSerializerOptions); + WriteProperties(writer, literalStringClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) { if (literalStringClass.EscapedLiteralStringOption.IsSet && literalStringClass.EscapedLiteralString == null) throw new ArgumentNullException(nameof(literalStringClass.EscapedLiteralString), "Property is required for class LiteralStringClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Mammal.cs index 90d85e3d306..15c63b5d785 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Mammal.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Whale whale, string className) + public Mammal(Whale whale) { Whale = whale; - ClassName = className; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Zebra zebra, string className) + public Mammal(Zebra zebra) { Zebra = zebra; - ClassName = className; OnCreated(); } @@ -60,11 +56,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Pig pig, string className) + public Mammal(Pig pig) { Pig = pig; - ClassName = className; OnCreated(); } @@ -85,12 +79,6 @@ namespace Org.OpenAPITools.Model /// public Pig? Pig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -105,7 +93,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Mammal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -226,13 +213,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); if (pig != null) - return new Mammal(pig, className.Value!); + return new Mammal(pig); if (whale != null) - return new Mammal(whale, className.Value!); + return new Mammal(whale); if (zebra != null) - return new Mammal(zebra, className.Value!); + return new Mammal(zebra); throw new JsonException(); } @@ -250,20 +237,20 @@ namespace Org.OpenAPITools.Model if (mammal.Whale != null) { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); - whaleJsonConverter.WriteProperties(ref writer, mammal.Whale, jsonSerializerOptions); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } if (mammal.Zebra != null) { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); - zebraJsonConverter.WriteProperties(ref writer, mammal.Zebra, jsonSerializerOptions); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } if (mammal.Pig != null) { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); - pigJsonConverter.WriteProperties(ref writer, mammal.Pig, jsonSerializerOptions); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } - WriteProperties(ref writer, mammal, jsonSerializerOptions); + WriteProperties(writer, mammal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -274,12 +261,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) { - if (mammal.ClassName == null) - throw new ArgumentNullException(nameof(mammal.ClassName), "Property is required for class Mammal."); - writer.WriteString("className", mammal.ClassName); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs index ee394fb6e8f..ce7434b68fa 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs @@ -293,7 +293,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mapTest, jsonSerializerOptions); + WriteProperties(writer, mapTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -304,7 +304,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) { if (mapTest.DirectMapOption.IsSet && mapTest.DirectMap == null) throw new ArgumentNullException(nameof(mapTest.DirectMap), "Property is required for class MapTest."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..2b06f1ac25c --- /dev/null +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1037 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using System.Text.Json.Serialization.Metadata; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + public partial class MixLog : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// description + /// formulaVersionDate + /// id + /// mixDate + /// totalOverPoors + /// totalRecalculations + /// totalSkips + /// totalUnderPours + /// batchNumber + /// BrandCode is only required for non-color mixes + /// BrandId is only required for color mixes + /// BrandName is only required for color mixes + /// CategoryCode is not used anymore + /// Color is only required for color mixes + /// colorDescription + /// comment + /// commercialProductCode + /// country + /// createdBy + /// createdByFirstName + /// createdByLastName + /// deltaECalculationRepaired + /// deltaECalculationSprayout + /// ownColorVariantNumber + /// primerProductId + /// ProductId is only required for color mixes + /// ProductLineCode is only required for color mixes + /// ProductName is only required for color mixes + /// selectedVersionIndex + /// shopId + /// SomeCode is only required for color mixes + /// totalPrice + [JsonConstructor] + public MixLog(string description, DateTime formulaVersionDate, Guid id, DateTime mixDate, int totalOverPoors, int totalRecalculations, int totalSkips, int totalUnderPours, Option batchNumber = default, Option brandCode = default, Option brandId = default, Option brandName = default, Option categoryCode = default, Option color = default, Option colorDescription = default, Option comment = default, Option commercialProductCode = default, Option country = default, Option createdBy = default, Option createdByFirstName = default, Option createdByLastName = default, Option deltaECalculationRepaired = default, Option deltaECalculationSprayout = default, Option ownColorVariantNumber = default, Option primerProductId = default, Option productId = default, Option productLineCode = default, Option productName = default, Option selectedVersionIndex = default, Option shopId = default, Option someCode = default, Option totalPrice = default) + { + Description = description; + FormulaVersionDate = formulaVersionDate; + Id = id; + MixDate = mixDate; + TotalOverPoors = totalOverPoors; + TotalRecalculations = totalRecalculations; + TotalSkips = totalSkips; + TotalUnderPours = totalUnderPours; + BatchNumberOption = batchNumber; + BrandCodeOption = brandCode; + BrandIdOption = brandId; + BrandNameOption = brandName; + CategoryCodeOption = categoryCode; + ColorOption = color; + ColorDescriptionOption = colorDescription; + CommentOption = comment; + CommercialProductCodeOption = commercialProductCode; + CountryOption = country; + CreatedByOption = createdBy; + CreatedByFirstNameOption = createdByFirstName; + CreatedByLastNameOption = createdByLastName; + DeltaECalculationRepairedOption = deltaECalculationRepaired; + DeltaECalculationSprayoutOption = deltaECalculationSprayout; + OwnColorVariantNumberOption = ownColorVariantNumber; + PrimerProductIdOption = primerProductId; + ProductIdOption = productId; + ProductLineCodeOption = productLineCode; + ProductNameOption = productName; + SelectedVersionIndexOption = selectedVersionIndex; + ShopIdOption = shopId; + SomeCodeOption = someCode; + TotalPriceOption = totalPrice; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [JsonPropertyName("formulaVersionDate")] + public DateTime FormulaVersionDate { get; set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public Guid Id { get; set; } + + /// + /// Gets or Sets MixDate + /// + [JsonPropertyName("mixDate")] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [JsonPropertyName("totalOverPoors")] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [JsonPropertyName("totalRecalculations")] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [JsonPropertyName("totalSkips")] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [JsonPropertyName("totalUnderPours")] + public int TotalUnderPours { get; set; } + + /// + /// Used to track the state of BatchNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BatchNumberOption { get; private set; } + + /// + /// Gets or Sets BatchNumber + /// + [JsonPropertyName("batchNumber")] + public string? BatchNumber { get { return this.BatchNumberOption; } set { this.BatchNumberOption = new(value); } } + + /// + /// Used to track the state of BrandCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandCodeOption { get; private set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [JsonPropertyName("brandCode")] + public string? BrandCode { get { return this.BrandCodeOption; } set { this.BrandCodeOption = new(value); } } + + /// + /// Used to track the state of BrandId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandIdOption { get; private set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [JsonPropertyName("brandId")] + public string? BrandId { get { return this.BrandIdOption; } set { this.BrandIdOption = new(value); } } + + /// + /// Used to track the state of BrandName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandNameOption { get; private set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [JsonPropertyName("brandName")] + public string? BrandName { get { return this.BrandNameOption; } set { this.BrandNameOption = new(value); } } + + /// + /// Used to track the state of CategoryCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryCodeOption { get; private set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [JsonPropertyName("categoryCode")] + public string? CategoryCode { get { return this.CategoryCodeOption; } set { this.CategoryCodeOption = new(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [JsonPropertyName("color")] + public string? Color { get { return this.ColorOption; } set { this.ColorOption = new(value); } } + + /// + /// Used to track the state of ColorDescription + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorDescriptionOption { get; private set; } + + /// + /// Gets or Sets ColorDescription + /// + [JsonPropertyName("colorDescription")] + public string? ColorDescription { get { return this.ColorDescriptionOption; } set { this.ColorDescriptionOption = new(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string? Comment { get { return this.CommentOption; } set { this.CommentOption = new(value); } } + + /// + /// Used to track the state of CommercialProductCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommercialProductCodeOption { get; private set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [JsonPropertyName("commercialProductCode")] + public string? CommercialProductCode { get { return this.CommercialProductCodeOption; } set { this.CommercialProductCodeOption = new(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } + + /// + /// Gets or Sets Country + /// + [JsonPropertyName("country")] + public string? Country { get { return this.CountryOption; } set { this.CountryOption = new(value); } } + + /// + /// Used to track the state of CreatedBy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByOption { get; private set; } + + /// + /// Gets or Sets CreatedBy + /// + [JsonPropertyName("createdBy")] + public string? CreatedBy { get { return this.CreatedByOption; } set { this.CreatedByOption = new(value); } } + + /// + /// Used to track the state of CreatedByFirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByFirstNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [JsonPropertyName("createdByFirstName")] + public string? CreatedByFirstName { get { return this.CreatedByFirstNameOption; } set { this.CreatedByFirstNameOption = new(value); } } + + /// + /// Used to track the state of CreatedByLastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByLastNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [JsonPropertyName("createdByLastName")] + public string? CreatedByLastName { get { return this.CreatedByLastNameOption; } set { this.CreatedByLastNameOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationRepaired + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationRepairedOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [JsonPropertyName("deltaECalculationRepaired")] + public string? DeltaECalculationRepaired { get { return this.DeltaECalculationRepairedOption; } set { this.DeltaECalculationRepairedOption = new(value); } } + + /// + /// Used to track the state of DeltaECalculationSprayout + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationSprayoutOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [JsonPropertyName("deltaECalculationSprayout")] + public string? DeltaECalculationSprayout { get { return this.DeltaECalculationSprayoutOption; } set { this.DeltaECalculationSprayoutOption = new(value); } } + + /// + /// Used to track the state of OwnColorVariantNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnColorVariantNumberOption { get; private set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [JsonPropertyName("ownColorVariantNumber")] + public int? OwnColorVariantNumber { get { return this.OwnColorVariantNumberOption; } set { this.OwnColorVariantNumberOption = new(value); } } + + /// + /// Used to track the state of PrimerProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PrimerProductIdOption { get; private set; } + + /// + /// Gets or Sets PrimerProductId + /// + [JsonPropertyName("primerProductId")] + public string? PrimerProductId { get { return this.PrimerProductIdOption; } set { this.PrimerProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductIdOption { get; private set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [JsonPropertyName("productId")] + public string? ProductId { get { return this.ProductIdOption; } set { this.ProductIdOption = new(value); } } + + /// + /// Used to track the state of ProductLineCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductLineCodeOption { get; private set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [JsonPropertyName("productLineCode")] + public string? ProductLineCode { get { return this.ProductLineCodeOption; } set { this.ProductLineCodeOption = new(value); } } + + /// + /// Used to track the state of ProductName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductNameOption { get; private set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [JsonPropertyName("productName")] + public string? ProductName { get { return this.ProductNameOption; } set { this.ProductNameOption = new(value); } } + + /// + /// Used to track the state of SelectedVersionIndex + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedVersionIndexOption { get; private set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [JsonPropertyName("selectedVersionIndex")] + public int? SelectedVersionIndex { get { return this.SelectedVersionIndexOption; } set { this.SelectedVersionIndexOption = new(value); } } + + /// + /// Used to track the state of ShopId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopIdOption { get; private set; } + + /// + /// Gets or Sets ShopId + /// + [JsonPropertyName("shopId")] + public Guid? ShopId { get { return this.ShopIdOption; } set { this.ShopIdOption = new(value); } } + + /// + /// Used to track the state of SomeCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomeCodeOption { get; private set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [JsonPropertyName("someCode")] + public string? SomeCode { get { return this.SomeCodeOption; } set { this.SomeCodeOption = new(value); } } + + /// + /// Used to track the state of TotalPrice + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalPriceOption { get; private set; } + + /// + /// Gets or Sets TotalPrice + /// + [JsonPropertyName("totalPrice")] + public float? TotalPrice { get { return this.TotalPriceOption; } set { this.TotalPriceOption = new(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixLogJsonConverter : JsonConverter + { + /// + /// The format to use to serialize FormulaVersionDate + /// + public static string FormulaVersionDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize MixDate + /// + public static string MixDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixLog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option description = default; + Option formulaVersionDate = default; + Option id = default; + Option mixDate = default; + Option totalOverPoors = default; + Option totalRecalculations = default; + Option totalSkips = default; + Option totalUnderPours = default; + Option batchNumber = default; + Option brandCode = default; + Option brandId = default; + Option brandName = default; + Option categoryCode = default; + Option color = default; + Option colorDescription = default; + Option comment = default; + Option commercialProductCode = default; + Option country = default; + Option createdBy = default; + Option createdByFirstName = default; + Option createdByLastName = default; + Option deltaECalculationRepaired = default; + Option deltaECalculationSprayout = default; + Option ownColorVariantNumber = default; + Option primerProductId = default; + Option productId = default; + Option productLineCode = default; + Option productName = default; + Option selectedVersionIndex = default; + Option shopId = default; + Option someCode = default; + Option totalPrice = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "description": + description = new Option(utf8JsonReader.GetString()!); + break; + case "formulaVersionDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + formulaVersionDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetGuid()); + break; + case "mixDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mixDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalOverPoors": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalOverPoors = new Option(utf8JsonReader.GetInt32()); + break; + case "totalRecalculations": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalRecalculations = new Option(utf8JsonReader.GetInt32()); + break; + case "totalSkips": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalSkips = new Option(utf8JsonReader.GetInt32()); + break; + case "totalUnderPours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalUnderPours = new Option(utf8JsonReader.GetInt32()); + break; + case "batchNumber": + batchNumber = new Option(utf8JsonReader.GetString()!); + break; + case "brandCode": + brandCode = new Option(utf8JsonReader.GetString()!); + break; + case "brandId": + brandId = new Option(utf8JsonReader.GetString()!); + break; + case "brandName": + brandName = new Option(utf8JsonReader.GetString()!); + break; + case "categoryCode": + categoryCode = new Option(utf8JsonReader.GetString()!); + break; + case "color": + color = new Option(utf8JsonReader.GetString()!); + break; + case "colorDescription": + colorDescription = new Option(utf8JsonReader.GetString()!); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()!); + break; + case "commercialProductCode": + commercialProductCode = new Option(utf8JsonReader.GetString()!); + break; + case "country": + country = new Option(utf8JsonReader.GetString()!); + break; + case "createdBy": + createdBy = new Option(utf8JsonReader.GetString()!); + break; + case "createdByFirstName": + createdByFirstName = new Option(utf8JsonReader.GetString()!); + break; + case "createdByLastName": + createdByLastName = new Option(utf8JsonReader.GetString()!); + break; + case "deltaECalculationRepaired": + deltaECalculationRepaired = new Option(utf8JsonReader.GetString()!); + break; + case "deltaECalculationSprayout": + deltaECalculationSprayout = new Option(utf8JsonReader.GetString()!); + break; + case "ownColorVariantNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ownColorVariantNumber = new Option(utf8JsonReader.GetInt32()); + break; + case "primerProductId": + primerProductId = new Option(utf8JsonReader.GetString()!); + break; + case "productId": + productId = new Option(utf8JsonReader.GetString()!); + break; + case "productLineCode": + productLineCode = new Option(utf8JsonReader.GetString()!); + break; + case "productName": + productName = new Option(utf8JsonReader.GetString()!); + break; + case "selectedVersionIndex": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selectedVersionIndex = new Option(utf8JsonReader.GetInt32()); + break; + case "shopId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopId = new Option(utf8JsonReader.GetGuid()); + break; + case "someCode": + someCode = new Option(utf8JsonReader.GetString()); + break; + case "totalPrice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalPrice = new Option((float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!description.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(description)); + + if (!formulaVersionDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(formulaVersionDate)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(id)); + + if (!mixDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(mixDate)); + + if (!totalOverPoors.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalOverPoors)); + + if (!totalRecalculations.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalRecalculations)); + + if (!totalSkips.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalSkips)); + + if (!totalUnderPours.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalUnderPours)); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class MixLog."); + + if (formulaVersionDate.IsSet && formulaVersionDate.Value == null) + throw new ArgumentNullException(nameof(formulaVersionDate), "Property is not nullable for class MixLog."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixLog."); + + if (mixDate.IsSet && mixDate.Value == null) + throw new ArgumentNullException(nameof(mixDate), "Property is not nullable for class MixLog."); + + if (totalOverPoors.IsSet && totalOverPoors.Value == null) + throw new ArgumentNullException(nameof(totalOverPoors), "Property is not nullable for class MixLog."); + + if (totalRecalculations.IsSet && totalRecalculations.Value == null) + throw new ArgumentNullException(nameof(totalRecalculations), "Property is not nullable for class MixLog."); + + if (totalSkips.IsSet && totalSkips.Value == null) + throw new ArgumentNullException(nameof(totalSkips), "Property is not nullable for class MixLog."); + + if (totalUnderPours.IsSet && totalUnderPours.Value == null) + throw new ArgumentNullException(nameof(totalUnderPours), "Property is not nullable for class MixLog."); + + if (batchNumber.IsSet && batchNumber.Value == null) + throw new ArgumentNullException(nameof(batchNumber), "Property is not nullable for class MixLog."); + + if (brandCode.IsSet && brandCode.Value == null) + throw new ArgumentNullException(nameof(brandCode), "Property is not nullable for class MixLog."); + + if (brandId.IsSet && brandId.Value == null) + throw new ArgumentNullException(nameof(brandId), "Property is not nullable for class MixLog."); + + if (brandName.IsSet && brandName.Value == null) + throw new ArgumentNullException(nameof(brandName), "Property is not nullable for class MixLog."); + + if (categoryCode.IsSet && categoryCode.Value == null) + throw new ArgumentNullException(nameof(categoryCode), "Property is not nullable for class MixLog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class MixLog."); + + if (colorDescription.IsSet && colorDescription.Value == null) + throw new ArgumentNullException(nameof(colorDescription), "Property is not nullable for class MixLog."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class MixLog."); + + if (commercialProductCode.IsSet && commercialProductCode.Value == null) + throw new ArgumentNullException(nameof(commercialProductCode), "Property is not nullable for class MixLog."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class MixLog."); + + if (createdBy.IsSet && createdBy.Value == null) + throw new ArgumentNullException(nameof(createdBy), "Property is not nullable for class MixLog."); + + if (createdByFirstName.IsSet && createdByFirstName.Value == null) + throw new ArgumentNullException(nameof(createdByFirstName), "Property is not nullable for class MixLog."); + + if (createdByLastName.IsSet && createdByLastName.Value == null) + throw new ArgumentNullException(nameof(createdByLastName), "Property is not nullable for class MixLog."); + + if (deltaECalculationRepaired.IsSet && deltaECalculationRepaired.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationRepaired), "Property is not nullable for class MixLog."); + + if (deltaECalculationSprayout.IsSet && deltaECalculationSprayout.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationSprayout), "Property is not nullable for class MixLog."); + + if (primerProductId.IsSet && primerProductId.Value == null) + throw new ArgumentNullException(nameof(primerProductId), "Property is not nullable for class MixLog."); + + if (productId.IsSet && productId.Value == null) + throw new ArgumentNullException(nameof(productId), "Property is not nullable for class MixLog."); + + if (productLineCode.IsSet && productLineCode.Value == null) + throw new ArgumentNullException(nameof(productLineCode), "Property is not nullable for class MixLog."); + + if (productName.IsSet && productName.Value == null) + throw new ArgumentNullException(nameof(productName), "Property is not nullable for class MixLog."); + + if (selectedVersionIndex.IsSet && selectedVersionIndex.Value == null) + throw new ArgumentNullException(nameof(selectedVersionIndex), "Property is not nullable for class MixLog."); + + if (shopId.IsSet && shopId.Value == null) + throw new ArgumentNullException(nameof(shopId), "Property is not nullable for class MixLog."); + + return new MixLog(description.Value!, formulaVersionDate.Value!.Value!, id.Value!.Value!, mixDate.Value!.Value!, totalOverPoors.Value!.Value!, totalRecalculations.Value!.Value!, totalSkips.Value!.Value!, totalUnderPours.Value!.Value!, batchNumber, brandCode, brandId, brandName, categoryCode, color, colorDescription, comment, commercialProductCode, country, createdBy, createdByFirstName, createdByLastName, deltaECalculationRepaired, deltaECalculationSprayout, ownColorVariantNumber, primerProductId, productId, productLineCode, productName, selectedVersionIndex, shopId, someCode, totalPrice); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixLog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + if (mixLog.Description == null) + throw new ArgumentNullException(nameof(mixLog.Description), "Property is required for class MixLog."); + + if (mixLog.BatchNumberOption.IsSet && mixLog.BatchNumber == null) + throw new ArgumentNullException(nameof(mixLog.BatchNumber), "Property is required for class MixLog."); + + if (mixLog.BrandCodeOption.IsSet && mixLog.BrandCode == null) + throw new ArgumentNullException(nameof(mixLog.BrandCode), "Property is required for class MixLog."); + + if (mixLog.BrandIdOption.IsSet && mixLog.BrandId == null) + throw new ArgumentNullException(nameof(mixLog.BrandId), "Property is required for class MixLog."); + + if (mixLog.BrandNameOption.IsSet && mixLog.BrandName == null) + throw new ArgumentNullException(nameof(mixLog.BrandName), "Property is required for class MixLog."); + + if (mixLog.CategoryCodeOption.IsSet && mixLog.CategoryCode == null) + throw new ArgumentNullException(nameof(mixLog.CategoryCode), "Property is required for class MixLog."); + + if (mixLog.ColorOption.IsSet && mixLog.Color == null) + throw new ArgumentNullException(nameof(mixLog.Color), "Property is required for class MixLog."); + + if (mixLog.ColorDescriptionOption.IsSet && mixLog.ColorDescription == null) + throw new ArgumentNullException(nameof(mixLog.ColorDescription), "Property is required for class MixLog."); + + if (mixLog.CommentOption.IsSet && mixLog.Comment == null) + throw new ArgumentNullException(nameof(mixLog.Comment), "Property is required for class MixLog."); + + if (mixLog.CommercialProductCodeOption.IsSet && mixLog.CommercialProductCode == null) + throw new ArgumentNullException(nameof(mixLog.CommercialProductCode), "Property is required for class MixLog."); + + if (mixLog.CountryOption.IsSet && mixLog.Country == null) + throw new ArgumentNullException(nameof(mixLog.Country), "Property is required for class MixLog."); + + if (mixLog.CreatedByOption.IsSet && mixLog.CreatedBy == null) + throw new ArgumentNullException(nameof(mixLog.CreatedBy), "Property is required for class MixLog."); + + if (mixLog.CreatedByFirstNameOption.IsSet && mixLog.CreatedByFirstName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByFirstName), "Property is required for class MixLog."); + + if (mixLog.CreatedByLastNameOption.IsSet && mixLog.CreatedByLastName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByLastName), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationRepairedOption.IsSet && mixLog.DeltaECalculationRepaired == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationRepaired), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet && mixLog.DeltaECalculationSprayout == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationSprayout), "Property is required for class MixLog."); + + if (mixLog.PrimerProductIdOption.IsSet && mixLog.PrimerProductId == null) + throw new ArgumentNullException(nameof(mixLog.PrimerProductId), "Property is required for class MixLog."); + + if (mixLog.ProductIdOption.IsSet && mixLog.ProductId == null) + throw new ArgumentNullException(nameof(mixLog.ProductId), "Property is required for class MixLog."); + + if (mixLog.ProductLineCodeOption.IsSet && mixLog.ProductLineCode == null) + throw new ArgumentNullException(nameof(mixLog.ProductLineCode), "Property is required for class MixLog."); + + if (mixLog.ProductNameOption.IsSet && mixLog.ProductName == null) + throw new ArgumentNullException(nameof(mixLog.ProductName), "Property is required for class MixLog."); + + writer.WriteString("description", mixLog.Description); + + writer.WriteString("formulaVersionDate", mixLog.FormulaVersionDate.ToString(FormulaVersionDateFormat)); + + writer.WriteString("id", mixLog.Id); + + writer.WriteString("mixDate", mixLog.MixDate.ToString(MixDateFormat)); + + writer.WriteNumber("totalOverPoors", mixLog.TotalOverPoors); + + writer.WriteNumber("totalRecalculations", mixLog.TotalRecalculations); + + writer.WriteNumber("totalSkips", mixLog.TotalSkips); + + writer.WriteNumber("totalUnderPours", mixLog.TotalUnderPours); + + if (mixLog.BatchNumberOption.IsSet) + writer.WriteString("batchNumber", mixLog.BatchNumber); + + if (mixLog.BrandCodeOption.IsSet) + writer.WriteString("brandCode", mixLog.BrandCode); + + if (mixLog.BrandIdOption.IsSet) + writer.WriteString("brandId", mixLog.BrandId); + + if (mixLog.BrandNameOption.IsSet) + writer.WriteString("brandName", mixLog.BrandName); + + if (mixLog.CategoryCodeOption.IsSet) + writer.WriteString("categoryCode", mixLog.CategoryCode); + + if (mixLog.ColorOption.IsSet) + writer.WriteString("color", mixLog.Color); + + if (mixLog.ColorDescriptionOption.IsSet) + writer.WriteString("colorDescription", mixLog.ColorDescription); + + if (mixLog.CommentOption.IsSet) + writer.WriteString("comment", mixLog.Comment); + + if (mixLog.CommercialProductCodeOption.IsSet) + writer.WriteString("commercialProductCode", mixLog.CommercialProductCode); + + if (mixLog.CountryOption.IsSet) + writer.WriteString("country", mixLog.Country); + + if (mixLog.CreatedByOption.IsSet) + writer.WriteString("createdBy", mixLog.CreatedBy); + + if (mixLog.CreatedByFirstNameOption.IsSet) + writer.WriteString("createdByFirstName", mixLog.CreatedByFirstName); + + if (mixLog.CreatedByLastNameOption.IsSet) + writer.WriteString("createdByLastName", mixLog.CreatedByLastName); + + if (mixLog.DeltaECalculationRepairedOption.IsSet) + writer.WriteString("deltaECalculationRepaired", mixLog.DeltaECalculationRepaired); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet) + writer.WriteString("deltaECalculationSprayout", mixLog.DeltaECalculationSprayout); + + if (mixLog.OwnColorVariantNumberOption.IsSet) + if (mixLog.OwnColorVariantNumberOption.Value != null) + writer.WriteNumber("ownColorVariantNumber", mixLog.OwnColorVariantNumberOption.Value!.Value); + else + writer.WriteNull("ownColorVariantNumber"); + + if (mixLog.PrimerProductIdOption.IsSet) + writer.WriteString("primerProductId", mixLog.PrimerProductId); + + if (mixLog.ProductIdOption.IsSet) + writer.WriteString("productId", mixLog.ProductId); + + if (mixLog.ProductLineCodeOption.IsSet) + writer.WriteString("productLineCode", mixLog.ProductLineCode); + + if (mixLog.ProductNameOption.IsSet) + writer.WriteString("productName", mixLog.ProductName); + + if (mixLog.SelectedVersionIndexOption.IsSet) + writer.WriteNumber("selectedVersionIndex", mixLog.SelectedVersionIndexOption.Value!.Value); + + if (mixLog.ShopIdOption.IsSet) + writer.WriteString("shopId", mixLog.ShopIdOption.Value!.Value); + + if (mixLog.SomeCodeOption.IsSet) + if (mixLog.SomeCodeOption.Value != null) + writer.WriteString("someCode", mixLog.SomeCode); + else + writer.WriteNull("someCode"); + + if (mixLog.TotalPriceOption.IsSet) + if (mixLog.TotalPriceOption.Value != null) + writer.WriteNumber("totalPrice", mixLog.TotalPriceOption.Value!.Value); + else + writer.WriteNull("totalPrice"); + } + } + + /// + /// The MixLogSerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(MixLog))] + public partial class MixLogSerializationContext : JsonSerializerContext { } +} diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 900f6c89479..f91b244db08 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -250,7 +250,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet && mixedPropertiesAndAdditionalPropertiesClass.Map == null) throw new ArgumentNullException(nameof(mixedPropertiesAndAdditionalPropertiesClass.Map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs index 00b3de337ad..de2a2d525d2 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, model200Response, jsonSerializerOptions); + WriteProperties(writer, model200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) { if (model200Response.ClassOption.IsSet && model200Response.Class == null) throw new ArgumentNullException(nameof(model200Response.Class), "Property is required for class Model200Response."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ModelClient.cs index 745e34d1bde..fd3eb29a78f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ModelClient.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, modelClient, jsonSerializerOptions); + WriteProperties(writer, modelClient, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) { if (modelClient.VarClientOption.IsSet && modelClient.VarClient == null) throw new ArgumentNullException(nameof(modelClient.VarClient), "Property is required for class ModelClient."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs index 48d338a98d9..2ded0896855 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs @@ -263,7 +263,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, name, jsonSerializerOptions); + WriteProperties(writer, name, jsonSerializerOptions); writer.WriteEndObject(); } @@ -274,7 +274,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { if (name.PropertyOption.IsSet && name.Property == null) throw new ArgumentNullException(nameof(name.Property), "Property is required for class Name."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index 41e83711cd4..c74bf13f6d0 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); writer.WriteEndObject(); } @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) { if (notificationtestGetElementsV1ResponseMPayload.AObjVariableobject == null) throw new ArgumentNullException(nameof(notificationtestGetElementsV1ResponseMPayload.AObjVariableobject), "Property is required for class NotificationtestGetElementsV1ResponseMPayload."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs index bdfbba4e53a..ab7911eb6cf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs @@ -398,7 +398,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableClass, jsonSerializerOptions); + WriteProperties(writer, nullableClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -409,7 +409,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableClass.ArrayItemsNullableOption.IsSet && nullableClass.ArrayItemsNullable == null) throw new ArgumentNullException(nameof(nullableClass.ArrayItemsNullable), "Property is required for class NullableClass."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 80bbe636918..d037c1a335c 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableGuidClass, jsonSerializerOptions); + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableGuidClass.UuidOption.IsSet) if (nullableGuidClass.UuidOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableShape.cs index 75c5f908727..db1d9df8102 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableShape.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Triangle triangle, string shapeType) + public NullableShape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Quadrilateral quadrilateral, string shapeType) + public NullableShape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -68,12 +64,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -88,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class NullableShape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -203,10 +192,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); if (quadrilateral != null) - return new NullableShape(quadrilateral, shapeType.Value!); + return new NullableShape(quadrilateral); if (triangle != null) - return new NullableShape(triangle, shapeType.Value!); + return new NullableShape(triangle); throw new JsonException(); } @@ -224,15 +213,15 @@ namespace Org.OpenAPITools.Model if (nullableShape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, nullableShape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } if (nullableShape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, nullableShape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, nullableShape, jsonSerializerOptions); + WriteProperties(writer, nullableShape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -243,12 +232,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) { - if (nullableShape.ShapeType == null) - throw new ArgumentNullException(nameof(nullableShape.ShapeType), "Property is required for class NullableShape."); - writer.WriteString("shapeType", nullableShape.ShapeType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs index bac081f77f3..7bd636d8289 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, numberOnly, jsonSerializerOptions); + WriteProperties(writer, numberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) { if (numberOnly.JustNumberOption.IsSet) writer.WriteNumber("JustNumber", numberOnly.JustNumberOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index d19c11d0177..38f7842d561 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, objectWithDeprecatedFields, jsonSerializerOptions); + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) { if (objectWithDeprecatedFields.BarsOption.IsSet && objectWithDeprecatedFields.Bars == null) throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Bars), "Property is required for class ObjectWithDeprecatedFields."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OneOfString.cs index b8e81d159ba..fd4bc86610d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OneOfString.cs @@ -35,19 +35,19 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal OneOfString(string varString) + /// + internal OneOfString(string @string) { - VarString = varString; + String = @string; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string? VarString { get; set; } + public string? String { get; set; } /// /// Gets or Sets additional properties @@ -141,7 +141,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, oneOfString, jsonSerializerOptions); + WriteProperties(writer, oneOfString, jsonSerializerOptions); writer.WriteEndObject(); } @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs index 21135ede6dc..56e17adb08d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs @@ -364,7 +364,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, order, jsonSerializerOptions); + WriteProperties(writer, order, jsonSerializerOptions); writer.WriteEndObject(); } @@ -375,7 +375,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) { if (order.CompleteOption.IsSet) writer.WriteBoolean("complete", order.CompleteOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs index 50ab7ea2e0b..0fbfdb54577 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -202,7 +202,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, outerComposite, jsonSerializerOptions); + WriteProperties(writer, outerComposite, jsonSerializerOptions); writer.WriteEndObject(); } @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) { if (outerComposite.MyStringOption.IsSet && outerComposite.MyString == null) throw new ArgumentNullException(nameof(outerComposite.MyString), "Property is required for class OuterComposite."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ParentPet.cs index 2e56fefaa93..fe5dc7e87a5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ParentPet.cs @@ -35,15 +35,21 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public ParentPet(string petType) : base(petType) + public ParentPet() : base() { OnCreated(); } partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string PetType { get; } = "ParentPet"; + /// /// Returns the string presentation of the object /// @@ -82,6 +88,11 @@ namespace Org.OpenAPITools.Model Option petType = default; + string? discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -112,7 +123,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); - return new ParentPet(petType.Value!); + return new ParentPet(); } /// @@ -124,9 +135,14 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, parentPet, jsonSerializerOptions); + WriteProperties(writer, parentPet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -137,11 +153,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { - if (parentPet.PetType == null) - throw new ArgumentNullException(nameof(parentPet.PetType), "Property is required for class ParentPet."); - writer.WriteString("pet_type", parentPet.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs index 453564c6d08..59d97689491 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs @@ -350,7 +350,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, pet, jsonSerializerOptions); + WriteProperties(writer, pet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -361,7 +361,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) { if (pet.Name == null) throw new ArgumentNullException(nameof(pet.Name), "Property is required for class Pet."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pig.cs index 19807191bd6..88ffcca1004 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pig.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(BasquePig basquePig, string className) + public Pig(BasquePig basquePig) { BasquePig = basquePig; - ClassName = className; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(DanishPig danishPig, string className) + public Pig(DanishPig danishPig) { DanishPig = danishPig; - ClassName = className; OnCreated(); } @@ -68,12 +64,6 @@ namespace Org.OpenAPITools.Model /// public DanishPig? DanishPig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -88,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Pig {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -203,10 +192,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); if (basquePig != null) - return new Pig(basquePig, className.Value!); + return new Pig(basquePig); if (danishPig != null) - return new Pig(danishPig, className.Value!); + return new Pig(danishPig); throw new JsonException(); } @@ -224,15 +213,15 @@ namespace Org.OpenAPITools.Model if (pig.BasquePig != null) { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); - basquePigJsonConverter.WriteProperties(ref writer, pig.BasquePig, jsonSerializerOptions); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } if (pig.DanishPig != null) { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); - danishPigJsonConverter.WriteProperties(ref writer, pig.DanishPig, jsonSerializerOptions); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } - WriteProperties(ref writer, pig, jsonSerializerOptions); + WriteProperties(writer, pig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -243,12 +232,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) { - if (pig.ClassName == null) - throw new ArgumentNullException(nameof(pig.ClassName), "Property is required for class Pig."); - writer.WriteString("className", pig.ClassName); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 16c6d68ac57..d61a3a66921 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -35,20 +35,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(bool varBool) + /// + internal PolymorphicProperty(bool @bool) { - VarBool = varBool; + Bool = @bool; OnCreated(); } /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(string varString) + /// + internal PolymorphicProperty(string @string) { - VarString = varString; + String = @string; OnCreated(); } @@ -75,14 +75,14 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets VarBool + /// Gets or Sets Bool /// - public bool? VarBool { get; set; } + public bool? Bool { get; set; } /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string? VarString { get; set; } + public string? String { get; set; } /// /// Gets or Sets Object @@ -162,11 +162,11 @@ namespace Org.OpenAPITools.Model if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); - Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model } if (varBool != null) - return new PolymorphicProperty(varBool); + return new PolymorphicProperty(varBool.Value); if (varString != null) return new PolymorphicProperty(varString); @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, polymorphicProperty, jsonSerializerOptions); + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); writer.WriteEndObject(); } @@ -234,7 +234,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Quadrilateral.cs index fc276899411..21f614134e6 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral, string quadrilateralType) + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) { SimpleQuadrilateral = simpleQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(ComplexQuadrilateral complexQuadrilateral, string quadrilateralType) + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) { ComplexQuadrilateral = complexQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -68,12 +64,6 @@ namespace Org.OpenAPITools.Model /// public ComplexQuadrilateral? ComplexQuadrilateral { get; set; } - /// - /// Gets or Sets QuadrilateralType - /// - [JsonPropertyName("quadrilateralType")] - public string QuadrilateralType { get; set; } - /// /// Gets or Sets additional properties /// @@ -88,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Quadrilateral {\n"); - sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -203,10 +192,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); if (complexQuadrilateral != null) - return new Quadrilateral(complexQuadrilateral, quadrilateralType.Value!); + return new Quadrilateral(complexQuadrilateral); if (simpleQuadrilateral != null) - return new Quadrilateral(simpleQuadrilateral, quadrilateralType.Value!); + return new Quadrilateral(simpleQuadrilateral); throw new JsonException(); } @@ -224,15 +213,15 @@ namespace Org.OpenAPITools.Model if (quadrilateral.SimpleQuadrilateral != null) { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); - simpleQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } if (quadrilateral.ComplexQuadrilateral != null) { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); - complexQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, quadrilateral, jsonSerializerOptions); + WriteProperties(writer, quadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -243,12 +232,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) { - if (quadrilateral.QuadrilateralType == null) - throw new ArgumentNullException(nameof(quadrilateral.QuadrilateralType), "Property is required for class Quadrilateral."); - writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 9060c3f6ce7..31c5940d678 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, quadrilateralInterface, jsonSerializerOptions); + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) { if (quadrilateralInterface.QuadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralInterface.QuadrilateralType), "Property is required for class QuadrilateralInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 0e2be679b48..8bd857e6615 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, readOnlyFirst, jsonSerializerOptions); + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); writer.WriteEndObject(); } @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) { if (readOnlyFirst.BarOption.IsSet && readOnlyFirst.Bar == null) throw new ArgumentNullException(nameof(readOnlyFirst.Bar), "Property is required for class ReadOnlyFirst."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs index f5fa48c7c77..4c6f513d242 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -46,17 +46,6 @@ namespace Org.OpenAPITools.Model /// requiredNotnullableStringProp /// requiredNotnullableUuid /// requiredNotnullableintegerProp - /// requiredNullableArrayOfString - /// requiredNullableBooleanProp - /// requiredNullableDateProp - /// requiredNullableDatetimeProp - /// requiredNullableEnumInteger - /// requiredNullableEnumIntegerOnly - /// requiredNullableEnumString - /// requiredNullableIntegerProp - /// requiredNullableOuterEnumDefaultValue - /// requiredNullableStringProp - /// requiredNullableUuid /// notRequiredNotnullableDateProp /// notRequiredNotnullableintegerProp /// notRequiredNullableDateProp @@ -79,8 +68,19 @@ namespace Org.OpenAPITools.Model /// notrequiredNullableOuterEnumDefaultValue /// notrequiredNullableStringProp /// notrequiredNullableUuid + /// requiredNullableArrayOfString + /// requiredNullableBooleanProp + /// requiredNullableDateProp + /// requiredNullableDatetimeProp + /// requiredNullableEnumInteger + /// requiredNullableEnumIntegerOnly + /// requiredNullableEnumString + /// requiredNullableIntegerProp + /// requiredNullableOuterEnumDefaultValue + /// requiredNullableStringProp + /// requiredNullableUuid [JsonConstructor] - public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, List? requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string? requiredNullableStringProp = default, Guid? requiredNullableUuid = default, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option?> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option?> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default) + public RequiredClass(DateOnly requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option?> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option?> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default, List? requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateOnly? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string? requiredNullableStringProp = default, Guid? requiredNullableUuid = default) { RequiredNotNullableDateProp = requiredNotNullableDateProp; RequiredNotnullableArrayOfString = requiredNotnullableArrayOfString; @@ -93,17 +93,6 @@ namespace Org.OpenAPITools.Model RequiredNotnullableStringProp = requiredNotnullableStringProp; RequiredNotnullableUuid = requiredNotnullableUuid; RequiredNotnullableintegerProp = requiredNotnullableintegerProp; - RequiredNullableArrayOfString = requiredNullableArrayOfString; - RequiredNullableBooleanProp = requiredNullableBooleanProp; - RequiredNullableDateProp = requiredNullableDateProp; - RequiredNullableDatetimeProp = requiredNullableDatetimeProp; - RequiredNullableEnumInteger = requiredNullableEnumInteger; - RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; - RequiredNullableEnumString = requiredNullableEnumString; - RequiredNullableIntegerProp = requiredNullableIntegerProp; - RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; - RequiredNullableStringProp = requiredNullableStringProp; - RequiredNullableUuid = requiredNullableUuid; NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; NotRequiredNullableDatePropOption = notRequiredNullableDateProp; @@ -126,6 +115,17 @@ namespace Org.OpenAPITools.Model NotrequiredNullableOuterEnumDefaultValueOption = notrequiredNullableOuterEnumDefaultValue; NotrequiredNullableStringPropOption = notrequiredNullableStringProp; NotrequiredNullableUuidOption = notrequiredNullableUuid; + RequiredNullableArrayOfString = requiredNullableArrayOfString; + RequiredNullableBooleanProp = requiredNullableBooleanProp; + RequiredNullableDateProp = requiredNullableDateProp; + RequiredNullableDatetimeProp = requiredNullableDatetimeProp; + RequiredNullableEnumInteger = requiredNullableEnumInteger; + RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; + RequiredNullableEnumString = requiredNullableEnumString; + RequiredNullableIntegerProp = requiredNullableIntegerProp; + RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; + RequiredNullableStringProp = requiredNullableStringProp; + RequiredNullableUuid = requiredNullableUuid; OnCreated(); } @@ -423,301 +423,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } - /// - /// Defines RequiredNullableEnumInteger - /// - public enum RequiredNullableEnumIntegerEnum - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - - /// - /// Enum NUMBER_MINUS_1 for value: -1 - /// - NUMBER_MINUS_1 = -1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumInteger - /// - [JsonPropertyName("required_nullable_enum_integer")] - public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } - - /// - /// Defines RequiredNullableEnumIntegerOnly - /// - public enum RequiredNullableEnumIntegerOnlyEnum - { - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - - /// - /// Enum NUMBER_MINUS_2 for value: -2 - /// - NUMBER_MINUS_2 = -2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumIntegerOnly - /// - [JsonPropertyName("required_nullable_enum_integer_only")] - public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } - - /// - /// Defines RequiredNullableEnumString - /// - public enum RequiredNullableEnumStringEnum - { - /// - /// Enum UPPER for value: UPPER - /// - UPPER = 1, - - /// - /// Enum Lower for value: lower - /// - Lower = 2, - - /// - /// Enum Empty for value: - /// - Empty = 3, - - /// - /// Enum ValuewithTab for value: Value\twith tab - /// - ValuewithTab = 4, - - /// - /// Enum ValueWithQuote for value: Value with \" quote - /// - ValueWithQuote = 5, - - /// - /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote - /// - ValueWithEscapedQuote = 6, - - /// - /// Enum Duplicatevalue for value: Duplicate\nvalue - /// - Duplicatevalue = 7, - - /// - /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue - /// - Duplicatevalue2 = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string? RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) - { - if (value == null) - return null; - - if (value == RequiredNullableEnumStringEnum.UPPER) - return "UPPER"; - - if (value == RequiredNullableEnumStringEnum.Lower) - return "lower"; - - if (value == RequiredNullableEnumStringEnum.Empty) - return ""; - - if (value == RequiredNullableEnumStringEnum.ValuewithTab) - return "Value\twith tab"; - - if (value == RequiredNullableEnumStringEnum.ValueWithQuote) - return "Value with \" quote"; - - if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) - return "Value with escaped \" quote"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue) - return "Duplicate\nvalue"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) - return "Duplicate\r\nvalue"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Gets or Sets RequiredNullableEnumString - /// - [JsonPropertyName("required_nullable_enum_string")] - public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } - - /// - /// Gets or Sets RequiredNullableOuterEnumDefaultValue - /// - [JsonPropertyName("required_nullable_outerEnumDefaultValue")] - public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } - /// /// Defines NotrequiredNotnullableEnumInteger /// @@ -1361,6 +1066,301 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new(value); } } + /// + /// Defines RequiredNullableEnumInteger + /// + public enum RequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumInteger + /// + [JsonPropertyName("required_nullable_enum_integer")] + public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } + + /// + /// Defines RequiredNullableEnumIntegerOnly + /// + public enum RequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("required_nullable_enum_integer_only")] + public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNullableEnumString + /// + public enum RequiredNullableEnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2, + + /// + /// Enum Empty for value: + /// + Empty = 3, + + /// + /// Enum ValuewithTab for value: Value\twith tab + /// + ValuewithTab = 4, + + /// + /// Enum ValueWithQuote for value: Value with \" quote + /// + ValueWithQuote = 5, + + /// + /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote + /// + ValueWithEscapedQuote = 6, + + /// + /// Enum Duplicatevalue for value: Duplicate\nvalue + /// + Duplicatevalue = 7, + + /// + /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue + /// + Duplicatevalue2 = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string? RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == RequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNullableEnumString + /// + [JsonPropertyName("required_nullable_enum_string")] + public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } + /// /// Gets or Sets RequiredNotNullableDateProp /// @@ -1404,49 +1404,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullableinteger_prop")] public int RequiredNotnullableintegerProp { get; set; } - /// - /// Gets or Sets RequiredNullableArrayOfString - /// - [JsonPropertyName("required_nullable_array_of_string")] - public List? RequiredNullableArrayOfString { get; set; } - - /// - /// Gets or Sets RequiredNullableBooleanProp - /// - [JsonPropertyName("required_nullable_boolean_prop")] - public bool? RequiredNullableBooleanProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDateProp - /// - [JsonPropertyName("required_nullable_date_prop")] - public DateOnly? RequiredNullableDateProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDatetimeProp - /// - [JsonPropertyName("required_nullable_datetime_prop")] - public DateTime? RequiredNullableDatetimeProp { get; set; } - - /// - /// Gets or Sets RequiredNullableIntegerProp - /// - [JsonPropertyName("required_nullable_integer_prop")] - public int? RequiredNullableIntegerProp { get; set; } - - /// - /// Gets or Sets RequiredNullableStringProp - /// - [JsonPropertyName("required_nullable_string_prop")] - public string? RequiredNullableStringProp { get; set; } - - /// - /// Gets or Sets RequiredNullableUuid - /// - /// 72f98069-206d-4f12-9f12-3d1e525a8e84 - [JsonPropertyName("required_nullable_uuid")] - public Guid? RequiredNullableUuid { get; set; } - /// /// Used to track the state of NotRequiredNotnullableDateProp /// @@ -1631,6 +1588,49 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_uuid")] public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new(value); } } + /// + /// Gets or Sets RequiredNullableArrayOfString + /// + [JsonPropertyName("required_nullable_array_of_string")] + public List? RequiredNullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNullableBooleanProp + /// + [JsonPropertyName("required_nullable_boolean_prop")] + public bool? RequiredNullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDateProp + /// + [JsonPropertyName("required_nullable_date_prop")] + public DateOnly? RequiredNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDatetimeProp + /// + [JsonPropertyName("required_nullable_datetime_prop")] + public DateTime? RequiredNullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNullableIntegerProp + /// + [JsonPropertyName("required_nullable_integer_prop")] + public int? RequiredNullableIntegerProp { get; set; } + + /// + /// Gets or Sets RequiredNullableStringProp + /// + [JsonPropertyName("required_nullable_string_prop")] + public string? RequiredNullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_nullable_uuid")] + public Guid? RequiredNullableUuid { get; set; } + /// /// Gets or Sets additional properties /// @@ -1656,17 +1656,6 @@ namespace Org.OpenAPITools.Model sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); - sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); - sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); - sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); - sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); - sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); - sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); - sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); - sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); - sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); - sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); - sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); @@ -1689,6 +1678,17 @@ namespace Org.OpenAPITools.Model sb.Append(" NotrequiredNullableOuterEnumDefaultValue: ").Append(NotrequiredNullableOuterEnumDefaultValue).Append("\n"); sb.Append(" NotrequiredNullableStringProp: ").Append(NotrequiredNullableStringProp).Append("\n"); sb.Append(" NotrequiredNullableUuid: ").Append(NotrequiredNullableUuid).Append("\n"); + sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); + sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); + sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); + sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); + sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); + sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); + sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); + sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -1720,16 +1720,6 @@ namespace Org.OpenAPITools.Model /// public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// - /// The format to use to serialize RequiredNullableDateProp - /// - public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize RequiredNullableDatetimeProp - /// - public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// /// The format to use to serialize NotRequiredNotnullableDateProp /// @@ -1750,6 +1740,16 @@ namespace Org.OpenAPITools.Model /// public static string NotrequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// + /// The format to use to serialize RequiredNullableDateProp + /// + public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNullableDatetimeProp + /// + public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// /// Deserializes json to /// @@ -1778,17 +1778,6 @@ namespace Org.OpenAPITools.Model Option requiredNotnullableStringProp = default; Option requiredNotnullableUuid = default; Option requiredNotnullableintegerProp = default; - Option?> requiredNullableArrayOfString = default; - Option requiredNullableBooleanProp = default; - Option requiredNullableDateProp = default; - Option requiredNullableDatetimeProp = default; - Option requiredNullableEnumInteger = default; - Option requiredNullableEnumIntegerOnly = default; - Option requiredNullableEnumString = default; - Option requiredNullableIntegerProp = default; - Option requiredNullableOuterEnumDefaultValue = default; - Option requiredNullableStringProp = default; - Option requiredNullableUuid = default; Option notRequiredNotnullableDateProp = default; Option notRequiredNotnullableintegerProp = default; Option notRequiredNullableDateProp = default; @@ -1811,6 +1800,17 @@ namespace Org.OpenAPITools.Model Option notrequiredNullableOuterEnumDefaultValue = default; Option notrequiredNullableStringProp = default; Option notrequiredNullableUuid = default; + Option?> requiredNullableArrayOfString = default; + Option requiredNullableBooleanProp = default; + Option requiredNullableDateProp = default; + Option requiredNullableDatetimeProp = default; + Option requiredNullableEnumInteger = default; + Option requiredNullableEnumIntegerOnly = default; + Option requiredNullableEnumString = default; + Option requiredNullableIntegerProp = default; + Option requiredNullableOuterEnumDefaultValue = default; + Option requiredNullableStringProp = default; + Option requiredNullableUuid = default; while (utf8JsonReader.Read()) { @@ -1872,51 +1872,6 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); break; - case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); - break; - case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_string": - string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumStringRawValue != null) - requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); - break; - case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); - break; - case "required_nullable_outerEnumDefaultValue": - string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); - break; - case "required_nullable_string_prop": - requiredNullableStringProp = new Option(utf8JsonReader.GetString()); - break; - case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); - break; case "not_required_notnullable_date_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -2007,6 +1962,51 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); break; + case "required_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_string": + string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumStringRawValue != null) + requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); + break; + case "required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "required_nullable_outerEnumDefaultValue": + string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); + break; + case "required_nullable_string_prop": + requiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_nullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + break; default: break; } @@ -2145,7 +2145,7 @@ namespace Org.OpenAPITools.Model if (notrequiredNotnullableUuid.IsSet && notrequiredNotnullableUuid.Value == null) throw new ArgumentNullException(nameof(notrequiredNotnullableUuid), "Property is not nullable for class RequiredClass."); - return new RequiredClass(requiredNotNullableDateProp.Value!.Value!, requiredNotnullableArrayOfString.Value!, requiredNotnullableBooleanProp.Value!.Value!, requiredNotnullableDatetimeProp.Value!.Value!, requiredNotnullableEnumInteger.Value!.Value!, requiredNotnullableEnumIntegerOnly.Value!.Value!, requiredNotnullableEnumString.Value!.Value!, requiredNotnullableOuterEnumDefaultValue.Value!.Value!, requiredNotnullableStringProp.Value!, requiredNotnullableUuid.Value!.Value!, requiredNotnullableintegerProp.Value!.Value!, requiredNullableArrayOfString.Value!, requiredNullableBooleanProp.Value!, requiredNullableDateProp.Value!, requiredNullableDatetimeProp.Value!, requiredNullableEnumInteger.Value!, requiredNullableEnumIntegerOnly.Value!, requiredNullableEnumString.Value!, requiredNullableIntegerProp.Value!, requiredNullableOuterEnumDefaultValue.Value!, requiredNullableStringProp.Value!, requiredNullableUuid.Value!, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid); + return new RequiredClass(requiredNotNullableDateProp.Value!.Value!, requiredNotnullableArrayOfString.Value!, requiredNotnullableBooleanProp.Value!.Value!, requiredNotnullableDatetimeProp.Value!.Value!, requiredNotnullableEnumInteger.Value!.Value!, requiredNotnullableEnumIntegerOnly.Value!.Value!, requiredNotnullableEnumString.Value!.Value!, requiredNotnullableOuterEnumDefaultValue.Value!.Value!, requiredNotnullableStringProp.Value!, requiredNotnullableUuid.Value!.Value!, requiredNotnullableintegerProp.Value!.Value!, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid, requiredNullableArrayOfString.Value!, requiredNullableBooleanProp.Value!, requiredNullableDateProp.Value!, requiredNullableDatetimeProp.Value!, requiredNullableEnumInteger.Value!, requiredNullableEnumIntegerOnly.Value!, requiredNullableEnumString.Value!, requiredNullableIntegerProp.Value!, requiredNullableOuterEnumDefaultValue.Value!, requiredNullableStringProp.Value!, requiredNullableUuid.Value!); } /// @@ -2159,7 +2159,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, requiredClass, jsonSerializerOptions); + WriteProperties(writer, requiredClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -2170,7 +2170,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) { if (requiredClass.RequiredNotnullableArrayOfString == null) throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); @@ -2207,70 +2207,6 @@ namespace Org.OpenAPITools.Model writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); - if (requiredClass.RequiredNullableArrayOfString != null) - { - writer.WritePropertyName("required_nullable_array_of_string"); - JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); - } - else - writer.WriteNull("required_nullable_array_of_string"); - if (requiredClass.RequiredNullableBooleanProp != null) - writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); - else - writer.WriteNull("required_nullable_boolean_prop"); - - if (requiredClass.RequiredNullableDateProp != null) - writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); - else - writer.WriteNull("required_nullable_date_prop"); - - if (requiredClass.RequiredNullableDatetimeProp != null) - writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); - else - writer.WriteNull("required_nullable_datetime_prop"); - - if (requiredClass.RequiredNullableEnumInteger != null) - writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); - else - writer.WriteNull("required_nullable_enum_integer"); - - if (requiredClass.RequiredNullableEnumIntegerOnly != null) - writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); - else - writer.WriteNull("required_nullable_enum_integer_only"); - - var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString!.Value); - if (requiredNullableEnumStringRawValue != null) - writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); - else - writer.WriteNull("required_nullable_enum_string"); - - if (requiredClass.RequiredNullableIntegerProp != null) - writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); - else - writer.WriteNull("required_nullable_integer_prop"); - - if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - else - { - var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); - else - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - } - - if (requiredClass.RequiredNullableStringProp != null) - writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); - else - writer.WriteNull("required_nullable_string_prop"); - - if (requiredClass.RequiredNullableUuid != null) - writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); - else - writer.WriteNull("required_nullable_uuid"); - if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value!.Value.ToString(NotRequiredNotnullableDatePropFormat)); @@ -2376,6 +2312,70 @@ namespace Org.OpenAPITools.Model writer.WriteString("notrequired_nullable_uuid", requiredClass.NotrequiredNullableUuidOption.Value!.Value); else writer.WriteNull("notrequired_nullable_uuid"); + + if (requiredClass.RequiredNullableArrayOfString != null) + { + writer.WritePropertyName("required_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("required_nullable_array_of_string"); + if (requiredClass.RequiredNullableBooleanProp != null) + writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); + else + writer.WriteNull("required_nullable_boolean_prop"); + + if (requiredClass.RequiredNullableDateProp != null) + writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); + else + writer.WriteNull("required_nullable_date_prop"); + + if (requiredClass.RequiredNullableDatetimeProp != null) + writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); + else + writer.WriteNull("required_nullable_datetime_prop"); + + if (requiredClass.RequiredNullableEnumInteger != null) + writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); + else + writer.WriteNull("required_nullable_enum_integer"); + + if (requiredClass.RequiredNullableEnumIntegerOnly != null) + writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); + else + writer.WriteNull("required_nullable_enum_integer_only"); + + var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString!.Value); + if (requiredNullableEnumStringRawValue != null) + writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); + else + writer.WriteNull("required_nullable_enum_string"); + + if (requiredClass.RequiredNullableIntegerProp != null) + writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); + else + writer.WriteNull("required_nullable_integer_prop"); + + if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + else + { + var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); + else + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + } + + if (requiredClass.RequiredNullableStringProp != null) + writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); + else + writer.WriteNull("required_nullable_string_prop"); + + if (requiredClass.RequiredNullableUuid != null) + writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); + else + writer.WriteNull("required_nullable_uuid"); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs index 7ae87310085..9a55385c9e0 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, varReturn, jsonSerializerOptions); + WriteProperties(writer, varReturn, jsonSerializerOptions); writer.WriteEndObject(); } @@ -224,7 +224,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) { if (varReturn.Lock == null) throw new ArgumentNullException(nameof(varReturn.Lock), "Property is required for class Return."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 19d3d828704..ea51c691836 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); writer.WriteEndObject(); } @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHash.RoleOption.IsSet && rolesReportsHash.Role == null) throw new ArgumentNullException(nameof(rolesReportsHash.Role), "Property is required for class RolesReportsHash."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index 82143e553f4..77edc76a3bd 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHashRole.NameOption.IsSet && rolesReportsHashRole.Name == null) throw new ArgumentNullException(nameof(rolesReportsHashRole.Name), "Property is required for class RolesReportsHashRole."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 4a3599d1329..907253b6f63 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, scaleneTriangle, jsonSerializerOptions); + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) { if (scaleneTriangle.ShapeType == null) throw new ArgumentNullException(nameof(scaleneTriangle.ShapeType), "Property is required for class ScaleneTriangle."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Shape.cs index cd2940a87fe..329de390e64 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Shape.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Triangle triangle, string shapeType) + public Shape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Quadrilateral quadrilateral, string shapeType) + public Shape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -68,12 +64,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -88,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Shape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -203,10 +192,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); if (quadrilateral != null) - return new Shape(quadrilateral, shapeType.Value!); + return new Shape(quadrilateral); if (triangle != null) - return new Shape(triangle, shapeType.Value!); + return new Shape(triangle); throw new JsonException(); } @@ -224,15 +213,15 @@ namespace Org.OpenAPITools.Model if (shape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } if (shape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shape, jsonSerializerOptions); + WriteProperties(writer, shape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -243,12 +232,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) { - if (shape.ShapeType == null) - throw new ArgumentNullException(nameof(shape.ShapeType), "Property is required for class Shape."); - writer.WriteString("shapeType", shape.ShapeType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeInterface.cs index d540276b604..d7f2f03ff8f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, shapeInterface, jsonSerializerOptions); + WriteProperties(writer, shapeInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) { if (shapeInterface.ShapeType == null) throw new ArgumentNullException(nameof(shapeInterface.ShapeType), "Property is required for class ShapeInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d0d068c8098..01c4ee1e1ee 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Triangle triangle, string shapeType) + public ShapeOrNull(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Quadrilateral quadrilateral, string shapeType) + public ShapeOrNull(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -68,12 +64,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral? Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -88,7 +78,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class ShapeOrNull {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -203,10 +192,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); if (quadrilateral != null) - return new ShapeOrNull(quadrilateral, shapeType.Value!); + return new ShapeOrNull(quadrilateral); if (triangle != null) - return new ShapeOrNull(triangle, shapeType.Value!); + return new ShapeOrNull(triangle); throw new JsonException(); } @@ -224,15 +213,15 @@ namespace Org.OpenAPITools.Model if (shapeOrNull.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shapeOrNull.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } if (shapeOrNull.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shapeOrNull, jsonSerializerOptions); + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); writer.WriteEndObject(); } @@ -243,12 +232,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) { - if (shapeOrNull.ShapeType == null) - throw new ArgumentNullException(nameof(shapeOrNull.ShapeType), "Property is required for class ShapeOrNull."); - writer.WriteString("shapeType", shapeOrNull.ShapeType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index a9292a0bd66..e90f8b8b619 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, simpleQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (simpleQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(simpleQuadrilateral.QuadrilateralType), "Property is required for class SimpleQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs index 76a8b8e6dc5..4d1c3620090 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, specialModelName, jsonSerializerOptions); + WriteProperties(writer, specialModelName, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) { if (specialModelName.VarSpecialModelNameOption.IsSet && specialModelName.VarSpecialModelName == null) throw new ArgumentNullException(nameof(specialModelName.VarSpecialModelName), "Property is required for class SpecialModelName."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs index 55102aa3e89..43fe662b51c 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs @@ -178,7 +178,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, tag, jsonSerializerOptions); + WriteProperties(writer, tag, jsonSerializerOptions); writer.WriteEndObject(); } @@ -189,7 +189,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) { if (tag.NameOption.IsSet && tag.Name == null) throw new ArgumentNullException(nameof(tag.Name), "Property is required for class Tag."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 3ddea72fbbb..323771bb32f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordList, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordList.ValueOption.IsSet && testCollectionEndingWithWordList.Value == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList.Value), "Property is required for class TestCollectionEndingWithWordList."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 75432585a5f..a854b4855ce 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -155,7 +155,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet && testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index 998c873580e..b95a9882657 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -154,7 +154,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) { if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet && testInlineFreeformAdditionalPropertiesRequest.SomeProperty == null) throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest.SomeProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Triangle.cs index 01d0b9cc379..b450383d335 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Triangle.cs @@ -36,11 +36,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(EquilateralTriangle equilateralTriangle, string triangleType) + public Triangle(EquilateralTriangle equilateralTriangle) { EquilateralTriangle = equilateralTriangle; - TriangleType = triangleType; OnCreated(); } @@ -48,11 +46,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(IsoscelesTriangle isoscelesTriangle, string triangleType) + public Triangle(IsoscelesTriangle isoscelesTriangle) { IsoscelesTriangle = isoscelesTriangle; - TriangleType = triangleType; OnCreated(); } @@ -60,11 +56,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(ScaleneTriangle scaleneTriangle, string triangleType) + public Triangle(ScaleneTriangle scaleneTriangle) { ScaleneTriangle = scaleneTriangle; - TriangleType = triangleType; OnCreated(); } @@ -85,12 +79,6 @@ namespace Org.OpenAPITools.Model /// public ScaleneTriangle? ScaleneTriangle { get; set; } - /// - /// Gets or Sets TriangleType - /// - [JsonPropertyName("triangleType")] - public string TriangleType { get; set; } - /// /// Gets or Sets additional properties /// @@ -105,7 +93,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Triangle {\n"); - sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -226,13 +213,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); if (equilateralTriangle != null) - return new Triangle(equilateralTriangle, triangleType.Value!); + return new Triangle(equilateralTriangle); if (isoscelesTriangle != null) - return new Triangle(isoscelesTriangle, triangleType.Value!); + return new Triangle(isoscelesTriangle); if (scaleneTriangle != null) - return new Triangle(scaleneTriangle, triangleType.Value!); + return new Triangle(scaleneTriangle); throw new JsonException(); } @@ -250,20 +237,20 @@ namespace Org.OpenAPITools.Model if (triangle.EquilateralTriangle != null) { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); - equilateralTriangleJsonConverter.WriteProperties(ref writer, triangle.EquilateralTriangle, jsonSerializerOptions); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } if (triangle.IsoscelesTriangle != null) { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); - isoscelesTriangleJsonConverter.WriteProperties(ref writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } if (triangle.ScaleneTriangle != null) { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); - scaleneTriangleJsonConverter.WriteProperties(ref writer, triangle.ScaleneTriangle, jsonSerializerOptions); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } - WriteProperties(ref writer, triangle, jsonSerializerOptions); + WriteProperties(writer, triangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -274,12 +261,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) { - if (triangle.TriangleType == null) - throw new ArgumentNullException(nameof(triangle.TriangleType), "Property is required for class Triangle."); - writer.WriteString("triangleType", triangle.TriangleType); } } diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TriangleInterface.cs index 788fe0022f5..d88f6c5af41 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, triangleInterface, jsonSerializerOptions); + WriteProperties(writer, triangleInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) { if (triangleInterface.TriangleType == null) throw new ArgumentNullException(nameof(triangleInterface.TriangleType), "Property is required for class TriangleInterface."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs index 8268921fab5..018dfd66521 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs @@ -409,7 +409,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, user, jsonSerializerOptions); + WriteProperties(writer, user, jsonSerializerOptions); writer.WriteEndObject(); } @@ -420,7 +420,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) { if (user.EmailOption.IsSet && user.Email == null) throw new ArgumentNullException(nameof(user.Email), "Property is required for class User."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs index a857b414875..0e794d7a1a6 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, whale, jsonSerializerOptions); + WriteProperties(writer, whale, jsonSerializerOptions); writer.WriteEndObject(); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) { if (whale.ClassName == null) throw new ArgumentNullException(nameof(whale.ClassName), "Property is required for class Whale."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Zebra.cs index f7bfa4def63..d481b0386d8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Zebra.cs @@ -255,7 +255,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zebra, jsonSerializerOptions); + WriteProperties(writer, zebra, jsonSerializerOptions); writer.WriteEndObject(); } @@ -266,7 +266,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) { if (zebra.ClassName == null) throw new ArgumentNullException(nameof(zebra.ClassName), "Property is required for class Zebra."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 1e5374cfd8a..f108e118e0f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -222,7 +222,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zeroBasedEnumClass, jsonSerializerOptions); + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -233,7 +233,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) { var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value!.Value); writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 82d2a297384..2fa1be128cc 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/README.md index e1181306145..e9440f04b95 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/README.md @@ -179,7 +179,6 @@ Authentication schemes defined for the API: - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs index 713da49169c..cddef3bb932 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -251,6 +251,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string? GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index 0492da71e17..00986383cd2 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nowGet200Response, jsonSerializerOptions); + WriteProperties(writer, nowGet200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -191,7 +191,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NowGet200Response nowGet200Response, JsonSerializerOptions jsonSerializerOptions) { if (nowGet200Response.NowOption.IsSet) writer.WriteString("now", nowGet200Response.NowOption.Value!.Value.ToString(NowFormat)); diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c8c0e561c37..0c948f147ff 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update enable + false diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/README.md index 2327080f98f..56e19aab863 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/README.md @@ -132,7 +132,6 @@ Endpoints do not require authorization. - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/.openapi-generator/FILES index 05049077c2a..be38ed26d98 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/.openapi-generator/FILES @@ -54,6 +54,7 @@ docs/models/List.md docs/models/LiteralStringClass.md docs/models/Mammal.md docs/models/MapTest.md +docs/models/MixLog.md docs/models/MixedPropertiesAndAdditionalPropertiesClass.md docs/models/Model200Response.md docs/models/ModelClient.md @@ -182,6 +183,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixLog.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixLog.md new file mode 100644 index 00000000000..5184c03bea9 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | +**FormulaVersionDate** | **DateTime** | | +**Id** | **Guid** | | +**MixDate** | **DateTime** | | +**TotalOverPoors** | **int** | | +**TotalRecalculations** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] +**ShopId** | **Guid** | | [optional] +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**TotalPrice** | **float** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/RequiredClass.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/RequiredClass.md index 8f148be840b..7460783c91d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/RequiredClass.md +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/RequiredClass.md @@ -15,17 +15,6 @@ Name | Type | Description | Notes **RequiredNotnullableStringProp** | **string** | | **RequiredNotnullableUuid** | **Guid** | | **RequiredNotnullableintegerProp** | **int** | | -**RequiredNullableArrayOfString** | **List<string>** | | -**RequiredNullableBooleanProp** | **bool** | | -**RequiredNullableDateProp** | **DateTime** | | -**RequiredNullableDatetimeProp** | **DateTime** | | -**RequiredNullableEnumInteger** | **int** | | -**RequiredNullableEnumIntegerOnly** | **int** | | -**RequiredNullableEnumString** | **string** | | -**RequiredNullableIntegerProp** | **int** | | -**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | -**RequiredNullableStringProp** | **string** | | -**RequiredNullableUuid** | **Guid** | | **NotRequiredNotnullableDateProp** | **DateTime** | | [optional] **NotRequiredNotnullableintegerProp** | **int** | | [optional] **NotRequiredNullableDateProp** | **DateTime** | | [optional] @@ -48,6 +37,17 @@ Name | Type | Description | Notes **NotrequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] **NotrequiredNullableStringProp** | **string** | | [optional] **NotrequiredNullableUuid** | **Guid** | | [optional] +**RequiredNullableArrayOfString** | **List<string>** | | +**RequiredNullableBooleanProp** | **bool** | | +**RequiredNullableDateProp** | **DateTime** | | +**RequiredNullableDatetimeProp** | **DateTime** | | +**RequiredNullableEnumInteger** | **int** | | +**RequiredNullableEnumIntegerOnly** | **int** | | +**RequiredNullableEnumString** | **string** | | +**RequiredNullableIntegerProp** | **int** | | +**RequiredNullableOuterEnumDefaultValue** | **OuterEnumDefaultValue** | | +**RequiredNullableStringProp** | **string** | | +**RequiredNullableUuid** | **Guid** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 62a5cdba43b..ee61aa92963 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -121,6 +121,16 @@ namespace Org.OpenAPITools.Test.Api Assert.IsType>(model); } + /// + /// Test TestAdditionalPropertiesReference + /// + [Fact (Skip = "not implemented")] + public async Task TestAdditionalPropertiesReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestAdditionalPropertiesReferenceAsync(requestBody); + } + /// /// Test TestBodyWithFileSchema /// @@ -257,5 +267,15 @@ namespace Org.OpenAPITools.Test.Api Client.Option notRequiredNullable = default; await _instance.TestQueryParameterCollectionFormatAsync(pipe, ioutil, http, url, context, requiredNotNullable, requiredNullable, notRequiredNotNullable, notRequiredNullable); } + + /// + /// Test TestStringMapReference + /// + [Fact (Skip = "not implemented")] + public async Task TestStringMapReferenceAsyncTest() + { + Dictionary requestBody = default; + await _instance.TestStringMapReferenceAsync(requestBody); + } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs index d29d1dfd846..a866bfbe242 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ClassModelTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs index 210069f6ad3..55086a7cf24 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FooGetDefaultResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 164baa8862b..b658f317f1c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarByte' + /// Test the property 'Byte' /// [Fact] - public void VarByteTest() + public void ByteTest() { - // TODO unit test for the property 'VarByte' + // TODO unit test for the property 'Byte' } /// @@ -108,30 +108,30 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarDecimal' + /// Test the property 'Decimal' /// [Fact] - public void VarDecimalTest() + public void DecimalTest() { - // TODO unit test for the property 'VarDecimal' + // TODO unit test for the property 'Decimal' } /// - /// Test the property 'VarDouble' + /// Test the property 'Double' /// [Fact] - public void VarDoubleTest() + public void DoubleTest() { - // TODO unit test for the property 'VarDouble' + // TODO unit test for the property 'Double' } /// - /// Test the property 'VarFloat' + /// Test the property 'Float' /// [Fact] - public void VarFloatTest() + public void FloatTest() { - // TODO unit test for the property 'VarFloat' + // TODO unit test for the property 'Float' } /// @@ -189,12 +189,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarString' + /// Test the property 'String' /// [Fact] - public void VarStringTest() + public void StringTest() { - // TODO unit test for the property 'VarString' + // TODO unit test for the property 'String' } /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..3f108758fd2 --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs deleted file mode 100644 index e27750c9c1f..00000000000 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedEnumType - //private MixedEnumType instance; - - public MixedEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedEnumType - //instance = new MixedEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedEnumType - /// - [Fact] - public void MixedEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs deleted file mode 100644 index 1513de7a320..00000000000 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedNullableEnumTypeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedNullableEnumType - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedNullableEnumTypeTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedNullableEnumType - //private MixedNullableEnumType instance; - - public MixedNullableEnumTypeTests() - { - // TODO uncomment below to create an instance of MixedNullableEnumType - //instance = new MixedNullableEnumType(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedNullableEnumType - /// - [Fact] - public void MixedNullableEnumTypeInstanceTest() - { - // TODO uncomment below to test "IsType" MixedNullableEnumType - //Assert.IsType(instance); - } - } -} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs deleted file mode 100644 index 2ed728a41b8..00000000000 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixedSubIdTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * Generated by: https://github.com/openapitools/openapi-generator.git - */ - - -using Xunit; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Client; -using System.Reflection; - -namespace Org.OpenAPITools.Test.Model -{ - /// - /// Class for testing MixedSubId - /// - /// - /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). - /// Please update the test case below to test the model. - /// - public class MixedSubIdTests : IDisposable - { - // TODO uncomment below to declare an instance variable for MixedSubId - //private MixedSubId instance; - - public MixedSubIdTests() - { - // TODO uncomment below to create an instance of MixedSubId - //instance = new MixedSubId(); - } - - public void Dispose() - { - // Cleanup when everything is done. - } - - /// - /// Test an instance of MixedSubId - /// - [Fact] - public void MixedSubIdInstanceTest() - { - // TODO uncomment below to test "IsType" MixedSubId - //Assert.IsType(instance); - } - - /// - /// Test the property 'Id' - /// - [Fact] - public void IdTest() - { - // TODO unit test for the property 'Id' - } - } -} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs index fda0e5b588c..3b5e94c5f8f 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/Model200ResponseTests.cs @@ -54,12 +54,12 @@ namespace Org.OpenAPITools.Test.Model } /// - /// Test the property 'VarClass' + /// Test the property 'Class' /// [Fact] - public void VarClassTest() + public void ClassTest() { - // TODO unit test for the property 'VarClass' + // TODO unit test for the property 'Class' } /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs index e5186391592..d1da68281ff 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/RequiredClassTests.cs @@ -152,105 +152,6 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'RequiredNotnullableintegerProp' } - /// - /// Test the property 'RequiredNullableArrayOfString' - /// - [Fact] - public void RequiredNullableArrayOfStringTest() - { - // TODO unit test for the property 'RequiredNullableArrayOfString' - } - - /// - /// Test the property 'RequiredNullableBooleanProp' - /// - [Fact] - public void RequiredNullableBooleanPropTest() - { - // TODO unit test for the property 'RequiredNullableBooleanProp' - } - - /// - /// Test the property 'RequiredNullableDateProp' - /// - [Fact] - public void RequiredNullableDatePropTest() - { - // TODO unit test for the property 'RequiredNullableDateProp' - } - - /// - /// Test the property 'RequiredNullableDatetimeProp' - /// - [Fact] - public void RequiredNullableDatetimePropTest() - { - // TODO unit test for the property 'RequiredNullableDatetimeProp' - } - - /// - /// Test the property 'RequiredNullableEnumInteger' - /// - [Fact] - public void RequiredNullableEnumIntegerTest() - { - // TODO unit test for the property 'RequiredNullableEnumInteger' - } - - /// - /// Test the property 'RequiredNullableEnumIntegerOnly' - /// - [Fact] - public void RequiredNullableEnumIntegerOnlyTest() - { - // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' - } - - /// - /// Test the property 'RequiredNullableEnumString' - /// - [Fact] - public void RequiredNullableEnumStringTest() - { - // TODO unit test for the property 'RequiredNullableEnumString' - } - - /// - /// Test the property 'RequiredNullableIntegerProp' - /// - [Fact] - public void RequiredNullableIntegerPropTest() - { - // TODO unit test for the property 'RequiredNullableIntegerProp' - } - - /// - /// Test the property 'RequiredNullableOuterEnumDefaultValue' - /// - [Fact] - public void RequiredNullableOuterEnumDefaultValueTest() - { - // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' - } - - /// - /// Test the property 'RequiredNullableStringProp' - /// - [Fact] - public void RequiredNullableStringPropTest() - { - // TODO unit test for the property 'RequiredNullableStringProp' - } - - /// - /// Test the property 'RequiredNullableUuid' - /// - [Fact] - public void RequiredNullableUuidTest() - { - // TODO unit test for the property 'RequiredNullableUuid' - } - /// /// Test the property 'NotRequiredNotnullableDateProp' /// @@ -448,5 +349,104 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'NotrequiredNullableUuid' } + + /// + /// Test the property 'RequiredNullableArrayOfString' + /// + [Fact] + public void RequiredNullableArrayOfStringTest() + { + // TODO unit test for the property 'RequiredNullableArrayOfString' + } + + /// + /// Test the property 'RequiredNullableBooleanProp' + /// + [Fact] + public void RequiredNullableBooleanPropTest() + { + // TODO unit test for the property 'RequiredNullableBooleanProp' + } + + /// + /// Test the property 'RequiredNullableDateProp' + /// + [Fact] + public void RequiredNullableDatePropTest() + { + // TODO unit test for the property 'RequiredNullableDateProp' + } + + /// + /// Test the property 'RequiredNullableDatetimeProp' + /// + [Fact] + public void RequiredNullableDatetimePropTest() + { + // TODO unit test for the property 'RequiredNullableDatetimeProp' + } + + /// + /// Test the property 'RequiredNullableEnumInteger' + /// + [Fact] + public void RequiredNullableEnumIntegerTest() + { + // TODO unit test for the property 'RequiredNullableEnumInteger' + } + + /// + /// Test the property 'RequiredNullableEnumIntegerOnly' + /// + [Fact] + public void RequiredNullableEnumIntegerOnlyTest() + { + // TODO unit test for the property 'RequiredNullableEnumIntegerOnly' + } + + /// + /// Test the property 'RequiredNullableEnumString' + /// + [Fact] + public void RequiredNullableEnumStringTest() + { + // TODO unit test for the property 'RequiredNullableEnumString' + } + + /// + /// Test the property 'RequiredNullableIntegerProp' + /// + [Fact] + public void RequiredNullableIntegerPropTest() + { + // TODO unit test for the property 'RequiredNullableIntegerProp' + } + + /// + /// Test the property 'RequiredNullableOuterEnumDefaultValue' + /// + [Fact] + public void RequiredNullableOuterEnumDefaultValueTest() + { + // TODO unit test for the property 'RequiredNullableOuterEnumDefaultValue' + } + + /// + /// Test the property 'RequiredNullableStringProp' + /// + [Fact] + public void RequiredNullableStringPropTest() + { + // TODO unit test for the property 'RequiredNullableStringProp' + } + + /// + /// Test the property 'RequiredNullableUuid' + /// + [Fact] + public void RequiredNullableUuidTest() + { + // TODO unit test for the property 'RequiredNullableUuid' + } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs index 18474c10e19..bbea79ed951 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/ReturnTests.cs @@ -53,6 +53,24 @@ namespace Org.OpenAPITools.Test.Model //Assert.IsType(instance); } + /// + /// Test the property 'Lock' + /// + [Fact] + public void LockTest() + { + // TODO unit test for the property 'Lock' + } + + /// + /// Test the property 'Abstract' + /// + [Fact] + public void AbstractTest() + { + // TODO unit test for the property 'Abstract' + } + /// /// Test the property 'VarReturn' /// @@ -61,5 +79,14 @@ namespace Org.OpenAPITools.Test.Model { // TODO unit test for the property 'VarReturn' } + + /// + /// Test the property 'Unsafe' + /// + [Fact] + public void UnsafeTest() + { + // TODO unit test for the property 'Unsafe' + } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs index 32d8880e04e..9cb9620cc92 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -207,12 +207,6 @@ namespace Org.OpenAPITools.Client return RequiredClass.RequiredNotnullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNotnullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.RequiredNotnullableEnumStringEnum requiredClassRequiredNotnullableEnumStringEnum) return RequiredClass.RequiredNotnullableEnumStringEnumToJsonValue(requiredClassRequiredNotnullableEnumStringEnum); - if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) - return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) - return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); - if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) - return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerEnum requiredClassNotrequiredNotnullableEnumIntegerEnum) return RequiredClass.NotrequiredNotnullableEnumIntegerEnumToJsonValue(requiredClassNotrequiredNotnullableEnumIntegerEnum).ToString(); if (obj is RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum requiredClassNotrequiredNotnullableEnumIntegerOnlyEnum) @@ -225,6 +219,12 @@ namespace Org.OpenAPITools.Client return RequiredClass.NotrequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassNotrequiredNullableEnumIntegerOnlyEnum).ToString(); if (obj is RequiredClass.NotrequiredNullableEnumStringEnum requiredClassNotrequiredNullableEnumStringEnum) return RequiredClass.NotrequiredNullableEnumStringEnumToJsonValue(requiredClassNotrequiredNullableEnumStringEnum); + if (obj is RequiredClass.RequiredNullableEnumIntegerEnum requiredClassRequiredNullableEnumIntegerEnum) + return RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClassRequiredNullableEnumIntegerEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumIntegerOnlyEnum requiredClassRequiredNullableEnumIntegerOnlyEnum) + return RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClassRequiredNullableEnumIntegerOnlyEnum).ToString(); + if (obj is RequiredClass.RequiredNullableEnumStringEnum requiredClassRequiredNullableEnumStringEnum) + return RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClassRequiredNullableEnumStringEnum); if (obj is Zebra.TypeEnum zebraTypeEnum) return Zebra.TypeEnumToJsonValue(zebraTypeEnum); if (obj is ZeroBasedEnum zeroBasedEnum) @@ -362,6 +362,43 @@ namespace Org.OpenAPITools.Client return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json"); } + /// + /// Get the discriminator + /// + /// + /// + /// + /// + public static string GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } + + throw new JsonException("The specified discriminator was not found."); + } + /// /// The base path of the API /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs index 903a95cb48a..8ea6690254f 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -84,6 +84,7 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new LiteralStringClassJsonConverter()); _jsonOptions.Converters.Add(new MammalJsonConverter()); _jsonOptions.Converters.Add(new MapTestJsonConverter()); + _jsonOptions.Converters.Add(new MixLogJsonConverter()); _jsonOptions.Converters.Add(new MixedPropertiesAndAdditionalPropertiesClassJsonConverter()); _jsonOptions.Converters.Add(new Model200ResponseJsonConverter()); _jsonOptions.Converters.Add(new ModelClientJsonConverter()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs index c7ae164f09b..2e4d5cb3bb8 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activity, jsonSerializerOptions); + WriteProperties(writer, activity, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Activity activity, JsonSerializerOptions jsonSerializerOptions) { if (activity.ActivityOutputsOption.IsSet && activity.ActivityOutputs == null) throw new ArgumentNullException(nameof(activity.ActivityOutputs), "Property is required for class Activity."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index ae0dd075bf6..b24ba867898 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, activityOutputElementRepresentation, jsonSerializerOptions); + WriteProperties(writer, activityOutputElementRepresentation, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ActivityOutputElementRepresentation activityOutputElementRepresentation, JsonSerializerOptions jsonSerializerOptions) { if (activityOutputElementRepresentation.Prop1Option.IsSet && activityOutputElementRepresentation.Prop1 == null) throw new ArgumentNullException(nameof(activityOutputElementRepresentation.Prop1), "Property is required for class ActivityOutputElementRepresentation."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 322f3e96642..dcc268fc3a8 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -318,7 +318,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, additionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, additionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -329,7 +329,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AdditionalPropertiesClass additionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (additionalPropertiesClass.EmptyMapOption.IsSet && additionalPropertiesClass.EmptyMap == null) throw new ArgumentNullException(nameof(additionalPropertiesClass.EmptyMap), "Property is required for class AdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs index 8684723f452..29362b0ca36 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Animal.cs @@ -32,12 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") [JsonConstructor] - public Animal(string className, Option color = default) + public Animal(Option color = default) { - ClassName = className; ColorOption = color; OnCreated(); } @@ -45,10 +43,11 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets ClassName + /// The discriminator /// - [JsonPropertyName("className")] - public string ClassName { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string ClassName { get; } = "Animal"; /// /// Used to track the state of Color @@ -77,7 +76,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" Color: ").Append(Color).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); @@ -130,6 +128,14 @@ namespace Org.OpenAPITools.Model Option className = default; Option color = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "className"); + + if (discriminator != null && discriminator.Equals("Cat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("Dog")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -166,7 +172,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Animal."); - return new Animal(className.Value, color); + return new Animal(color); } /// @@ -178,9 +184,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { + if (animal is Cat cat){ + JsonSerializer.Serialize(writer, cat, jsonSerializerOptions); + return; + } + + if (animal is Dog dog){ + JsonSerializer.Serialize(writer, dog, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, animal, jsonSerializerOptions); + WriteProperties(writer, animal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -191,11 +207,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Animal animal, JsonSerializerOptions jsonSerializerOptions) { - if (animal.ClassName == null) - throw new ArgumentNullException(nameof(animal.ClassName), "Property is required for class Animal."); - if (animal.ColorOption.IsSet && animal.Color == null) throw new ArgumentNullException(nameof(animal.Color), "Property is required for class Animal."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 682dd4051a7..f63a202f397 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -198,7 +198,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apiResponse, jsonSerializerOptions); + WriteProperties(writer, apiResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -209,7 +209,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ApiResponse apiResponse, JsonSerializerOptions jsonSerializerOptions) { if (apiResponse.MessageOption.IsSet && apiResponse.Message == null) throw new ArgumentNullException(nameof(apiResponse.Message), "Property is required for class ApiResponse."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs index 0dfab1dc96a..87e58a00021 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Apple.cs @@ -227,7 +227,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, apple, jsonSerializerOptions); + WriteProperties(writer, apple, jsonSerializerOptions); writer.WriteEndObject(); } @@ -238,7 +238,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Apple apple, JsonSerializerOptions jsonSerializerOptions) { if (apple.ColorCodeOption.IsSet && apple.ColorCode == null) throw new ArgumentNullException(nameof(apple.ColorCode), "Property is required for class Apple."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index eea4a2f9c04..6a2e8b75f6d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -164,7 +164,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, appleReq, jsonSerializerOptions); + WriteProperties(writer, appleReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, AppleReq appleReq, JsonSerializerOptions jsonSerializerOptions) { if (appleReq.Cultivar == null) throw new ArgumentNullException(nameof(appleReq.Cultivar), "Property is required for class AppleReq."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index ed7268fe4e5..d66d69222da 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfArrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfArrayOfNumberOnly.ArrayArrayNumberOption.IsSet && arrayOfArrayOfNumberOnly.ArrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfArrayOfNumberOnly.ArrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 815ec9d6464..7ec6a05f242 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayOfNumberOnly, jsonSerializerOptions); + WriteProperties(writer, arrayOfNumberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayOfNumberOnly arrayOfNumberOnly, JsonSerializerOptions jsonSerializerOptions) { if (arrayOfNumberOnly.ArrayNumberOption.IsSet && arrayOfNumberOnly.ArrayNumber == null) throw new ArgumentNullException(nameof(arrayOfNumberOnly.ArrayNumber), "Property is required for class ArrayOfNumberOnly."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index c2a33b41467..0ae28dc07d5 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -200,7 +200,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, arrayTest, jsonSerializerOptions); + WriteProperties(writer, arrayTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -211,7 +211,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ArrayTest arrayTest, JsonSerializerOptions jsonSerializerOptions) { if (arrayTest.ArrayArrayOfIntegerOption.IsSet && arrayTest.ArrayArrayOfInteger == null) throw new ArgumentNullException(nameof(arrayTest.ArrayArrayOfInteger), "Property is required for class ArrayTest."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 0129ad28b14..f8f25778428 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, banana, jsonSerializerOptions); + WriteProperties(writer, banana, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Banana banana, JsonSerializerOptions jsonSerializerOptions) { if (banana.LengthCmOption.IsSet) writer.WriteNumber("lengthCm", banana.LengthCmOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index 8b011a03348..848e8164b4a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, bananaReq, jsonSerializerOptions); + WriteProperties(writer, bananaReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BananaReq bananaReq, JsonSerializerOptions jsonSerializerOptions) { writer.WriteNumber("lengthCm", bananaReq.LengthCm); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs index 53c20a25cd1..863cc82bc78 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BasquePig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, basquePig, jsonSerializerOptions); + WriteProperties(writer, basquePig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, BasquePig basquePig, JsonSerializerOptions jsonSerializerOptions) { if (basquePig.ClassName == null) throw new ArgumentNullException(nameof(basquePig.ClassName), "Property is required for class BasquePig."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs index d2ef72a6aa5..f24497e3ad6 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Capitalization.cs @@ -267,7 +267,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, capitalization, jsonSerializerOptions); + WriteProperties(writer, capitalization, jsonSerializerOptions); writer.WriteEndObject(); } @@ -278,7 +278,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Capitalization capitalization, JsonSerializerOptions jsonSerializerOptions) { if (capitalization.ATT_NAMEOption.IsSet && capitalization.ATT_NAME == null) throw new ArgumentNullException(nameof(capitalization.ATT_NAME), "Property is required for class Capitalization."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 9314e321132..d11d16c855e 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// color (default to "red") /// declawed [JsonConstructor] - public Cat(string className, Option color = default, Option declawed = default) : base(className, color) + public Cat(Option color = default, Option declawed = default) : base(color) { DeclawedOption = declawed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Cat"; + /// /// Used to track the state of Declawed /// @@ -141,7 +147,7 @@ namespace Org.OpenAPITools.Model if (declawed.IsSet && declawed.Value == null) throw new ArgumentNullException(nameof(declawed), "Property is not nullable for class Cat."); - return new Cat(className.Value, color, declawed); + return new Cat(color, declawed); } /// @@ -155,7 +161,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, cat, jsonSerializerOptions); + WriteProperties(writer, cat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -166,11 +172,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions) { - if (cat.ClassName == null) - throw new ArgumentNullException(nameof(cat.ClassName), "Property is required for class Cat."); - if (cat.ColorOption.IsSet && cat.Color == null) throw new ArgumentNullException(nameof(cat.Color), "Property is required for class Cat."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs index 79755fde499..667e094c6ff 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -171,7 +171,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, category, jsonSerializerOptions); + WriteProperties(writer, category, jsonSerializerOptions); writer.WriteEndObject(); } @@ -182,7 +182,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Category category, JsonSerializerOptions jsonSerializerOptions) { if (category.Name == null) throw new ArgumentNullException(nameof(category.Name), "Property is required for class Category."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs index 8b96dc29f79..a2785447497 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ChildCat.cs @@ -33,12 +33,10 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// name - /// petType (default to PetTypeEnum.ChildCat) [JsonConstructor] - public ChildCat(Option name = default, PetTypeEnum petType = PetTypeEnum.ChildCat) : base(ChildCat.PetTypeEnumToJsonValue(petType)) + public ChildCat(Option name = default) : base() { NameOption = name; - PetType = petType; OnCreated(); } @@ -96,12 +94,6 @@ namespace Org.OpenAPITools.Model throw new NotImplementedException($"Value could not be handled: '{value}'"); } - /// - /// Gets or Sets PetType - /// - [JsonPropertyName("pet_type")] - public new PetTypeEnum PetType { get; set; } - /// /// Used to track the state of Name /// @@ -115,6 +107,13 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("name")] public string Name { get { return this.NameOption; } set { this.NameOption = new Option(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new PetTypeEnum PetType { get; } = (PetTypeEnum)Enum.Parse(typeof(PetTypeEnum), "ChildCat"); + /// /// Returns the string presentation of the object /// @@ -125,7 +124,6 @@ namespace Org.OpenAPITools.Model sb.Append("class ChildCat {\n"); sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -194,7 +192,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ChildCat."); - return new ChildCat(name, petType.Value.Value); + return new ChildCat(name); } /// @@ -208,7 +206,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, childCat, jsonSerializerOptions); + WriteProperties(writer, childCat, jsonSerializerOptions); writer.WriteEndObject(); } @@ -219,7 +217,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions) { if (childCat.NameOption.IsSet && childCat.Name == null) throw new ArgumentNullException(nameof(childCat.Name), "Property is required for class ChildCat."); @@ -227,8 +225,7 @@ namespace Org.OpenAPITools.Model if (childCat.NameOption.IsSet) writer.WriteString("name", childCat.Name); - var petTypeRawValue = ChildCat.PetTypeEnumToJsonValue(childCat.PetType); - writer.WriteString("pet_type", petTypeRawValue); + writer.WriteString("pet_type", ChildCat.PetTypeEnumToJsonValue(childCat.PetType)); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs index f7fb43c7d1f..9e254109cfc 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ClassModel.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, classModel, jsonSerializerOptions); + WriteProperties(writer, classModel, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ClassModel classModel, JsonSerializerOptions jsonSerializerOptions) { if (classModel.ClassOption.IsSet && classModel.Class == null) throw new ArgumentNullException(nameof(classModel.Class), "Property is required for class ClassModel."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 747b36ec65b..1a42f967ca9 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, complexQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, complexQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (complexQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(complexQuadrilateral.QuadrilateralType), "Property is required for class ComplexQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs index c28634e4e13..9eb8b733358 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DanishPig.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, danishPig, jsonSerializerOptions); + WriteProperties(writer, danishPig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DanishPig danishPig, JsonSerializerOptions jsonSerializerOptions) { if (danishPig.ClassName == null) throw new ArgumentNullException(nameof(danishPig.ClassName), "Property is required for class DanishPig."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1f703488591..c82942faae7 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dateOnlyClass, jsonSerializerOptions); + WriteProperties(writer, dateOnlyClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DateOnlyClass dateOnlyClass, JsonSerializerOptions jsonSerializerOptions) { if (dateOnlyClass.DateOnlyPropertyOption.IsSet) writer.WriteString("dateOnlyProperty", dateOnlyClass.DateOnlyPropertyOption.Value.Value.ToString(DateOnlyPropertyFormat)); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs index a87e900dab4..064985cce43 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, deprecatedObject, jsonSerializerOptions); + WriteProperties(writer, deprecatedObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, DeprecatedObject deprecatedObject, JsonSerializerOptions jsonSerializerOptions) { if (deprecatedObject.NameOption.IsSet && deprecatedObject.Name == null) throw new ArgumentNullException(nameof(deprecatedObject.Name), "Property is required for class DeprecatedObject."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs index 98de62908b3..75a60416f90 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Dog.cs @@ -32,11 +32,10 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// className /// breed /// color (default to "red") [JsonConstructor] - public Dog(string className, Option breed = default, Option color = default) : base(className, color) + public Dog(Option breed = default, Option color = default) : base(color) { BreedOption = breed; OnCreated(); @@ -44,6 +43,13 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string ClassName { get; } = "Dog"; + /// /// Used to track the state of Breed /// @@ -140,7 +146,7 @@ namespace Org.OpenAPITools.Model if (color.IsSet && color.Value == null) throw new ArgumentNullException(nameof(color), "Property is not nullable for class Dog."); - return new Dog(className.Value, breed, color); + return new Dog(breed, color); } /// @@ -154,7 +160,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, dog, jsonSerializerOptions); + WriteProperties(writer, dog, jsonSerializerOptions); writer.WriteEndObject(); } @@ -165,11 +171,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions) { - if (dog.ClassName == null) - throw new ArgumentNullException(nameof(dog.ClassName), "Property is required for class Dog."); - if (dog.BreedOption.IsSet && dog.Breed == null) throw new ArgumentNullException(nameof(dog.Breed), "Property is required for class Dog."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 47d27001827..13fe9ec2c1a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -218,7 +218,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, drawing, jsonSerializerOptions); + WriteProperties(writer, drawing, jsonSerializerOptions); writer.WriteEndObject(); } @@ -229,7 +229,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Drawing drawing, JsonSerializerOptions jsonSerializerOptions) { if (drawing.MainShapeOption.IsSet && drawing.MainShape == null) throw new ArgumentNullException(nameof(drawing.MainShape), "Property is required for class Drawing."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 0c4d4f2605b..a0b7504e9d2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -309,7 +309,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumArrays, jsonSerializerOptions); + WriteProperties(writer, enumArrays, jsonSerializerOptions); writer.WriteEndObject(); } @@ -320,7 +320,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumArrays enumArrays, JsonSerializerOptions jsonSerializerOptions) { if (enumArrays.ArrayEnumOption.IsSet && enumArrays.ArrayEnum == null) throw new ArgumentNullException(nameof(enumArrays.ArrayEnum), "Property is required for class EnumArrays."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index a49eb0130a4..dc39f92290d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -827,7 +827,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, enumTest, jsonSerializerOptions); + WriteProperties(writer, enumTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -838,7 +838,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EnumTest enumTest, JsonSerializerOptions jsonSerializerOptions) { var enumStringRequiredRawValue = EnumTest.EnumStringRequiredEnumToJsonValue(enumTest.EnumStringRequired); writer.WriteString("enum_string_required", enumStringRequiredRawValue); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index bbf4bf8f8e0..b84f89b531d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, equilateralTriangle, jsonSerializerOptions); + WriteProperties(writer, equilateralTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions) { if (equilateralTriangle.ShapeType == null) throw new ArgumentNullException(nameof(equilateralTriangle.ShapeType), "Property is required for class EquilateralTriangle."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs index b59035ea73a..95403fdaf96 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/File.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, file, jsonSerializerOptions); + WriteProperties(writer, file, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, File file, JsonSerializerOptions jsonSerializerOptions) { if (file.SourceURIOption.IsSet && file.SourceURI == null) throw new ArgumentNullException(nameof(file.SourceURI), "Property is required for class File."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index a4afe164a01..4906accc7ed 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fileSchemaTestClass, jsonSerializerOptions); + WriteProperties(writer, fileSchemaTestClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FileSchemaTestClass fileSchemaTestClass, JsonSerializerOptions jsonSerializerOptions) { if (fileSchemaTestClass.FileOption.IsSet && fileSchemaTestClass.File == null) throw new ArgumentNullException(nameof(fileSchemaTestClass.File), "Property is required for class FileSchemaTestClass."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs index 66a5f1546ca..a78d7a84f34 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Foo.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, foo, jsonSerializerOptions); + WriteProperties(writer, foo, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Foo foo, JsonSerializerOptions jsonSerializerOptions) { if (foo.BarOption.IsSet && foo.Bar == null) throw new ArgumentNullException(nameof(foo.Bar), "Property is required for class Foo."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 56330dc819a..4564148c4d9 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fooGetDefaultResponse, jsonSerializerOptions); + WriteProperties(writer, fooGetDefaultResponse, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FooGetDefaultResponse fooGetDefaultResponse, JsonSerializerOptions jsonSerializerOptions) { if (fooGetDefaultResponse.StringOption.IsSet && fooGetDefaultResponse.String == null) throw new ArgumentNullException(nameof(fooGetDefaultResponse.String), "Property is required for class FooGetDefaultResponse."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 8448947b66f..09b13bde9f7 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -703,7 +703,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, formatTest, jsonSerializerOptions); + WriteProperties(writer, formatTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSerializerOptions jsonSerializerOptions) { if (formatTest.Byte == null) throw new ArgumentNullException(nameof(formatTest.Byte), "Property is required for class FormatTest."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs index f466bc94d99..8e650b7b07c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Fruit.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruit, jsonSerializerOptions); + WriteProperties(writer, fruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions) { if (fruit.ColorOption.IsSet && fruit.Color == null) throw new ArgumentNullException(nameof(fruit.Color), "Property is required for class Fruit."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs index 03ef926c47d..f5dd6d56278 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -169,7 +169,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, fruitReq, jsonSerializerOptions); + WriteProperties(writer, fruitReq, jsonSerializerOptions); writer.WriteEndObject(); } @@ -180,7 +180,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs index feb40244561..14d47fa3293 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GmFruit.cs @@ -203,16 +203,16 @@ namespace Org.OpenAPITools.Model if (gmFruit.AppleOption.IsSet && gmFruit.AppleOption.Value != null) { AppleJsonConverter AppleJsonConverter = (AppleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.AppleOption.Value.GetType())); - AppleJsonConverter.WriteProperties(ref writer, gmFruit.AppleOption.Value, jsonSerializerOptions); + AppleJsonConverter.WriteProperties(writer, gmFruit.AppleOption.Value, jsonSerializerOptions); } if (gmFruit.BananaOption.IsSet && gmFruit.BananaOption.Value != null) { BananaJsonConverter BananaJsonConverter = (BananaJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(gmFruit.BananaOption.Value.GetType())); - BananaJsonConverter.WriteProperties(ref writer, gmFruit.BananaOption.Value, jsonSerializerOptions); + BananaJsonConverter.WriteProperties(writer, gmFruit.BananaOption.Value, jsonSerializerOptions); } - WriteProperties(ref writer, gmFruit, jsonSerializerOptions); + WriteProperties(writer, gmFruit, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions) { if (gmFruit.ColorOption.IsSet && gmFruit.Color == null) throw new ArgumentNullException(nameof(gmFruit.Color), "Property is required for class GmFruit."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 6b7d7ae8da6..86246ae5457 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -32,21 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public GrandparentAnimal(string petType) + public GrandparentAnimal() { - PetType = petType; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets PetType + /// The discriminator /// - [JsonPropertyName("pet_type")] - public string PetType { get; set; } + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public string PetType { get; } = "GrandparentAnimal"; /// /// Gets or Sets additional properties @@ -62,7 +61,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class GrandparentAnimal {\n"); - sb.Append(" PetType: ").Append(PetType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -113,6 +111,14 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + if (discriminator != null && discriminator.Equals("ParentPet")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -143,7 +149,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class GrandparentAnimal."); - return new GrandparentAnimal(petType.Value); + return new GrandparentAnimal(); } /// @@ -155,9 +161,19 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { + if (grandparentAnimal is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + + if (grandparentAnimal is ParentPet parentPet){ + JsonSerializer.Serialize(writer, parentPet, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, grandparentAnimal, jsonSerializerOptions); + WriteProperties(writer, grandparentAnimal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -168,11 +184,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, GrandparentAnimal grandparentAnimal, JsonSerializerOptions jsonSerializerOptions) { - if (grandparentAnimal.PetType == null) - throw new ArgumentNullException(nameof(grandparentAnimal.PetType), "Property is required for class GrandparentAnimal."); - writer.WriteString("pet_type", grandparentAnimal.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index a58bd756968..88c5d4274ea 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, hasOnlyReadOnly, jsonSerializerOptions); + WriteProperties(writer, hasOnlyReadOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HasOnlyReadOnly hasOnlyReadOnly, JsonSerializerOptions jsonSerializerOptions) { if (hasOnlyReadOnly.BarOption.IsSet && hasOnlyReadOnly.Bar == null) throw new ArgumentNullException(nameof(hasOnlyReadOnly.Bar), "Property is required for class HasOnlyReadOnly."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs index b312de2727c..4f9c831edc2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/HealthCheckResult.cs @@ -148,7 +148,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, healthCheckResult, jsonSerializerOptions); + WriteProperties(writer, healthCheckResult, jsonSerializerOptions); writer.WriteEndObject(); } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, HealthCheckResult healthCheckResult, JsonSerializerOptions jsonSerializerOptions) { if (healthCheckResult.NullableMessageOption.IsSet) if (healthCheckResult.NullableMessageOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 3f4aa3229c4..384e48f3a15 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, isoscelesTriangle, jsonSerializerOptions); + WriteProperties(writer, isoscelesTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -170,7 +170,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions) { if (isoscelesTriangle.ShapeType == null) throw new ArgumentNullException(nameof(isoscelesTriangle.ShapeType), "Property is required for class IsoscelesTriangle."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs index 2e0e16258a9..07fcd017a68 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/List.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, list, jsonSerializerOptions); + WriteProperties(writer, list, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, List list, JsonSerializerOptions jsonSerializerOptions) { if (list.Var123ListOption.IsSet && list.Var123List == null) throw new ArgumentNullException(nameof(list.Var123List), "Property is required for class List."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs index be67dd4da8c..c5fc2e2e77c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, literalStringClass, jsonSerializerOptions); + WriteProperties(writer, literalStringClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -185,7 +185,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, LiteralStringClass literalStringClass, JsonSerializerOptions jsonSerializerOptions) { if (literalStringClass.EscapedLiteralStringOption.IsSet && literalStringClass.EscapedLiteralString == null) throw new ArgumentNullException(nameof(literalStringClass.EscapedLiteralString), "Property is required for class LiteralStringClass."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs index 05e439a9c3e..1be5661d993 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Mammal.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Whale whale, string className) + public Mammal(Whale whale) { Whale = whale; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Zebra zebra, string className) + public Mammal(Zebra zebra) { Zebra = zebra; - ClassName = className; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Mammal(Pig pig, string className) + public Mammal(Pig pig) { Pig = pig; - ClassName = className; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public Pig Pig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Mammal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Mammal."); if (pig != null) - return new Mammal(pig, className.Value); + return new Mammal(pig); if (whale != null) - return new Mammal(whale, className.Value); + return new Mammal(whale); if (zebra != null) - return new Mammal(zebra, className.Value); + return new Mammal(zebra); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (mammal.Whale != null) { WhaleJsonConverter whaleJsonConverter = (WhaleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Whale.GetType())); - whaleJsonConverter.WriteProperties(ref writer, mammal.Whale, jsonSerializerOptions); + whaleJsonConverter.WriteProperties(writer, mammal.Whale, jsonSerializerOptions); } if (mammal.Zebra != null) { ZebraJsonConverter zebraJsonConverter = (ZebraJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Zebra.GetType())); - zebraJsonConverter.WriteProperties(ref writer, mammal.Zebra, jsonSerializerOptions); + zebraJsonConverter.WriteProperties(writer, mammal.Zebra, jsonSerializerOptions); } if (mammal.Pig != null) { PigJsonConverter pigJsonConverter = (PigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(mammal.Pig.GetType())); - pigJsonConverter.WriteProperties(ref writer, mammal.Pig, jsonSerializerOptions); + pigJsonConverter.WriteProperties(writer, mammal.Pig, jsonSerializerOptions); } - WriteProperties(ref writer, mammal, jsonSerializerOptions); + WriteProperties(writer, mammal, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions) { - if (mammal.ClassName == null) - throw new ArgumentNullException(nameof(mammal.ClassName), "Property is required for class Mammal."); - writer.WriteString("className", mammal.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 39b904e1681..6be561e42f1 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mapTest, jsonSerializerOptions); + WriteProperties(writer, mapTest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -301,7 +301,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MapTest mapTest, JsonSerializerOptions jsonSerializerOptions) { if (mapTest.DirectMapOption.IsSet && mapTest.DirectMap == null) throw new ArgumentNullException(nameof(mapTest.DirectMap), "Property is required for class MapTest."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..75cdeb1ec5b --- /dev/null +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1027 @@ +// +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; +using Org.OpenAPITools.Client; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + public partial class MixLog : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// description + /// formulaVersionDate + /// id + /// mixDate + /// totalOverPoors + /// totalRecalculations + /// totalSkips + /// totalUnderPours + /// batchNumber + /// BrandCode is only required for non-color mixes + /// BrandId is only required for color mixes + /// BrandName is only required for color mixes + /// CategoryCode is not used anymore + /// Color is only required for color mixes + /// colorDescription + /// comment + /// commercialProductCode + /// country + /// createdBy + /// createdByFirstName + /// createdByLastName + /// deltaECalculationRepaired + /// deltaECalculationSprayout + /// ownColorVariantNumber + /// primerProductId + /// ProductId is only required for color mixes + /// ProductLineCode is only required for color mixes + /// ProductName is only required for color mixes + /// selectedVersionIndex + /// shopId + /// SomeCode is only required for color mixes + /// totalPrice + [JsonConstructor] + public MixLog(string description, DateTime formulaVersionDate, Guid id, DateTime mixDate, int totalOverPoors, int totalRecalculations, int totalSkips, int totalUnderPours, Option batchNumber = default, Option brandCode = default, Option brandId = default, Option brandName = default, Option categoryCode = default, Option color = default, Option colorDescription = default, Option comment = default, Option commercialProductCode = default, Option country = default, Option createdBy = default, Option createdByFirstName = default, Option createdByLastName = default, Option deltaECalculationRepaired = default, Option deltaECalculationSprayout = default, Option ownColorVariantNumber = default, Option primerProductId = default, Option productId = default, Option productLineCode = default, Option productName = default, Option selectedVersionIndex = default, Option shopId = default, Option someCode = default, Option totalPrice = default) + { + Description = description; + FormulaVersionDate = formulaVersionDate; + Id = id; + MixDate = mixDate; + TotalOverPoors = totalOverPoors; + TotalRecalculations = totalRecalculations; + TotalSkips = totalSkips; + TotalUnderPours = totalUnderPours; + BatchNumberOption = batchNumber; + BrandCodeOption = brandCode; + BrandIdOption = brandId; + BrandNameOption = brandName; + CategoryCodeOption = categoryCode; + ColorOption = color; + ColorDescriptionOption = colorDescription; + CommentOption = comment; + CommercialProductCodeOption = commercialProductCode; + CountryOption = country; + CreatedByOption = createdBy; + CreatedByFirstNameOption = createdByFirstName; + CreatedByLastNameOption = createdByLastName; + DeltaECalculationRepairedOption = deltaECalculationRepaired; + DeltaECalculationSprayoutOption = deltaECalculationSprayout; + OwnColorVariantNumberOption = ownColorVariantNumber; + PrimerProductIdOption = primerProductId; + ProductIdOption = productId; + ProductLineCodeOption = productLineCode; + ProductNameOption = productName; + SelectedVersionIndexOption = selectedVersionIndex; + ShopIdOption = shopId; + SomeCodeOption = someCode; + TotalPriceOption = totalPrice; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Description + /// + [JsonPropertyName("description")] + public string Description { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [JsonPropertyName("formulaVersionDate")] + public DateTime FormulaVersionDate { get; set; } + + /// + /// Gets or Sets Id + /// + [JsonPropertyName("id")] + public Guid Id { get; set; } + + /// + /// Gets or Sets MixDate + /// + [JsonPropertyName("mixDate")] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [JsonPropertyName("totalOverPoors")] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [JsonPropertyName("totalRecalculations")] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [JsonPropertyName("totalSkips")] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [JsonPropertyName("totalUnderPours")] + public int TotalUnderPours { get; set; } + + /// + /// Used to track the state of BatchNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BatchNumberOption { get; private set; } + + /// + /// Gets or Sets BatchNumber + /// + [JsonPropertyName("batchNumber")] + public string BatchNumber { get { return this.BatchNumberOption; } set { this.BatchNumberOption = new Option(value); } } + + /// + /// Used to track the state of BrandCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandCodeOption { get; private set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [JsonPropertyName("brandCode")] + public string BrandCode { get { return this.BrandCodeOption; } set { this.BrandCodeOption = new Option(value); } } + + /// + /// Used to track the state of BrandId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandIdOption { get; private set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [JsonPropertyName("brandId")] + public string BrandId { get { return this.BrandIdOption; } set { this.BrandIdOption = new Option(value); } } + + /// + /// Used to track the state of BrandName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option BrandNameOption { get; private set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [JsonPropertyName("brandName")] + public string BrandName { get { return this.BrandNameOption; } set { this.BrandNameOption = new Option(value); } } + + /// + /// Used to track the state of CategoryCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CategoryCodeOption { get; private set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [JsonPropertyName("categoryCode")] + public string CategoryCode { get { return this.CategoryCodeOption; } set { this.CategoryCodeOption = new Option(value); } } + + /// + /// Used to track the state of Color + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorOption { get; private set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [JsonPropertyName("color")] + public string Color { get { return this.ColorOption; } set { this.ColorOption = new Option(value); } } + + /// + /// Used to track the state of ColorDescription + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ColorDescriptionOption { get; private set; } + + /// + /// Gets or Sets ColorDescription + /// + [JsonPropertyName("colorDescription")] + public string ColorDescription { get { return this.ColorDescriptionOption; } set { this.ColorDescriptionOption = new Option(value); } } + + /// + /// Used to track the state of Comment + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommentOption { get; private set; } + + /// + /// Gets or Sets Comment + /// + [JsonPropertyName("comment")] + public string Comment { get { return this.CommentOption; } set { this.CommentOption = new Option(value); } } + + /// + /// Used to track the state of CommercialProductCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CommercialProductCodeOption { get; private set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [JsonPropertyName("commercialProductCode")] + public string CommercialProductCode { get { return this.CommercialProductCodeOption; } set { this.CommercialProductCodeOption = new Option(value); } } + + /// + /// Used to track the state of Country + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CountryOption { get; private set; } + + /// + /// Gets or Sets Country + /// + [JsonPropertyName("country")] + public string Country { get { return this.CountryOption; } set { this.CountryOption = new Option(value); } } + + /// + /// Used to track the state of CreatedBy + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByOption { get; private set; } + + /// + /// Gets or Sets CreatedBy + /// + [JsonPropertyName("createdBy")] + public string CreatedBy { get { return this.CreatedByOption; } set { this.CreatedByOption = new Option(value); } } + + /// + /// Used to track the state of CreatedByFirstName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByFirstNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [JsonPropertyName("createdByFirstName")] + public string CreatedByFirstName { get { return this.CreatedByFirstNameOption; } set { this.CreatedByFirstNameOption = new Option(value); } } + + /// + /// Used to track the state of CreatedByLastName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option CreatedByLastNameOption { get; private set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [JsonPropertyName("createdByLastName")] + public string CreatedByLastName { get { return this.CreatedByLastNameOption; } set { this.CreatedByLastNameOption = new Option(value); } } + + /// + /// Used to track the state of DeltaECalculationRepaired + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationRepairedOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [JsonPropertyName("deltaECalculationRepaired")] + public string DeltaECalculationRepaired { get { return this.DeltaECalculationRepairedOption; } set { this.DeltaECalculationRepairedOption = new Option(value); } } + + /// + /// Used to track the state of DeltaECalculationSprayout + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option DeltaECalculationSprayoutOption { get; private set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [JsonPropertyName("deltaECalculationSprayout")] + public string DeltaECalculationSprayout { get { return this.DeltaECalculationSprayoutOption; } set { this.DeltaECalculationSprayoutOption = new Option(value); } } + + /// + /// Used to track the state of OwnColorVariantNumber + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option OwnColorVariantNumberOption { get; private set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [JsonPropertyName("ownColorVariantNumber")] + public int? OwnColorVariantNumber { get { return this.OwnColorVariantNumberOption; } set { this.OwnColorVariantNumberOption = new Option(value); } } + + /// + /// Used to track the state of PrimerProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option PrimerProductIdOption { get; private set; } + + /// + /// Gets or Sets PrimerProductId + /// + [JsonPropertyName("primerProductId")] + public string PrimerProductId { get { return this.PrimerProductIdOption; } set { this.PrimerProductIdOption = new Option(value); } } + + /// + /// Used to track the state of ProductId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductIdOption { get; private set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [JsonPropertyName("productId")] + public string ProductId { get { return this.ProductIdOption; } set { this.ProductIdOption = new Option(value); } } + + /// + /// Used to track the state of ProductLineCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductLineCodeOption { get; private set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [JsonPropertyName("productLineCode")] + public string ProductLineCode { get { return this.ProductLineCodeOption; } set { this.ProductLineCodeOption = new Option(value); } } + + /// + /// Used to track the state of ProductName + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ProductNameOption { get; private set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [JsonPropertyName("productName")] + public string ProductName { get { return this.ProductNameOption; } set { this.ProductNameOption = new Option(value); } } + + /// + /// Used to track the state of SelectedVersionIndex + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SelectedVersionIndexOption { get; private set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [JsonPropertyName("selectedVersionIndex")] + public int? SelectedVersionIndex { get { return this.SelectedVersionIndexOption; } set { this.SelectedVersionIndexOption = new Option(value); } } + + /// + /// Used to track the state of ShopId + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option ShopIdOption { get; private set; } + + /// + /// Gets or Sets ShopId + /// + [JsonPropertyName("shopId")] + public Guid? ShopId { get { return this.ShopIdOption; } set { this.ShopIdOption = new Option(value); } } + + /// + /// Used to track the state of SomeCode + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option SomeCodeOption { get; private set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [JsonPropertyName("someCode")] + public string SomeCode { get { return this.SomeCodeOption; } set { this.SomeCodeOption = new Option(value); } } + + /// + /// Used to track the state of TotalPrice + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option TotalPriceOption { get; private set; } + + /// + /// Gets or Sets TotalPrice + /// + [JsonPropertyName("totalPrice")] + public float? TotalPrice { get { return this.TotalPriceOption; } set { this.TotalPriceOption = new Option(value); } } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class MixLogJsonConverter : JsonConverter + { + /// + /// The format to use to serialize FormulaVersionDate + /// + public static string FormulaVersionDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// The format to use to serialize MixDate + /// + public static string MixDateFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override MixLog Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + Option description = default; + Option formulaVersionDate = default; + Option id = default; + Option mixDate = default; + Option totalOverPoors = default; + Option totalRecalculations = default; + Option totalSkips = default; + Option totalUnderPours = default; + Option batchNumber = default; + Option brandCode = default; + Option brandId = default; + Option brandName = default; + Option categoryCode = default; + Option color = default; + Option colorDescription = default; + Option comment = default; + Option commercialProductCode = default; + Option country = default; + Option createdBy = default; + Option createdByFirstName = default; + Option createdByLastName = default; + Option deltaECalculationRepaired = default; + Option deltaECalculationSprayout = default; + Option ownColorVariantNumber = default; + Option primerProductId = default; + Option productId = default; + Option productLineCode = default; + Option productName = default; + Option selectedVersionIndex = default; + Option shopId = default; + Option someCode = default; + Option totalPrice = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) + { + case "description": + description = new Option(utf8JsonReader.GetString()); + break; + case "formulaVersionDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + formulaVersionDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "id": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + id = new Option(utf8JsonReader.GetGuid()); + break; + case "mixDate": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + mixDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "totalOverPoors": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalOverPoors = new Option(utf8JsonReader.GetInt32()); + break; + case "totalRecalculations": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalRecalculations = new Option(utf8JsonReader.GetInt32()); + break; + case "totalSkips": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalSkips = new Option(utf8JsonReader.GetInt32()); + break; + case "totalUnderPours": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalUnderPours = new Option(utf8JsonReader.GetInt32()); + break; + case "batchNumber": + batchNumber = new Option(utf8JsonReader.GetString()); + break; + case "brandCode": + brandCode = new Option(utf8JsonReader.GetString()); + break; + case "brandId": + brandId = new Option(utf8JsonReader.GetString()); + break; + case "brandName": + brandName = new Option(utf8JsonReader.GetString()); + break; + case "categoryCode": + categoryCode = new Option(utf8JsonReader.GetString()); + break; + case "color": + color = new Option(utf8JsonReader.GetString()); + break; + case "colorDescription": + colorDescription = new Option(utf8JsonReader.GetString()); + break; + case "comment": + comment = new Option(utf8JsonReader.GetString()); + break; + case "commercialProductCode": + commercialProductCode = new Option(utf8JsonReader.GetString()); + break; + case "country": + country = new Option(utf8JsonReader.GetString()); + break; + case "createdBy": + createdBy = new Option(utf8JsonReader.GetString()); + break; + case "createdByFirstName": + createdByFirstName = new Option(utf8JsonReader.GetString()); + break; + case "createdByLastName": + createdByLastName = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationRepaired": + deltaECalculationRepaired = new Option(utf8JsonReader.GetString()); + break; + case "deltaECalculationSprayout": + deltaECalculationSprayout = new Option(utf8JsonReader.GetString()); + break; + case "ownColorVariantNumber": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + ownColorVariantNumber = new Option(utf8JsonReader.GetInt32()); + break; + case "primerProductId": + primerProductId = new Option(utf8JsonReader.GetString()); + break; + case "productId": + productId = new Option(utf8JsonReader.GetString()); + break; + case "productLineCode": + productLineCode = new Option(utf8JsonReader.GetString()); + break; + case "productName": + productName = new Option(utf8JsonReader.GetString()); + break; + case "selectedVersionIndex": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + selectedVersionIndex = new Option(utf8JsonReader.GetInt32()); + break; + case "shopId": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + shopId = new Option(utf8JsonReader.GetGuid()); + break; + case "someCode": + someCode = new Option(utf8JsonReader.GetString()); + break; + case "totalPrice": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + totalPrice = new Option((float)utf8JsonReader.GetDouble()); + break; + default: + break; + } + } + } + + if (!description.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(description)); + + if (!formulaVersionDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(formulaVersionDate)); + + if (!id.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(id)); + + if (!mixDate.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(mixDate)); + + if (!totalOverPoors.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalOverPoors)); + + if (!totalRecalculations.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalRecalculations)); + + if (!totalSkips.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalSkips)); + + if (!totalUnderPours.IsSet) + throw new ArgumentException("Property is required for class MixLog.", nameof(totalUnderPours)); + + if (description.IsSet && description.Value == null) + throw new ArgumentNullException(nameof(description), "Property is not nullable for class MixLog."); + + if (formulaVersionDate.IsSet && formulaVersionDate.Value == null) + throw new ArgumentNullException(nameof(formulaVersionDate), "Property is not nullable for class MixLog."); + + if (id.IsSet && id.Value == null) + throw new ArgumentNullException(nameof(id), "Property is not nullable for class MixLog."); + + if (mixDate.IsSet && mixDate.Value == null) + throw new ArgumentNullException(nameof(mixDate), "Property is not nullable for class MixLog."); + + if (totalOverPoors.IsSet && totalOverPoors.Value == null) + throw new ArgumentNullException(nameof(totalOverPoors), "Property is not nullable for class MixLog."); + + if (totalRecalculations.IsSet && totalRecalculations.Value == null) + throw new ArgumentNullException(nameof(totalRecalculations), "Property is not nullable for class MixLog."); + + if (totalSkips.IsSet && totalSkips.Value == null) + throw new ArgumentNullException(nameof(totalSkips), "Property is not nullable for class MixLog."); + + if (totalUnderPours.IsSet && totalUnderPours.Value == null) + throw new ArgumentNullException(nameof(totalUnderPours), "Property is not nullable for class MixLog."); + + if (batchNumber.IsSet && batchNumber.Value == null) + throw new ArgumentNullException(nameof(batchNumber), "Property is not nullable for class MixLog."); + + if (brandCode.IsSet && brandCode.Value == null) + throw new ArgumentNullException(nameof(brandCode), "Property is not nullable for class MixLog."); + + if (brandId.IsSet && brandId.Value == null) + throw new ArgumentNullException(nameof(brandId), "Property is not nullable for class MixLog."); + + if (brandName.IsSet && brandName.Value == null) + throw new ArgumentNullException(nameof(brandName), "Property is not nullable for class MixLog."); + + if (categoryCode.IsSet && categoryCode.Value == null) + throw new ArgumentNullException(nameof(categoryCode), "Property is not nullable for class MixLog."); + + if (color.IsSet && color.Value == null) + throw new ArgumentNullException(nameof(color), "Property is not nullable for class MixLog."); + + if (colorDescription.IsSet && colorDescription.Value == null) + throw new ArgumentNullException(nameof(colorDescription), "Property is not nullable for class MixLog."); + + if (comment.IsSet && comment.Value == null) + throw new ArgumentNullException(nameof(comment), "Property is not nullable for class MixLog."); + + if (commercialProductCode.IsSet && commercialProductCode.Value == null) + throw new ArgumentNullException(nameof(commercialProductCode), "Property is not nullable for class MixLog."); + + if (country.IsSet && country.Value == null) + throw new ArgumentNullException(nameof(country), "Property is not nullable for class MixLog."); + + if (createdBy.IsSet && createdBy.Value == null) + throw new ArgumentNullException(nameof(createdBy), "Property is not nullable for class MixLog."); + + if (createdByFirstName.IsSet && createdByFirstName.Value == null) + throw new ArgumentNullException(nameof(createdByFirstName), "Property is not nullable for class MixLog."); + + if (createdByLastName.IsSet && createdByLastName.Value == null) + throw new ArgumentNullException(nameof(createdByLastName), "Property is not nullable for class MixLog."); + + if (deltaECalculationRepaired.IsSet && deltaECalculationRepaired.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationRepaired), "Property is not nullable for class MixLog."); + + if (deltaECalculationSprayout.IsSet && deltaECalculationSprayout.Value == null) + throw new ArgumentNullException(nameof(deltaECalculationSprayout), "Property is not nullable for class MixLog."); + + if (primerProductId.IsSet && primerProductId.Value == null) + throw new ArgumentNullException(nameof(primerProductId), "Property is not nullable for class MixLog."); + + if (productId.IsSet && productId.Value == null) + throw new ArgumentNullException(nameof(productId), "Property is not nullable for class MixLog."); + + if (productLineCode.IsSet && productLineCode.Value == null) + throw new ArgumentNullException(nameof(productLineCode), "Property is not nullable for class MixLog."); + + if (productName.IsSet && productName.Value == null) + throw new ArgumentNullException(nameof(productName), "Property is not nullable for class MixLog."); + + if (selectedVersionIndex.IsSet && selectedVersionIndex.Value == null) + throw new ArgumentNullException(nameof(selectedVersionIndex), "Property is not nullable for class MixLog."); + + if (shopId.IsSet && shopId.Value == null) + throw new ArgumentNullException(nameof(shopId), "Property is not nullable for class MixLog."); + + return new MixLog(description.Value, formulaVersionDate.Value.Value, id.Value.Value, mixDate.Value.Value, totalOverPoors.Value.Value, totalRecalculations.Value.Value, totalSkips.Value.Value, totalUnderPours.Value.Value, batchNumber, brandCode, brandId, brandName, categoryCode, color, colorDescription, comment, commercialProductCode, country, createdBy, createdByFirstName, createdByLastName, deltaECalculationRepaired, deltaECalculationSprayout, ownColorVariantNumber, primerProductId, productId, productLineCode, productName, selectedVersionIndex, shopId, someCode, totalPrice); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(writer, mixLog, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(Utf8JsonWriter writer, MixLog mixLog, JsonSerializerOptions jsonSerializerOptions) + { + if (mixLog.Description == null) + throw new ArgumentNullException(nameof(mixLog.Description), "Property is required for class MixLog."); + + if (mixLog.BatchNumberOption.IsSet && mixLog.BatchNumber == null) + throw new ArgumentNullException(nameof(mixLog.BatchNumber), "Property is required for class MixLog."); + + if (mixLog.BrandCodeOption.IsSet && mixLog.BrandCode == null) + throw new ArgumentNullException(nameof(mixLog.BrandCode), "Property is required for class MixLog."); + + if (mixLog.BrandIdOption.IsSet && mixLog.BrandId == null) + throw new ArgumentNullException(nameof(mixLog.BrandId), "Property is required for class MixLog."); + + if (mixLog.BrandNameOption.IsSet && mixLog.BrandName == null) + throw new ArgumentNullException(nameof(mixLog.BrandName), "Property is required for class MixLog."); + + if (mixLog.CategoryCodeOption.IsSet && mixLog.CategoryCode == null) + throw new ArgumentNullException(nameof(mixLog.CategoryCode), "Property is required for class MixLog."); + + if (mixLog.ColorOption.IsSet && mixLog.Color == null) + throw new ArgumentNullException(nameof(mixLog.Color), "Property is required for class MixLog."); + + if (mixLog.ColorDescriptionOption.IsSet && mixLog.ColorDescription == null) + throw new ArgumentNullException(nameof(mixLog.ColorDescription), "Property is required for class MixLog."); + + if (mixLog.CommentOption.IsSet && mixLog.Comment == null) + throw new ArgumentNullException(nameof(mixLog.Comment), "Property is required for class MixLog."); + + if (mixLog.CommercialProductCodeOption.IsSet && mixLog.CommercialProductCode == null) + throw new ArgumentNullException(nameof(mixLog.CommercialProductCode), "Property is required for class MixLog."); + + if (mixLog.CountryOption.IsSet && mixLog.Country == null) + throw new ArgumentNullException(nameof(mixLog.Country), "Property is required for class MixLog."); + + if (mixLog.CreatedByOption.IsSet && mixLog.CreatedBy == null) + throw new ArgumentNullException(nameof(mixLog.CreatedBy), "Property is required for class MixLog."); + + if (mixLog.CreatedByFirstNameOption.IsSet && mixLog.CreatedByFirstName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByFirstName), "Property is required for class MixLog."); + + if (mixLog.CreatedByLastNameOption.IsSet && mixLog.CreatedByLastName == null) + throw new ArgumentNullException(nameof(mixLog.CreatedByLastName), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationRepairedOption.IsSet && mixLog.DeltaECalculationRepaired == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationRepaired), "Property is required for class MixLog."); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet && mixLog.DeltaECalculationSprayout == null) + throw new ArgumentNullException(nameof(mixLog.DeltaECalculationSprayout), "Property is required for class MixLog."); + + if (mixLog.PrimerProductIdOption.IsSet && mixLog.PrimerProductId == null) + throw new ArgumentNullException(nameof(mixLog.PrimerProductId), "Property is required for class MixLog."); + + if (mixLog.ProductIdOption.IsSet && mixLog.ProductId == null) + throw new ArgumentNullException(nameof(mixLog.ProductId), "Property is required for class MixLog."); + + if (mixLog.ProductLineCodeOption.IsSet && mixLog.ProductLineCode == null) + throw new ArgumentNullException(nameof(mixLog.ProductLineCode), "Property is required for class MixLog."); + + if (mixLog.ProductNameOption.IsSet && mixLog.ProductName == null) + throw new ArgumentNullException(nameof(mixLog.ProductName), "Property is required for class MixLog."); + + writer.WriteString("description", mixLog.Description); + + writer.WriteString("formulaVersionDate", mixLog.FormulaVersionDate.ToString(FormulaVersionDateFormat)); + + writer.WriteString("id", mixLog.Id); + + writer.WriteString("mixDate", mixLog.MixDate.ToString(MixDateFormat)); + + writer.WriteNumber("totalOverPoors", mixLog.TotalOverPoors); + + writer.WriteNumber("totalRecalculations", mixLog.TotalRecalculations); + + writer.WriteNumber("totalSkips", mixLog.TotalSkips); + + writer.WriteNumber("totalUnderPours", mixLog.TotalUnderPours); + + if (mixLog.BatchNumberOption.IsSet) + writer.WriteString("batchNumber", mixLog.BatchNumber); + + if (mixLog.BrandCodeOption.IsSet) + writer.WriteString("brandCode", mixLog.BrandCode); + + if (mixLog.BrandIdOption.IsSet) + writer.WriteString("brandId", mixLog.BrandId); + + if (mixLog.BrandNameOption.IsSet) + writer.WriteString("brandName", mixLog.BrandName); + + if (mixLog.CategoryCodeOption.IsSet) + writer.WriteString("categoryCode", mixLog.CategoryCode); + + if (mixLog.ColorOption.IsSet) + writer.WriteString("color", mixLog.Color); + + if (mixLog.ColorDescriptionOption.IsSet) + writer.WriteString("colorDescription", mixLog.ColorDescription); + + if (mixLog.CommentOption.IsSet) + writer.WriteString("comment", mixLog.Comment); + + if (mixLog.CommercialProductCodeOption.IsSet) + writer.WriteString("commercialProductCode", mixLog.CommercialProductCode); + + if (mixLog.CountryOption.IsSet) + writer.WriteString("country", mixLog.Country); + + if (mixLog.CreatedByOption.IsSet) + writer.WriteString("createdBy", mixLog.CreatedBy); + + if (mixLog.CreatedByFirstNameOption.IsSet) + writer.WriteString("createdByFirstName", mixLog.CreatedByFirstName); + + if (mixLog.CreatedByLastNameOption.IsSet) + writer.WriteString("createdByLastName", mixLog.CreatedByLastName); + + if (mixLog.DeltaECalculationRepairedOption.IsSet) + writer.WriteString("deltaECalculationRepaired", mixLog.DeltaECalculationRepaired); + + if (mixLog.DeltaECalculationSprayoutOption.IsSet) + writer.WriteString("deltaECalculationSprayout", mixLog.DeltaECalculationSprayout); + + if (mixLog.OwnColorVariantNumberOption.IsSet) + if (mixLog.OwnColorVariantNumberOption.Value != null) + writer.WriteNumber("ownColorVariantNumber", mixLog.OwnColorVariantNumberOption.Value.Value); + else + writer.WriteNull("ownColorVariantNumber"); + + if (mixLog.PrimerProductIdOption.IsSet) + writer.WriteString("primerProductId", mixLog.PrimerProductId); + + if (mixLog.ProductIdOption.IsSet) + writer.WriteString("productId", mixLog.ProductId); + + if (mixLog.ProductLineCodeOption.IsSet) + writer.WriteString("productLineCode", mixLog.ProductLineCode); + + if (mixLog.ProductNameOption.IsSet) + writer.WriteString("productName", mixLog.ProductName); + + if (mixLog.SelectedVersionIndexOption.IsSet) + writer.WriteNumber("selectedVersionIndex", mixLog.SelectedVersionIndexOption.Value.Value); + + if (mixLog.ShopIdOption.IsSet) + writer.WriteString("shopId", mixLog.ShopIdOption.Value.Value); + + if (mixLog.SomeCodeOption.IsSet) + if (mixLog.SomeCodeOption.Value != null) + writer.WriteString("someCode", mixLog.SomeCode); + else + writer.WriteNull("someCode"); + + if (mixLog.TotalPriceOption.IsSet) + if (mixLog.TotalPriceOption.Value != null) + writer.WriteNumber("totalPrice", mixLog.TotalPriceOption.Value.Value); + else + writer.WriteNull("totalPrice"); + } + } +} diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index c2ff988661c..095c00f4562 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -236,7 +236,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); + WriteProperties(writer, mixedPropertiesAndAdditionalPropertiesClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -247,7 +247,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass, JsonSerializerOptions jsonSerializerOptions) { if (mixedPropertiesAndAdditionalPropertiesClass.MapOption.IsSet && mixedPropertiesAndAdditionalPropertiesClass.Map == null) throw new ArgumentNullException(nameof(mixedPropertiesAndAdditionalPropertiesClass.Map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index c6c6c408e8f..8c0a59ace8b 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, model200Response, jsonSerializerOptions); + WriteProperties(writer, model200Response, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Model200Response model200Response, JsonSerializerOptions jsonSerializerOptions) { if (model200Response.ClassOption.IsSet && model200Response.Class == null) throw new ArgumentNullException(nameof(model200Response.Class), "Property is required for class Model200Response."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs index 90209abbdfa..e8cca355d28 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ModelClient.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, modelClient, jsonSerializerOptions); + WriteProperties(writer, modelClient, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ModelClient modelClient, JsonSerializerOptions jsonSerializerOptions) { if (modelClient.VarClientOption.IsSet && modelClient.VarClient == null) throw new ArgumentNullException(nameof(modelClient.VarClient), "Property is required for class ModelClient."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs index c736546e3e0..90a80bda881 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, name, jsonSerializerOptions); + WriteProperties(writer, name, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,7 +271,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Name name, JsonSerializerOptions jsonSerializerOptions) { if (name.PropertyOption.IsSet && name.Property == null) throw new ArgumentNullException(nameof(name.Property), "Property is required for class Name."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index cd1516104e3..d10268f2927 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); + WriteProperties(writer, notificationtestGetElementsV1ResponseMPayload, jsonSerializerOptions); writer.WriteEndObject(); } @@ -179,7 +179,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NotificationtestGetElementsV1ResponseMPayload notificationtestGetElementsV1ResponseMPayload, JsonSerializerOptions jsonSerializerOptions) { if (notificationtestGetElementsV1ResponseMPayload.AObjVariableobject == null) throw new ArgumentNullException(nameof(notificationtestGetElementsV1ResponseMPayload.AObjVariableobject), "Property is required for class NotificationtestGetElementsV1ResponseMPayload."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 9cbc709be9a..f844fec808c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -395,7 +395,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableClass, jsonSerializerOptions); + WriteProperties(writer, nullableClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableClass nullableClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableClass.ArrayItemsNullableOption.IsSet && nullableClass.ArrayItemsNullable == null) throw new ArgumentNullException(nameof(nullableClass.ArrayItemsNullable), "Property is required for class NullableClass."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 0b88d5dbe20..ef86eb595ac 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -150,7 +150,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, nullableGuidClass, jsonSerializerOptions); + WriteProperties(writer, nullableGuidClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableGuidClass nullableGuidClass, JsonSerializerOptions jsonSerializerOptions) { if (nullableGuidClass.UuidOption.IsSet) if (nullableGuidClass.UuidOption.Value != null) diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs index d6659599426..10061a2c228 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Triangle triangle, string shapeType) + public NullableShape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public NullableShape(Quadrilateral quadrilateral, string shapeType) + public NullableShape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class NullableShape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class NullableShape."); if (quadrilateral != null) - return new NullableShape(quadrilateral, shapeType.Value); + return new NullableShape(quadrilateral); if (triangle != null) - return new NullableShape(triangle, shapeType.Value); + return new NullableShape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (nullableShape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, nullableShape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, nullableShape.Triangle, jsonSerializerOptions); } if (nullableShape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(nullableShape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, nullableShape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, nullableShape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, nullableShape, jsonSerializerOptions); + WriteProperties(writer, nullableShape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NullableShape nullableShape, JsonSerializerOptions jsonSerializerOptions) { - if (nullableShape.ShapeType == null) - throw new ArgumentNullException(nameof(nullableShape.ShapeType), "Property is required for class NullableShape."); - writer.WriteString("shapeType", nullableShape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index cf2291059d0..2b602ec80d7 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, numberOnly, jsonSerializerOptions); + WriteProperties(writer, numberOnly, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, NumberOnly numberOnly, JsonSerializerOptions jsonSerializerOptions) { if (numberOnly.JustNumberOption.IsSet) writer.WriteNumber("JustNumber", numberOnly.JustNumberOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index aa52b39b2da..5cc97e836da 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, objectWithDeprecatedFields, jsonSerializerOptions); + WriteProperties(writer, objectWithDeprecatedFields, jsonSerializerOptions); writer.WriteEndObject(); } @@ -237,7 +237,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ObjectWithDeprecatedFields objectWithDeprecatedFields, JsonSerializerOptions jsonSerializerOptions) { if (objectWithDeprecatedFields.BarsOption.IsSet && objectWithDeprecatedFields.Bars == null) throw new ArgumentNullException(nameof(objectWithDeprecatedFields.Bars), "Property is required for class ObjectWithDeprecatedFields."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs index 6e94b861b23..0f4f13f311b 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OneOfString.cs @@ -32,19 +32,19 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal OneOfString(string varString) + /// + internal OneOfString(string @string) { - VarString = varString; + String = @string; OnCreated(); } partial void OnCreated(); /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets additional properties @@ -138,7 +138,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, oneOfString, jsonSerializerOptions); + WriteProperties(writer, oneOfString, jsonSerializerOptions); writer.WriteEndObject(); } @@ -149,7 +149,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OneOfString oneOfString, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs index ee06c7a739c..8d0ff121213 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -361,7 +361,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, order, jsonSerializerOptions); + WriteProperties(writer, order, jsonSerializerOptions); writer.WriteEndObject(); } @@ -372,7 +372,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Order order, JsonSerializerOptions jsonSerializerOptions) { if (order.CompleteOption.IsSet) writer.WriteBoolean("complete", order.CompleteOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index a520b16a596..bb1af321865 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -199,7 +199,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, outerComposite, jsonSerializerOptions); + WriteProperties(writer, outerComposite, jsonSerializerOptions); writer.WriteEndObject(); } @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, OuterComposite outerComposite, JsonSerializerOptions jsonSerializerOptions) { if (outerComposite.MyStringOption.IsSet && outerComposite.MyString == null) throw new ArgumentNullException(nameof(outerComposite.MyString), "Property is required for class OuterComposite."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs index c451e1a8991..5d1cab769fa 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ParentPet.cs @@ -32,15 +32,21 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// petType [JsonConstructor] - public ParentPet(string petType) : base(petType) + public ParentPet() : base() { OnCreated(); } partial void OnCreated(); + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string PetType { get; } = "ParentPet"; + /// /// Returns the string presentation of the object /// @@ -79,6 +85,11 @@ namespace Org.OpenAPITools.Model Option petType = default; + string discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "pet_type"); + + if (discriminator != null && discriminator.Equals("ChildCat")) + return JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -109,7 +120,7 @@ namespace Org.OpenAPITools.Model if (petType.IsSet && petType.Value == null) throw new ArgumentNullException(nameof(petType), "Property is not nullable for class ParentPet."); - return new ParentPet(petType.Value); + return new ParentPet(); } /// @@ -121,9 +132,14 @@ namespace Org.OpenAPITools.Model /// public override void Write(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { + if (parentPet is ChildCat childCat){ + JsonSerializer.Serialize(writer, childCat, jsonSerializerOptions); + return; + } + writer.WriteStartObject(); - WriteProperties(ref writer, parentPet, jsonSerializerOptions); + WriteProperties(writer, parentPet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -134,11 +150,8 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ParentPet parentPet, JsonSerializerOptions jsonSerializerOptions) { - if (parentPet.PetType == null) - throw new ArgumentNullException(nameof(parentPet.PetType), "Property is required for class ParentPet."); - writer.WriteString("pet_type", parentPet.PetType); } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs index a106a05b2f4..ec63640215f 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -347,7 +347,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, pet, jsonSerializerOptions); + WriteProperties(writer, pet, jsonSerializerOptions); writer.WriteEndObject(); } @@ -358,7 +358,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pet pet, JsonSerializerOptions jsonSerializerOptions) { if (pet.Name == null) throw new ArgumentNullException(nameof(pet.Name), "Property is required for class Pet."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs index d3bbeb8ff32..19e395f1de4 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pig.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(BasquePig basquePig, string className) + public Pig(BasquePig basquePig) { BasquePig = basquePig; - ClassName = className; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// className - public Pig(DanishPig danishPig, string className) + public Pig(DanishPig danishPig) { DanishPig = danishPig; - ClassName = className; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public DanishPig DanishPig { get; set; } - /// - /// Gets or Sets ClassName - /// - [JsonPropertyName("className")] - public string ClassName { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Pig {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(className), "Property is not nullable for class Pig."); if (basquePig != null) - return new Pig(basquePig, className.Value); + return new Pig(basquePig); if (danishPig != null) - return new Pig(danishPig, className.Value); + return new Pig(danishPig); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (pig.BasquePig != null) { BasquePigJsonConverter basquePigJsonConverter = (BasquePigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.BasquePig.GetType())); - basquePigJsonConverter.WriteProperties(ref writer, pig.BasquePig, jsonSerializerOptions); + basquePigJsonConverter.WriteProperties(writer, pig.BasquePig, jsonSerializerOptions); } if (pig.DanishPig != null) { DanishPigJsonConverter danishPigJsonConverter = (DanishPigJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(pig.DanishPig.GetType())); - danishPigJsonConverter.WriteProperties(ref writer, pig.DanishPig, jsonSerializerOptions); + danishPigJsonConverter.WriteProperties(writer, pig.DanishPig, jsonSerializerOptions); } - WriteProperties(ref writer, pig, jsonSerializerOptions); + WriteProperties(writer, pig, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Pig pig, JsonSerializerOptions jsonSerializerOptions) { - if (pig.ClassName == null) - throw new ArgumentNullException(nameof(pig.ClassName), "Property is required for class Pig."); - writer.WriteString("className", pig.ClassName); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 85e19cd25d2..30edd0b77d2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -32,20 +32,20 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(bool varBool) + /// + internal PolymorphicProperty(bool @bool) { - VarBool = varBool; + Bool = @bool; OnCreated(); } /// /// Initializes a new instance of the class. /// - /// - internal PolymorphicProperty(string varString) + /// + internal PolymorphicProperty(string @string) { - VarString = varString; + String = @string; OnCreated(); } @@ -72,14 +72,14 @@ namespace Org.OpenAPITools.Model partial void OnCreated(); /// - /// Gets or Sets VarBool + /// Gets or Sets Bool /// - public bool? VarBool { get; set; } + public bool? Bool { get; set; } /// - /// Gets or Sets VarString + /// Gets or Sets String /// - public string VarString { get; set; } + public string String { get; set; } /// /// Gets or Sets Object @@ -159,11 +159,11 @@ namespace Org.OpenAPITools.Model if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - Utf8JsonReader utf8JsonReaderVarBool = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarBool, jsonSerializerOptions, out varBool); + Utf8JsonReader utf8JsonReaderBool = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderBool, jsonSerializerOptions, out varBool); - Utf8JsonReader utf8JsonReaderVarString = utf8JsonReader; - ClientUtils.TryDeserialize(ref utf8JsonReaderVarString, jsonSerializerOptions, out varString); + Utf8JsonReader utf8JsonReaderString = utf8JsonReader; + ClientUtils.TryDeserialize(ref utf8JsonReaderString, jsonSerializerOptions, out varString); Utf8JsonReader utf8JsonReaderObject = utf8JsonReader; ClientUtils.TryDeserialize(ref utf8JsonReaderObject, jsonSerializerOptions, out varObject); @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model } if (varBool != null) - return new PolymorphicProperty(varBool); + return new PolymorphicProperty(varBool.Value); if (varString != null) return new PolymorphicProperty(varString); @@ -220,7 +220,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, polymorphicProperty, jsonSerializerOptions); + WriteProperties(writer, polymorphicProperty, jsonSerializerOptions); writer.WriteEndObject(); } @@ -231,7 +231,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, PolymorphicProperty polymorphicProperty, JsonSerializerOptions jsonSerializerOptions) { } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs index f3ef21718ae..3d333d7958f 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral, string quadrilateralType) + public Quadrilateral(SimpleQuadrilateral simpleQuadrilateral) { SimpleQuadrilateral = simpleQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// quadrilateralType - public Quadrilateral(ComplexQuadrilateral complexQuadrilateral, string quadrilateralType) + public Quadrilateral(ComplexQuadrilateral complexQuadrilateral) { ComplexQuadrilateral = complexQuadrilateral; - QuadrilateralType = quadrilateralType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public ComplexQuadrilateral ComplexQuadrilateral { get; set; } - /// - /// Gets or Sets QuadrilateralType - /// - [JsonPropertyName("quadrilateralType")] - public string QuadrilateralType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Quadrilateral {\n"); - sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(quadrilateralType), "Property is not nullable for class Quadrilateral."); if (complexQuadrilateral != null) - return new Quadrilateral(complexQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(complexQuadrilateral); if (simpleQuadrilateral != null) - return new Quadrilateral(simpleQuadrilateral, quadrilateralType.Value); + return new Quadrilateral(simpleQuadrilateral); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (quadrilateral.SimpleQuadrilateral != null) { SimpleQuadrilateralJsonConverter simpleQuadrilateralJsonConverter = (SimpleQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.SimpleQuadrilateral.GetType())); - simpleQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); + simpleQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.SimpleQuadrilateral, jsonSerializerOptions); } if (quadrilateral.ComplexQuadrilateral != null) { ComplexQuadrilateralJsonConverter complexQuadrilateralJsonConverter = (ComplexQuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(quadrilateral.ComplexQuadrilateral.GetType())); - complexQuadrilateralJsonConverter.WriteProperties(ref writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); + complexQuadrilateralJsonConverter.WriteProperties(writer, quadrilateral.ComplexQuadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, quadrilateral, jsonSerializerOptions); + WriteProperties(writer, quadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Quadrilateral quadrilateral, JsonSerializerOptions jsonSerializerOptions) { - if (quadrilateral.QuadrilateralType == null) - throw new ArgumentNullException(nameof(quadrilateral.QuadrilateralType), "Property is required for class Quadrilateral."); - writer.WriteString("quadrilateralType", quadrilateral.QuadrilateralType); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 75b7e516cfc..610005a0540 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, quadrilateralInterface, jsonSerializerOptions); + WriteProperties(writer, quadrilateralInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, QuadrilateralInterface quadrilateralInterface, JsonSerializerOptions jsonSerializerOptions) { if (quadrilateralInterface.QuadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralInterface.QuadrilateralType), "Property is required for class QuadrilateralInterface."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index c7ee548df4d..87358abb827 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -212,7 +212,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, readOnlyFirst, jsonSerializerOptions); + WriteProperties(writer, readOnlyFirst, jsonSerializerOptions); writer.WriteEndObject(); } @@ -223,7 +223,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ReadOnlyFirst readOnlyFirst, JsonSerializerOptions jsonSerializerOptions) { if (readOnlyFirst.BarOption.IsSet && readOnlyFirst.Bar == null) throw new ArgumentNullException(nameof(readOnlyFirst.Bar), "Property is required for class ReadOnlyFirst."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index b080aebf528..dda8b3ba8a8 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -43,17 +43,6 @@ namespace Org.OpenAPITools.Model /// requiredNotnullableStringProp /// requiredNotnullableUuid /// requiredNotnullableintegerProp - /// requiredNullableArrayOfString - /// requiredNullableBooleanProp - /// requiredNullableDateProp - /// requiredNullableDatetimeProp - /// requiredNullableEnumInteger - /// requiredNullableEnumIntegerOnly - /// requiredNullableEnumString - /// requiredNullableIntegerProp - /// requiredNullableOuterEnumDefaultValue - /// requiredNullableStringProp - /// requiredNullableUuid /// notRequiredNotnullableDateProp /// notRequiredNotnullableintegerProp /// notRequiredNullableDateProp @@ -76,8 +65,19 @@ namespace Org.OpenAPITools.Model /// notrequiredNullableOuterEnumDefaultValue /// notrequiredNullableStringProp /// notrequiredNullableUuid + /// requiredNullableArrayOfString + /// requiredNullableBooleanProp + /// requiredNullableDateProp + /// requiredNullableDatetimeProp + /// requiredNullableEnumInteger + /// requiredNullableEnumIntegerOnly + /// requiredNullableEnumString + /// requiredNullableIntegerProp + /// requiredNullableOuterEnumDefaultValue + /// requiredNullableStringProp + /// requiredNullableUuid [JsonConstructor] - public RequiredClass(DateTime requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateTime? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default) + public RequiredClass(DateTime requiredNotNullableDateProp, List requiredNotnullableArrayOfString, bool requiredNotnullableBooleanProp, DateTime requiredNotnullableDatetimeProp, RequiredNotnullableEnumIntegerEnum requiredNotnullableEnumInteger, RequiredNotnullableEnumIntegerOnlyEnum requiredNotnullableEnumIntegerOnly, RequiredNotnullableEnumStringEnum requiredNotnullableEnumString, OuterEnumDefaultValue requiredNotnullableOuterEnumDefaultValue, string requiredNotnullableStringProp, Guid requiredNotnullableUuid, int requiredNotnullableintegerProp, Option notRequiredNotnullableDateProp = default, Option notRequiredNotnullableintegerProp = default, Option notRequiredNullableDateProp = default, Option notRequiredNullableIntegerProp = default, Option> notrequiredNotnullableArrayOfString = default, Option notrequiredNotnullableBooleanProp = default, Option notrequiredNotnullableDatetimeProp = default, Option notrequiredNotnullableEnumInteger = default, Option notrequiredNotnullableEnumIntegerOnly = default, Option notrequiredNotnullableEnumString = default, Option notrequiredNotnullableOuterEnumDefaultValue = default, Option notrequiredNotnullableStringProp = default, Option notrequiredNotnullableUuid = default, Option> notrequiredNullableArrayOfString = default, Option notrequiredNullableBooleanProp = default, Option notrequiredNullableDatetimeProp = default, Option notrequiredNullableEnumInteger = default, Option notrequiredNullableEnumIntegerOnly = default, Option notrequiredNullableEnumString = default, Option notrequiredNullableOuterEnumDefaultValue = default, Option notrequiredNullableStringProp = default, Option notrequiredNullableUuid = default, List requiredNullableArrayOfString = default, bool? requiredNullableBooleanProp = default, DateTime? requiredNullableDateProp = default, DateTime? requiredNullableDatetimeProp = default, RequiredNullableEnumIntegerEnum? requiredNullableEnumInteger = default, RequiredNullableEnumIntegerOnlyEnum? requiredNullableEnumIntegerOnly = default, RequiredNullableEnumStringEnum? requiredNullableEnumString = default, int? requiredNullableIntegerProp = default, OuterEnumDefaultValue? requiredNullableOuterEnumDefaultValue = default, string requiredNullableStringProp = default, Guid? requiredNullableUuid = default) { RequiredNotNullableDateProp = requiredNotNullableDateProp; RequiredNotnullableArrayOfString = requiredNotnullableArrayOfString; @@ -90,17 +90,6 @@ namespace Org.OpenAPITools.Model RequiredNotnullableStringProp = requiredNotnullableStringProp; RequiredNotnullableUuid = requiredNotnullableUuid; RequiredNotnullableintegerProp = requiredNotnullableintegerProp; - RequiredNullableArrayOfString = requiredNullableArrayOfString; - RequiredNullableBooleanProp = requiredNullableBooleanProp; - RequiredNullableDateProp = requiredNullableDateProp; - RequiredNullableDatetimeProp = requiredNullableDatetimeProp; - RequiredNullableEnumInteger = requiredNullableEnumInteger; - RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; - RequiredNullableEnumString = requiredNullableEnumString; - RequiredNullableIntegerProp = requiredNullableIntegerProp; - RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; - RequiredNullableStringProp = requiredNullableStringProp; - RequiredNullableUuid = requiredNullableUuid; NotRequiredNotnullableDatePropOption = notRequiredNotnullableDateProp; NotRequiredNotnullableintegerPropOption = notRequiredNotnullableintegerProp; NotRequiredNullableDatePropOption = notRequiredNullableDateProp; @@ -123,6 +112,17 @@ namespace Org.OpenAPITools.Model NotrequiredNullableOuterEnumDefaultValueOption = notrequiredNullableOuterEnumDefaultValue; NotrequiredNullableStringPropOption = notrequiredNullableStringProp; NotrequiredNullableUuidOption = notrequiredNullableUuid; + RequiredNullableArrayOfString = requiredNullableArrayOfString; + RequiredNullableBooleanProp = requiredNullableBooleanProp; + RequiredNullableDateProp = requiredNullableDateProp; + RequiredNullableDatetimeProp = requiredNullableDatetimeProp; + RequiredNullableEnumInteger = requiredNullableEnumInteger; + RequiredNullableEnumIntegerOnly = requiredNullableEnumIntegerOnly; + RequiredNullableEnumString = requiredNullableEnumString; + RequiredNullableIntegerProp = requiredNullableIntegerProp; + RequiredNullableOuterEnumDefaultValue = requiredNullableOuterEnumDefaultValue; + RequiredNullableStringProp = requiredNullableStringProp; + RequiredNullableUuid = requiredNullableUuid; OnCreated(); } @@ -420,301 +420,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullable_outerEnumDefaultValue")] public OuterEnumDefaultValue RequiredNotnullableOuterEnumDefaultValue { get; set; } - /// - /// Defines RequiredNullableEnumInteger - /// - public enum RequiredNullableEnumIntegerEnum - { - /// - /// Enum NUMBER_1 for value: 1 - /// - NUMBER_1 = 1, - - /// - /// Enum NUMBER_MINUS_1 for value: -1 - /// - NUMBER_MINUS_1 = -1 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) - { - if (value.Equals((1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_1; - - if (value.Equals((-1).ToString())) - return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumInteger - /// - [JsonPropertyName("required_nullable_enum_integer")] - public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } - - /// - /// Defines RequiredNullableEnumIntegerOnly - /// - public enum RequiredNullableEnumIntegerOnlyEnum - { - /// - /// Enum NUMBER_2 for value: 2 - /// - NUMBER_2 = 2, - - /// - /// Enum NUMBER_MINUS_2 for value: -2 - /// - NUMBER_MINUS_2 = -2 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) - { - if (value.Equals((2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; - - if (value.Equals((-2).ToString())) - return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) - { - return (int) value; - } - - /// - /// Gets or Sets RequiredNullableEnumIntegerOnly - /// - [JsonPropertyName("required_nullable_enum_integer_only")] - public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } - - /// - /// Defines RequiredNullableEnumString - /// - public enum RequiredNullableEnumStringEnum - { - /// - /// Enum UPPER for value: UPPER - /// - UPPER = 1, - - /// - /// Enum Lower for value: lower - /// - Lower = 2, - - /// - /// Enum Empty for value: - /// - Empty = 3, - - /// - /// Enum ValuewithTab for value: Value\twith tab - /// - ValuewithTab = 4, - - /// - /// Enum ValueWithQuote for value: Value with \" quote - /// - ValueWithQuote = 5, - - /// - /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote - /// - ValueWithEscapedQuote = 6, - - /// - /// Enum Duplicatevalue for value: Duplicate\nvalue - /// - Duplicatevalue = 7, - - /// - /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue - /// - Duplicatevalue2 = 8 - } - - /// - /// Returns a - /// - /// - /// - /// - public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); - } - - /// - /// Returns a - /// - /// - /// - public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) - { - if (value.Equals("UPPER")) - return RequiredNullableEnumStringEnum.UPPER; - - if (value.Equals("lower")) - return RequiredNullableEnumStringEnum.Lower; - - if (value.Equals("")) - return RequiredNullableEnumStringEnum.Empty; - - if (value.Equals("Value\twith tab")) - return RequiredNullableEnumStringEnum.ValuewithTab; - - if (value.Equals("Value with \" quote")) - return RequiredNullableEnumStringEnum.ValueWithQuote; - - if (value.Equals("Value with escaped \" quote")) - return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; - - if (value.Equals("Duplicate\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue; - - if (value.Equals("Duplicate\r\nvalue")) - return RequiredNullableEnumStringEnum.Duplicatevalue2; - - return null; - } - - /// - /// Converts the to the json value - /// - /// - /// - /// - public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) - { - if (value == null) - return null; - - if (value == RequiredNullableEnumStringEnum.UPPER) - return "UPPER"; - - if (value == RequiredNullableEnumStringEnum.Lower) - return "lower"; - - if (value == RequiredNullableEnumStringEnum.Empty) - return ""; - - if (value == RequiredNullableEnumStringEnum.ValuewithTab) - return "Value\twith tab"; - - if (value == RequiredNullableEnumStringEnum.ValueWithQuote) - return "Value with \" quote"; - - if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) - return "Value with escaped \" quote"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue) - return "Duplicate\nvalue"; - - if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) - return "Duplicate\r\nvalue"; - - throw new NotImplementedException($"Value could not be handled: '{value}'"); - } - - /// - /// Gets or Sets RequiredNullableEnumString - /// - [JsonPropertyName("required_nullable_enum_string")] - public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } - - /// - /// Gets or Sets RequiredNullableOuterEnumDefaultValue - /// - [JsonPropertyName("required_nullable_outerEnumDefaultValue")] - public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } - /// /// Defines NotrequiredNotnullableEnumInteger /// @@ -1358,6 +1063,301 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_outerEnumDefaultValue")] public OuterEnumDefaultValue? NotrequiredNullableOuterEnumDefaultValue { get { return this.NotrequiredNullableOuterEnumDefaultValueOption; } set { this.NotrequiredNullableOuterEnumDefaultValueOption = new Option(value); } } + /// + /// Defines RequiredNullableEnumInteger + /// + public enum RequiredNullableEnumIntegerEnum + { + /// + /// Enum NUMBER_1 for value: 1 + /// + NUMBER_1 = 1, + + /// + /// Enum NUMBER_MINUS_1 for value: -1 + /// + NUMBER_MINUS_1 = -1 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerEnum RequiredNullableEnumIntegerEnumFromString(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerEnum? RequiredNullableEnumIntegerEnumFromStringOrDefault(string value) + { + if (value.Equals((1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_1; + + if (value.Equals((-1).ToString())) + return RequiredNullableEnumIntegerEnum.NUMBER_MINUS_1; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerEnumToJsonValue(RequiredNullableEnumIntegerEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumInteger + /// + [JsonPropertyName("required_nullable_enum_integer")] + public RequiredNullableEnumIntegerEnum? RequiredNullableEnumInteger { get; set; } + + /// + /// Defines RequiredNullableEnumIntegerOnly + /// + public enum RequiredNullableEnumIntegerOnlyEnum + { + /// + /// Enum NUMBER_2 for value: 2 + /// + NUMBER_2 = 2, + + /// + /// Enum NUMBER_MINUS_2 for value: -2 + /// + NUMBER_MINUS_2 = -2 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum RequiredNullableEnumIntegerOnlyEnumFromString(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumIntegerOnlyEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnlyEnumFromStringOrDefault(string value) + { + if (value.Equals((2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_2; + + if (value.Equals((-2).ToString())) + return RequiredNullableEnumIntegerOnlyEnum.NUMBER_MINUS_2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + public static int RequiredNullableEnumIntegerOnlyEnumToJsonValue(RequiredNullableEnumIntegerOnlyEnum value) + { + return (int) value; + } + + /// + /// Gets or Sets RequiredNullableEnumIntegerOnly + /// + [JsonPropertyName("required_nullable_enum_integer_only")] + public RequiredNullableEnumIntegerOnlyEnum? RequiredNullableEnumIntegerOnly { get; set; } + + /// + /// Defines RequiredNullableEnumString + /// + public enum RequiredNullableEnumStringEnum + { + /// + /// Enum UPPER for value: UPPER + /// + UPPER = 1, + + /// + /// Enum Lower for value: lower + /// + Lower = 2, + + /// + /// Enum Empty for value: + /// + Empty = 3, + + /// + /// Enum ValuewithTab for value: Value\twith tab + /// + ValuewithTab = 4, + + /// + /// Enum ValueWithQuote for value: Value with \" quote + /// + ValueWithQuote = 5, + + /// + /// Enum ValueWithEscapedQuote for value: Value with escaped \" quote + /// + ValueWithEscapedQuote = 6, + + /// + /// Enum Duplicatevalue for value: Duplicate\nvalue + /// + Duplicatevalue = 7, + + /// + /// Enum Duplicatevalue2 for value: Duplicate\r\nvalue + /// + Duplicatevalue2 = 8 + } + + /// + /// Returns a + /// + /// + /// + /// + public static RequiredNullableEnumStringEnum RequiredNullableEnumStringEnumFromString(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + throw new NotImplementedException($"Could not convert value to type RequiredNullableEnumStringEnum: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static RequiredNullableEnumStringEnum? RequiredNullableEnumStringEnumFromStringOrDefault(string value) + { + if (value.Equals("UPPER")) + return RequiredNullableEnumStringEnum.UPPER; + + if (value.Equals("lower")) + return RequiredNullableEnumStringEnum.Lower; + + if (value.Equals("")) + return RequiredNullableEnumStringEnum.Empty; + + if (value.Equals("Value\twith tab")) + return RequiredNullableEnumStringEnum.ValuewithTab; + + if (value.Equals("Value with \" quote")) + return RequiredNullableEnumStringEnum.ValueWithQuote; + + if (value.Equals("Value with escaped \" quote")) + return RequiredNullableEnumStringEnum.ValueWithEscapedQuote; + + if (value.Equals("Duplicate\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue; + + if (value.Equals("Duplicate\r\nvalue")) + return RequiredNullableEnumStringEnum.Duplicatevalue2; + + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static string RequiredNullableEnumStringEnumToJsonValue(RequiredNullableEnumStringEnum? value) + { + if (value == null) + return null; + + if (value == RequiredNullableEnumStringEnum.UPPER) + return "UPPER"; + + if (value == RequiredNullableEnumStringEnum.Lower) + return "lower"; + + if (value == RequiredNullableEnumStringEnum.Empty) + return ""; + + if (value == RequiredNullableEnumStringEnum.ValuewithTab) + return "Value\twith tab"; + + if (value == RequiredNullableEnumStringEnum.ValueWithQuote) + return "Value with \" quote"; + + if (value == RequiredNullableEnumStringEnum.ValueWithEscapedQuote) + return "Value with escaped \" quote"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue) + return "Duplicate\nvalue"; + + if (value == RequiredNullableEnumStringEnum.Duplicatevalue2) + return "Duplicate\r\nvalue"; + + throw new NotImplementedException($"Value could not be handled: '{value}'"); + } + + /// + /// Gets or Sets RequiredNullableEnumString + /// + [JsonPropertyName("required_nullable_enum_string")] + public RequiredNullableEnumStringEnum? RequiredNullableEnumString { get; set; } + + /// + /// Gets or Sets RequiredNullableOuterEnumDefaultValue + /// + [JsonPropertyName("required_nullable_outerEnumDefaultValue")] + public OuterEnumDefaultValue? RequiredNullableOuterEnumDefaultValue { get; set; } + /// /// Gets or Sets RequiredNotNullableDateProp /// @@ -1401,49 +1401,6 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("required_notnullableinteger_prop")] public int RequiredNotnullableintegerProp { get; set; } - /// - /// Gets or Sets RequiredNullableArrayOfString - /// - [JsonPropertyName("required_nullable_array_of_string")] - public List RequiredNullableArrayOfString { get; set; } - - /// - /// Gets or Sets RequiredNullableBooleanProp - /// - [JsonPropertyName("required_nullable_boolean_prop")] - public bool? RequiredNullableBooleanProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDateProp - /// - [JsonPropertyName("required_nullable_date_prop")] - public DateTime? RequiredNullableDateProp { get; set; } - - /// - /// Gets or Sets RequiredNullableDatetimeProp - /// - [JsonPropertyName("required_nullable_datetime_prop")] - public DateTime? RequiredNullableDatetimeProp { get; set; } - - /// - /// Gets or Sets RequiredNullableIntegerProp - /// - [JsonPropertyName("required_nullable_integer_prop")] - public int? RequiredNullableIntegerProp { get; set; } - - /// - /// Gets or Sets RequiredNullableStringProp - /// - [JsonPropertyName("required_nullable_string_prop")] - public string RequiredNullableStringProp { get; set; } - - /// - /// Gets or Sets RequiredNullableUuid - /// - /// 72f98069-206d-4f12-9f12-3d1e525a8e84 - [JsonPropertyName("required_nullable_uuid")] - public Guid? RequiredNullableUuid { get; set; } - /// /// Used to track the state of NotRequiredNotnullableDateProp /// @@ -1628,6 +1585,49 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("notrequired_nullable_uuid")] public Guid? NotrequiredNullableUuid { get { return this.NotrequiredNullableUuidOption; } set { this.NotrequiredNullableUuidOption = new Option(value); } } + /// + /// Gets or Sets RequiredNullableArrayOfString + /// + [JsonPropertyName("required_nullable_array_of_string")] + public List RequiredNullableArrayOfString { get; set; } + + /// + /// Gets or Sets RequiredNullableBooleanProp + /// + [JsonPropertyName("required_nullable_boolean_prop")] + public bool? RequiredNullableBooleanProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDateProp + /// + [JsonPropertyName("required_nullable_date_prop")] + public DateTime? RequiredNullableDateProp { get; set; } + + /// + /// Gets or Sets RequiredNullableDatetimeProp + /// + [JsonPropertyName("required_nullable_datetime_prop")] + public DateTime? RequiredNullableDatetimeProp { get; set; } + + /// + /// Gets or Sets RequiredNullableIntegerProp + /// + [JsonPropertyName("required_nullable_integer_prop")] + public int? RequiredNullableIntegerProp { get; set; } + + /// + /// Gets or Sets RequiredNullableStringProp + /// + [JsonPropertyName("required_nullable_string_prop")] + public string RequiredNullableStringProp { get; set; } + + /// + /// Gets or Sets RequiredNullableUuid + /// + /// 72f98069-206d-4f12-9f12-3d1e525a8e84 + [JsonPropertyName("required_nullable_uuid")] + public Guid? RequiredNullableUuid { get; set; } + /// /// Gets or Sets additional properties /// @@ -1653,17 +1653,6 @@ namespace Org.OpenAPITools.Model sb.Append(" RequiredNotnullableStringProp: ").Append(RequiredNotnullableStringProp).Append("\n"); sb.Append(" RequiredNotnullableUuid: ").Append(RequiredNotnullableUuid).Append("\n"); sb.Append(" RequiredNotnullableintegerProp: ").Append(RequiredNotnullableintegerProp).Append("\n"); - sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); - sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); - sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); - sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); - sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); - sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); - sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); - sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); - sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); - sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); - sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" NotRequiredNotnullableDateProp: ").Append(NotRequiredNotnullableDateProp).Append("\n"); sb.Append(" NotRequiredNotnullableintegerProp: ").Append(NotRequiredNotnullableintegerProp).Append("\n"); sb.Append(" NotRequiredNullableDateProp: ").Append(NotRequiredNullableDateProp).Append("\n"); @@ -1686,6 +1675,17 @@ namespace Org.OpenAPITools.Model sb.Append(" NotrequiredNullableOuterEnumDefaultValue: ").Append(NotrequiredNullableOuterEnumDefaultValue).Append("\n"); sb.Append(" NotrequiredNullableStringProp: ").Append(NotrequiredNullableStringProp).Append("\n"); sb.Append(" NotrequiredNullableUuid: ").Append(NotrequiredNullableUuid).Append("\n"); + sb.Append(" RequiredNullableArrayOfString: ").Append(RequiredNullableArrayOfString).Append("\n"); + sb.Append(" RequiredNullableBooleanProp: ").Append(RequiredNullableBooleanProp).Append("\n"); + sb.Append(" RequiredNullableDateProp: ").Append(RequiredNullableDateProp).Append("\n"); + sb.Append(" RequiredNullableDatetimeProp: ").Append(RequiredNullableDatetimeProp).Append("\n"); + sb.Append(" RequiredNullableEnumInteger: ").Append(RequiredNullableEnumInteger).Append("\n"); + sb.Append(" RequiredNullableEnumIntegerOnly: ").Append(RequiredNullableEnumIntegerOnly).Append("\n"); + sb.Append(" RequiredNullableEnumString: ").Append(RequiredNullableEnumString).Append("\n"); + sb.Append(" RequiredNullableIntegerProp: ").Append(RequiredNullableIntegerProp).Append("\n"); + sb.Append(" RequiredNullableOuterEnumDefaultValue: ").Append(RequiredNullableOuterEnumDefaultValue).Append("\n"); + sb.Append(" RequiredNullableStringProp: ").Append(RequiredNullableStringProp).Append("\n"); + sb.Append(" RequiredNullableUuid: ").Append(RequiredNullableUuid).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -1717,16 +1717,6 @@ namespace Org.OpenAPITools.Model /// public static string RequiredNotnullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// - /// The format to use to serialize RequiredNullableDateProp - /// - public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; - - /// - /// The format to use to serialize RequiredNullableDatetimeProp - /// - public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; - /// /// The format to use to serialize NotRequiredNotnullableDateProp /// @@ -1747,6 +1737,16 @@ namespace Org.OpenAPITools.Model /// public static string NotrequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// + /// The format to use to serialize RequiredNullableDateProp + /// + public static string RequiredNullableDatePropFormat { get; set; } = "yyyy'-'MM'-'dd"; + + /// + /// The format to use to serialize RequiredNullableDatetimeProp + /// + public static string RequiredNullableDatetimePropFormat { get; set; } = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK"; + /// /// Deserializes json to /// @@ -1775,17 +1775,6 @@ namespace Org.OpenAPITools.Model Option requiredNotnullableStringProp = default; Option requiredNotnullableUuid = default; Option requiredNotnullableintegerProp = default; - Option> requiredNullableArrayOfString = default; - Option requiredNullableBooleanProp = default; - Option requiredNullableDateProp = default; - Option requiredNullableDatetimeProp = default; - Option requiredNullableEnumInteger = default; - Option requiredNullableEnumIntegerOnly = default; - Option requiredNullableEnumString = default; - Option requiredNullableIntegerProp = default; - Option requiredNullableOuterEnumDefaultValue = default; - Option requiredNullableStringProp = default; - Option requiredNullableUuid = default; Option notRequiredNotnullableDateProp = default; Option notRequiredNotnullableintegerProp = default; Option notRequiredNullableDateProp = default; @@ -1808,6 +1797,17 @@ namespace Org.OpenAPITools.Model Option notrequiredNullableOuterEnumDefaultValue = default; Option notrequiredNullableStringProp = default; Option notrequiredNullableUuid = default; + Option> requiredNullableArrayOfString = default; + Option requiredNullableBooleanProp = default; + Option requiredNullableDateProp = default; + Option requiredNullableDatetimeProp = default; + Option requiredNullableEnumInteger = default; + Option requiredNullableEnumIntegerOnly = default; + Option requiredNullableEnumString = default; + Option requiredNullableIntegerProp = default; + Option requiredNullableOuterEnumDefaultValue = default; + Option requiredNullableStringProp = default; + Option requiredNullableUuid = default; while (utf8JsonReader.Read()) { @@ -1869,51 +1869,6 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); break; - case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); - break; - case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); - break; - case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); - break; - case "required_nullable_enum_string": - string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); - if (requiredNullableEnumStringRawValue != null) - requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); - break; - case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); - break; - case "required_nullable_outerEnumDefaultValue": - string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); - break; - case "required_nullable_string_prop": - requiredNullableStringProp = new Option(utf8JsonReader.GetString()); - break; - case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); - break; case "not_required_notnullable_date_prop": if (utf8JsonReader.TokenType != JsonTokenType.Null) notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); @@ -2004,6 +1959,51 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); break; + case "required_nullable_array_of_string": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_boolean_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + break; + case "required_nullable_date_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_datetime_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + break; + case "required_nullable_enum_integer": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_integer_only": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + break; + case "required_nullable_enum_string": + string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); + if (requiredNullableEnumStringRawValue != null) + requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); + break; + case "required_nullable_integer_prop": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + break; + case "required_nullable_outerEnumDefaultValue": + string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + requiredNullableOuterEnumDefaultValue = new Option(OuterEnumDefaultValueValueConverter.FromStringOrDefault(requiredNullableOuterEnumDefaultValueRawValue)); + break; + case "required_nullable_string_prop": + requiredNullableStringProp = new Option(utf8JsonReader.GetString()); + break; + case "required_nullable_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + break; default: break; } @@ -2142,7 +2142,7 @@ namespace Org.OpenAPITools.Model if (notrequiredNotnullableUuid.IsSet && notrequiredNotnullableUuid.Value == null) throw new ArgumentNullException(nameof(notrequiredNotnullableUuid), "Property is not nullable for class RequiredClass."); - return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid); + return new RequiredClass(requiredNotNullableDateProp.Value.Value, requiredNotnullableArrayOfString.Value, requiredNotnullableBooleanProp.Value.Value, requiredNotnullableDatetimeProp.Value.Value, requiredNotnullableEnumInteger.Value.Value, requiredNotnullableEnumIntegerOnly.Value.Value, requiredNotnullableEnumString.Value.Value, requiredNotnullableOuterEnumDefaultValue.Value.Value, requiredNotnullableStringProp.Value, requiredNotnullableUuid.Value.Value, requiredNotnullableintegerProp.Value.Value, notRequiredNotnullableDateProp, notRequiredNotnullableintegerProp, notRequiredNullableDateProp, notRequiredNullableIntegerProp, notrequiredNotnullableArrayOfString, notrequiredNotnullableBooleanProp, notrequiredNotnullableDatetimeProp, notrequiredNotnullableEnumInteger, notrequiredNotnullableEnumIntegerOnly, notrequiredNotnullableEnumString, notrequiredNotnullableOuterEnumDefaultValue, notrequiredNotnullableStringProp, notrequiredNotnullableUuid, notrequiredNullableArrayOfString, notrequiredNullableBooleanProp, notrequiredNullableDatetimeProp, notrequiredNullableEnumInteger, notrequiredNullableEnumIntegerOnly, notrequiredNullableEnumString, notrequiredNullableOuterEnumDefaultValue, notrequiredNullableStringProp, notrequiredNullableUuid, requiredNullableArrayOfString.Value, requiredNullableBooleanProp.Value, requiredNullableDateProp.Value, requiredNullableDatetimeProp.Value, requiredNullableEnumInteger.Value, requiredNullableEnumIntegerOnly.Value, requiredNullableEnumString.Value, requiredNullableIntegerProp.Value, requiredNullableOuterEnumDefaultValue.Value, requiredNullableStringProp.Value, requiredNullableUuid.Value); } /// @@ -2156,7 +2156,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, requiredClass, jsonSerializerOptions); + WriteProperties(writer, requiredClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -2167,7 +2167,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RequiredClass requiredClass, JsonSerializerOptions jsonSerializerOptions) { if (requiredClass.RequiredNotnullableArrayOfString == null) throw new ArgumentNullException(nameof(requiredClass.RequiredNotnullableArrayOfString), "Property is required for class RequiredClass."); @@ -2204,70 +2204,6 @@ namespace Org.OpenAPITools.Model writer.WriteNumber("required_notnullableinteger_prop", requiredClass.RequiredNotnullableintegerProp); - if (requiredClass.RequiredNullableArrayOfString != null) - { - writer.WritePropertyName("required_nullable_array_of_string"); - JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); - } - else - writer.WriteNull("required_nullable_array_of_string"); - if (requiredClass.RequiredNullableBooleanProp != null) - writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); - else - writer.WriteNull("required_nullable_boolean_prop"); - - if (requiredClass.RequiredNullableDateProp != null) - writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); - else - writer.WriteNull("required_nullable_date_prop"); - - if (requiredClass.RequiredNullableDatetimeProp != null) - writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); - else - writer.WriteNull("required_nullable_datetime_prop"); - - if (requiredClass.RequiredNullableEnumInteger != null) - writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); - else - writer.WriteNull("required_nullable_enum_integer"); - - if (requiredClass.RequiredNullableEnumIntegerOnly != null) - writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); - else - writer.WriteNull("required_nullable_enum_integer_only"); - - var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString.Value); - if (requiredNullableEnumStringRawValue != null) - writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); - else - writer.WriteNull("required_nullable_enum_string"); - - if (requiredClass.RequiredNullableIntegerProp != null) - writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); - else - writer.WriteNull("required_nullable_integer_prop"); - - if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - else - { - var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); - if (requiredNullableOuterEnumDefaultValueRawValue != null) - writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); - else - writer.WriteNull("required_nullable_outerEnumDefaultValue"); - } - - if (requiredClass.RequiredNullableStringProp != null) - writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); - else - writer.WriteNull("required_nullable_string_prop"); - - if (requiredClass.RequiredNullableUuid != null) - writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); - else - writer.WriteNull("required_nullable_uuid"); - if (requiredClass.NotRequiredNotnullableDatePropOption.IsSet) writer.WriteString("not_required_notnullable_date_prop", requiredClass.NotRequiredNotnullableDatePropOption.Value.Value.ToString(NotRequiredNotnullableDatePropFormat)); @@ -2373,6 +2309,70 @@ namespace Org.OpenAPITools.Model writer.WriteString("notrequired_nullable_uuid", requiredClass.NotrequiredNullableUuidOption.Value.Value); else writer.WriteNull("notrequired_nullable_uuid"); + + if (requiredClass.RequiredNullableArrayOfString != null) + { + writer.WritePropertyName("required_nullable_array_of_string"); + JsonSerializer.Serialize(writer, requiredClass.RequiredNullableArrayOfString, jsonSerializerOptions); + } + else + writer.WriteNull("required_nullable_array_of_string"); + if (requiredClass.RequiredNullableBooleanProp != null) + writer.WriteBoolean("required_nullable_boolean_prop", requiredClass.RequiredNullableBooleanProp.Value); + else + writer.WriteNull("required_nullable_boolean_prop"); + + if (requiredClass.RequiredNullableDateProp != null) + writer.WriteString("required_nullable_date_prop", requiredClass.RequiredNullableDateProp.Value.ToString(RequiredNullableDatePropFormat)); + else + writer.WriteNull("required_nullable_date_prop"); + + if (requiredClass.RequiredNullableDatetimeProp != null) + writer.WriteString("required_nullable_datetime_prop", requiredClass.RequiredNullableDatetimeProp.Value.ToString(RequiredNullableDatetimePropFormat)); + else + writer.WriteNull("required_nullable_datetime_prop"); + + if (requiredClass.RequiredNullableEnumInteger != null) + writer.WriteNumber("required_nullable_enum_integer", RequiredClass.RequiredNullableEnumIntegerEnumToJsonValue(requiredClass.RequiredNullableEnumInteger.Value)); + else + writer.WriteNull("required_nullable_enum_integer"); + + if (requiredClass.RequiredNullableEnumIntegerOnly != null) + writer.WriteNumber("required_nullable_enum_integer_only", RequiredClass.RequiredNullableEnumIntegerOnlyEnumToJsonValue(requiredClass.RequiredNullableEnumIntegerOnly.Value)); + else + writer.WriteNull("required_nullable_enum_integer_only"); + + var requiredNullableEnumStringRawValue = RequiredClass.RequiredNullableEnumStringEnumToJsonValue(requiredClass.RequiredNullableEnumString.Value); + if (requiredNullableEnumStringRawValue != null) + writer.WriteString("required_nullable_enum_string", requiredNullableEnumStringRawValue); + else + writer.WriteNull("required_nullable_enum_string"); + + if (requiredClass.RequiredNullableIntegerProp != null) + writer.WriteNumber("required_nullable_integer_prop", requiredClass.RequiredNullableIntegerProp.Value); + else + writer.WriteNull("required_nullable_integer_prop"); + + if (requiredClass.RequiredNullableOuterEnumDefaultValue == null) + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + else + { + var requiredNullableOuterEnumDefaultValueRawValue = OuterEnumDefaultValueValueConverter.ToJsonValue(requiredClass.RequiredNullableOuterEnumDefaultValue.Value); + if (requiredNullableOuterEnumDefaultValueRawValue != null) + writer.WriteString("required_nullable_outerEnumDefaultValue", requiredNullableOuterEnumDefaultValueRawValue); + else + writer.WriteNull("required_nullable_outerEnumDefaultValue"); + } + + if (requiredClass.RequiredNullableStringProp != null) + writer.WriteString("required_nullable_string_prop", requiredClass.RequiredNullableStringProp); + else + writer.WriteNull("required_nullable_string_prop"); + + if (requiredClass.RequiredNullableUuid != null) + writer.WriteString("required_nullable_uuid", requiredClass.RequiredNullableUuid.Value); + else + writer.WriteNull("required_nullable_uuid"); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs index 3b97b6b6ff2..b294720b331 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -210,7 +210,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, varReturn, jsonSerializerOptions); + WriteProperties(writer, varReturn, jsonSerializerOptions); writer.WriteEndObject(); } @@ -221,7 +221,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Return varReturn, JsonSerializerOptions jsonSerializerOptions) { if (varReturn.Lock == null) throw new ArgumentNullException(nameof(varReturn.Lock), "Property is required for class Return."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 17b1921a052..494ee791a24 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHash, jsonSerializerOptions); writer.WriteEndObject(); } @@ -187,7 +187,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHash.RoleOption.IsSet && rolesReportsHash.Role == null) throw new ArgumentNullException(nameof(rolesReportsHash.Role), "Property is required for class RolesReportsHash."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs index bc4d2eed98c..4d0df8c9fc4 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + WriteProperties(writer, rolesReportsHashRole, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) { if (rolesReportsHashRole.NameOption.IsSet && rolesReportsHashRole.Name == null) throw new ArgumentNullException(nameof(rolesReportsHashRole.Name), "Property is required for class RolesReportsHashRole."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 52a8e0d69c6..47081ede38e 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, scaleneTriangle, jsonSerializerOptions); + WriteProperties(writer, scaleneTriangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ScaleneTriangle scaleneTriangle, JsonSerializerOptions jsonSerializerOptions) { if (scaleneTriangle.ShapeType == null) throw new ArgumentNullException(nameof(scaleneTriangle.ShapeType), "Property is required for class ScaleneTriangle."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs index ffd95a8fdff..d4883a363a2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Shape.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Triangle triangle, string shapeType) + public Shape(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public Shape(Quadrilateral quadrilateral, string shapeType) + public Shape(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Shape {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class Shape."); if (quadrilateral != null) - return new Shape(quadrilateral, shapeType.Value); + return new Shape(quadrilateral); if (triangle != null) - return new Shape(triangle, shapeType.Value); + return new Shape(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shape.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shape.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shape.Triangle, jsonSerializerOptions); } if (shape.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shape.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shape.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shape.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shape, jsonSerializerOptions); + WriteProperties(writer, shape, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Shape shape, JsonSerializerOptions jsonSerializerOptions) { - if (shape.ShapeType == null) - throw new ArgumentNullException(nameof(shape.ShapeType), "Property is required for class Shape."); - writer.WriteString("shapeType", shape.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs index 5bd364cc6a4..3027d9142ba 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, shapeInterface, jsonSerializerOptions); + WriteProperties(writer, shapeInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeInterface shapeInterface, JsonSerializerOptions jsonSerializerOptions) { if (shapeInterface.ShapeType == null) throw new ArgumentNullException(nameof(shapeInterface.ShapeType), "Property is required for class ShapeInterface."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index d60f396c70d..2d9fb2cbb33 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Triangle triangle, string shapeType) + public ShapeOrNull(Triangle triangle) { Triangle = triangle; - ShapeType = shapeType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// shapeType - public ShapeOrNull(Quadrilateral quadrilateral, string shapeType) + public ShapeOrNull(Quadrilateral quadrilateral) { Quadrilateral = quadrilateral; - ShapeType = shapeType; OnCreated(); } @@ -65,12 +61,6 @@ namespace Org.OpenAPITools.Model /// public Quadrilateral Quadrilateral { get; set; } - /// - /// Gets or Sets ShapeType - /// - [JsonPropertyName("shapeType")] - public string ShapeType { get; set; } - /// /// Gets or Sets additional properties /// @@ -85,7 +75,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class ShapeOrNull {\n"); - sb.Append(" ShapeType: ").Append(ShapeType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -200,10 +189,10 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(shapeType), "Property is not nullable for class ShapeOrNull."); if (quadrilateral != null) - return new ShapeOrNull(quadrilateral, shapeType.Value); + return new ShapeOrNull(quadrilateral); if (triangle != null) - return new ShapeOrNull(triangle, shapeType.Value); + return new ShapeOrNull(triangle); throw new JsonException(); } @@ -221,15 +210,15 @@ namespace Org.OpenAPITools.Model if (shapeOrNull.Triangle != null) { TriangleJsonConverter triangleJsonConverter = (TriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Triangle.GetType())); - triangleJsonConverter.WriteProperties(ref writer, shapeOrNull.Triangle, jsonSerializerOptions); + triangleJsonConverter.WriteProperties(writer, shapeOrNull.Triangle, jsonSerializerOptions); } if (shapeOrNull.Quadrilateral != null) { QuadrilateralJsonConverter quadrilateralJsonConverter = (QuadrilateralJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(shapeOrNull.Quadrilateral.GetType())); - quadrilateralJsonConverter.WriteProperties(ref writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); + quadrilateralJsonConverter.WriteProperties(writer, shapeOrNull.Quadrilateral, jsonSerializerOptions); } - WriteProperties(ref writer, shapeOrNull, jsonSerializerOptions); + WriteProperties(writer, shapeOrNull, jsonSerializerOptions); writer.WriteEndObject(); } @@ -240,12 +229,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ShapeOrNull shapeOrNull, JsonSerializerOptions jsonSerializerOptions) { - if (shapeOrNull.ShapeType == null) - throw new ArgumentNullException(nameof(shapeOrNull.ShapeType), "Property is required for class ShapeOrNull."); - writer.WriteString("shapeType", shapeOrNull.ShapeType); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index a00a87e2efa..3fa8bdc1917 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, simpleQuadrilateral, jsonSerializerOptions); + WriteProperties(writer, simpleQuadrilateral, jsonSerializerOptions); writer.WriteEndObject(); } @@ -177,7 +177,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SimpleQuadrilateral simpleQuadrilateral, JsonSerializerOptions jsonSerializerOptions) { if (simpleQuadrilateral.QuadrilateralType == null) throw new ArgumentNullException(nameof(simpleQuadrilateral.QuadrilateralType), "Property is required for class SimpleQuadrilateral."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index c91dfa5bb5f..9b44556fcb0 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, specialModelName, jsonSerializerOptions); + WriteProperties(writer, specialModelName, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, SpecialModelName specialModelName, JsonSerializerOptions jsonSerializerOptions) { if (specialModelName.VarSpecialModelNameOption.IsSet && specialModelName.VarSpecialModelName == null) throw new ArgumentNullException(nameof(specialModelName.VarSpecialModelName), "Property is required for class SpecialModelName."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs index c5651c428bd..91ee6000335 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -175,7 +175,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, tag, jsonSerializerOptions); + WriteProperties(writer, tag, jsonSerializerOptions); writer.WriteEndObject(); } @@ -186,7 +186,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Tag tag, JsonSerializerOptions jsonSerializerOptions) { if (tag.NameOption.IsSet && tag.Name == null) throw new ArgumentNullException(nameof(tag.Name), "Property is required for class Tag."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index edfc91528b7..1821b112bfb 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordList, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordList, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordList testCollectionEndingWithWordList, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordList.ValueOption.IsSet && testCollectionEndingWithWordList.Value == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList.Value), "Property is required for class TestCollectionEndingWithWordList."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 75205bb08c1..433bfa41bae 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -152,7 +152,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); + WriteProperties(writer, testCollectionEndingWithWordListObject, jsonSerializerOptions); writer.WriteEndObject(); } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestCollectionEndingWithWordListObject testCollectionEndingWithWordListObject, JsonSerializerOptions jsonSerializerOptions) { if (testCollectionEndingWithWordListObject.TestCollectionEndingWithWordListOption.IsSet && testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordListObject.TestCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs index dfa2238c88a..1cb26beb934 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestInlineFreeformAdditionalPropertiesRequest.cs @@ -151,7 +151,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); + WriteProperties(writer, testInlineFreeformAdditionalPropertiesRequest, jsonSerializerOptions); writer.WriteEndObject(); } @@ -162,7 +162,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, JsonSerializerOptions jsonSerializerOptions) { if (testInlineFreeformAdditionalPropertiesRequest.SomePropertyOption.IsSet && testInlineFreeformAdditionalPropertiesRequest.SomeProperty == null) throw new ArgumentNullException(nameof(testInlineFreeformAdditionalPropertiesRequest.SomeProperty), "Property is required for class TestInlineFreeformAdditionalPropertiesRequest."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs index 737124e080b..d31d2948c65 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Triangle.cs @@ -33,11 +33,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(EquilateralTriangle equilateralTriangle, string triangleType) + public Triangle(EquilateralTriangle equilateralTriangle) { EquilateralTriangle = equilateralTriangle; - TriangleType = triangleType; OnCreated(); } @@ -45,11 +43,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(IsoscelesTriangle isoscelesTriangle, string triangleType) + public Triangle(IsoscelesTriangle isoscelesTriangle) { IsoscelesTriangle = isoscelesTriangle; - TriangleType = triangleType; OnCreated(); } @@ -57,11 +53,9 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// - /// triangleType - public Triangle(ScaleneTriangle scaleneTriangle, string triangleType) + public Triangle(ScaleneTriangle scaleneTriangle) { ScaleneTriangle = scaleneTriangle; - TriangleType = triangleType; OnCreated(); } @@ -82,12 +76,6 @@ namespace Org.OpenAPITools.Model /// public ScaleneTriangle ScaleneTriangle { get; set; } - /// - /// Gets or Sets TriangleType - /// - [JsonPropertyName("triangleType")] - public string TriangleType { get; set; } - /// /// Gets or Sets additional properties /// @@ -102,7 +90,6 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class Triangle {\n"); - sb.Append(" TriangleType: ").Append(TriangleType).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -223,13 +210,13 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException(nameof(triangleType), "Property is not nullable for class Triangle."); if (equilateralTriangle != null) - return new Triangle(equilateralTriangle, triangleType.Value); + return new Triangle(equilateralTriangle); if (isoscelesTriangle != null) - return new Triangle(isoscelesTriangle, triangleType.Value); + return new Triangle(isoscelesTriangle); if (scaleneTriangle != null) - return new Triangle(scaleneTriangle, triangleType.Value); + return new Triangle(scaleneTriangle); throw new JsonException(); } @@ -247,20 +234,20 @@ namespace Org.OpenAPITools.Model if (triangle.EquilateralTriangle != null) { EquilateralTriangleJsonConverter equilateralTriangleJsonConverter = (EquilateralTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.EquilateralTriangle.GetType())); - equilateralTriangleJsonConverter.WriteProperties(ref writer, triangle.EquilateralTriangle, jsonSerializerOptions); + equilateralTriangleJsonConverter.WriteProperties(writer, triangle.EquilateralTriangle, jsonSerializerOptions); } if (triangle.IsoscelesTriangle != null) { IsoscelesTriangleJsonConverter isoscelesTriangleJsonConverter = (IsoscelesTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.IsoscelesTriangle.GetType())); - isoscelesTriangleJsonConverter.WriteProperties(ref writer, triangle.IsoscelesTriangle, jsonSerializerOptions); + isoscelesTriangleJsonConverter.WriteProperties(writer, triangle.IsoscelesTriangle, jsonSerializerOptions); } if (triangle.ScaleneTriangle != null) { ScaleneTriangleJsonConverter scaleneTriangleJsonConverter = (ScaleneTriangleJsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert(triangle.ScaleneTriangle.GetType())); - scaleneTriangleJsonConverter.WriteProperties(ref writer, triangle.ScaleneTriangle, jsonSerializerOptions); + scaleneTriangleJsonConverter.WriteProperties(writer, triangle.ScaleneTriangle, jsonSerializerOptions); } - WriteProperties(ref writer, triangle, jsonSerializerOptions); + WriteProperties(writer, triangle, jsonSerializerOptions); writer.WriteEndObject(); } @@ -271,12 +258,9 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Triangle triangle, JsonSerializerOptions jsonSerializerOptions) { - if (triangle.TriangleType == null) - throw new ArgumentNullException(nameof(triangle.TriangleType), "Property is required for class Triangle."); - writer.WriteString("triangleType", triangle.TriangleType); } } } diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs index 270c598de61..aa6d31b9190 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -147,7 +147,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, triangleInterface, jsonSerializerOptions); + WriteProperties(writer, triangleInterface, jsonSerializerOptions); writer.WriteEndObject(); } @@ -158,7 +158,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, TriangleInterface triangleInterface, JsonSerializerOptions jsonSerializerOptions) { if (triangleInterface.TriangleType == null) throw new ArgumentNullException(nameof(triangleInterface.TriangleType), "Property is required for class TriangleInterface."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs index 8851a6aa2ba..a2f3e4a18a6 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, user, jsonSerializerOptions); + WriteProperties(writer, user, jsonSerializerOptions); writer.WriteEndObject(); } @@ -417,7 +417,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, User user, JsonSerializerOptions jsonSerializerOptions) { if (user.EmailOption.IsSet && user.Email == null) throw new ArgumentNullException(nameof(user.Email), "Property is required for class User."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 152369134a6..b93046c5457 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -195,7 +195,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, whale, jsonSerializerOptions); + WriteProperties(writer, whale, jsonSerializerOptions); writer.WriteEndObject(); } @@ -206,7 +206,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Whale whale, JsonSerializerOptions jsonSerializerOptions) { if (whale.ClassName == null) throw new ArgumentNullException(nameof(whale.ClassName), "Property is required for class Whale."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs index 1c364c4be9e..c09d71736d1 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Zebra.cs @@ -252,7 +252,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zebra, jsonSerializerOptions); + WriteProperties(writer, zebra, jsonSerializerOptions); writer.WriteEndObject(); } @@ -263,7 +263,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, Zebra zebra, JsonSerializerOptions jsonSerializerOptions) { if (zebra.ClassName == null) throw new ArgumentNullException(nameof(zebra.ClassName), "Property is required for class Zebra."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index e7baeec052c..6e6bf0004c2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -219,7 +219,7 @@ namespace Org.OpenAPITools.Model { writer.WriteStartObject(); - WriteProperties(ref writer, zeroBasedEnumClass, jsonSerializerOptions); + WriteProperties(writer, zeroBasedEnumClass, jsonSerializerOptions); writer.WriteEndObject(); } @@ -230,7 +230,7 @@ namespace Org.OpenAPITools.Model /// /// /// - public void WriteProperties(ref Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) + public void WriteProperties(Utf8JsonWriter writer, ZeroBasedEnumClass zeroBasedEnumClass, JsonSerializerOptions jsonSerializerOptions) { var zeroBasedEnumRawValue = ZeroBasedEnumClass.ZeroBasedEnumEnumToJsonValue(zeroBasedEnumClass.ZeroBasedEnumOption.Value.Value); writer.WriteString("ZeroBasedEnum", zeroBasedEnumRawValue); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index ccda76c5ed8..f50496337d1 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/README.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/README.md index be8be98913e..41843fd3b79 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/README.md +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/README.md @@ -179,7 +179,6 @@ Authentication schemes defined for the API: - modelDocs: true - apiTests: true - modelTests: true -- withXml: ## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) - allowUnicodeIdentifiers: diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator/FILES index 3079e1bed81..1eeeb080e6f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator/FILES @@ -51,6 +51,7 @@ docs/List.md docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md +docs/MixLog.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelClient.md @@ -171,6 +172,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md index ba114ec6f59..98d0095933e 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/README.md @@ -224,6 +224,7 @@ Class | Method | HTTP request | Description - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) + - [Model.MixLog](docs/MixLog.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/MixLog.md b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/MixLog.md new file mode 100644 index 00000000000..1872e30daaa --- /dev/null +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **Guid** | | +**Description** | **string** | | +**MixDate** | **DateTime** | | +**ShopId** | **Guid** | | [optional] +**TotalPrice** | **float?** | | [optional] +**TotalRecalculations** | **int** | | +**TotalOverPoors** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**FormulaVersionDate** | **DateTime** | | +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int?** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..887be61a957 --- /dev/null +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,345 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + } +} diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..8ac07408897 --- /dev/null +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,543 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + [DataContract(Name = "MixLog")] + public partial class MixLog : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MixLog() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id (required). + /// description (required). + /// mixDate (required). + /// shopId. + /// totalPrice. + /// totalRecalculations (required). + /// totalOverPoors (required). + /// totalSkips (required). + /// totalUnderPours (required). + /// formulaVersionDate (required). + /// SomeCode is only required for color mixes. + /// batchNumber. + /// BrandCode is only required for non-color mixes. + /// BrandId is only required for color mixes. + /// BrandName is only required for color mixes. + /// CategoryCode is not used anymore. + /// Color is only required for color mixes. + /// colorDescription. + /// comment. + /// commercialProductCode. + /// ProductLineCode is only required for color mixes. + /// country. + /// createdBy. + /// createdByFirstName. + /// createdByLastName. + /// deltaECalculationRepaired. + /// deltaECalculationSprayout. + /// ownColorVariantNumber. + /// primerProductId. + /// ProductId is only required for color mixes. + /// ProductName is only required for color mixes. + /// selectedVersionIndex. + public MixLog(Guid id = default(Guid), string description = default(string), DateTime mixDate = default(DateTime), Guid shopId = default(Guid), float? totalPrice = default(float?), int totalRecalculations = default(int), int totalOverPoors = default(int), int totalSkips = default(int), int totalUnderPours = default(int), DateTime formulaVersionDate = default(DateTime), string someCode = default(string), string batchNumber = default(string), string brandCode = default(string), string brandId = default(string), string brandName = default(string), string categoryCode = default(string), string color = default(string), string colorDescription = default(string), string comment = default(string), string commercialProductCode = default(string), string productLineCode = default(string), string country = default(string), string createdBy = default(string), string createdByFirstName = default(string), string createdByLastName = default(string), string deltaECalculationRepaired = default(string), string deltaECalculationSprayout = default(string), int? ownColorVariantNumber = default(int?), string primerProductId = default(string), string productId = default(string), string productName = default(string), int selectedVersionIndex = default(int)) + { + this.Id = id; + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for MixLog and cannot be null"); + } + this.Description = description; + this.MixDate = mixDate; + this.TotalRecalculations = totalRecalculations; + this.TotalOverPoors = totalOverPoors; + this.TotalSkips = totalSkips; + this.TotalUnderPours = totalUnderPours; + this.FormulaVersionDate = formulaVersionDate; + this.ShopId = shopId; + this.TotalPrice = totalPrice; + this.SomeCode = someCode; + this.BatchNumber = batchNumber; + this.BrandCode = brandCode; + this.BrandId = brandId; + this.BrandName = brandName; + this.CategoryCode = categoryCode; + this.Color = color; + this.ColorDescription = colorDescription; + this.Comment = comment; + this.CommercialProductCode = commercialProductCode; + this.ProductLineCode = productLineCode; + this.Country = country; + this.CreatedBy = createdBy; + this.CreatedByFirstName = createdByFirstName; + this.CreatedByLastName = createdByLastName; + this.DeltaECalculationRepaired = deltaECalculationRepaired; + this.DeltaECalculationSprayout = deltaECalculationSprayout; + this.OwnColorVariantNumber = ownColorVariantNumber; + this.PrimerProductId = primerProductId; + this.ProductId = productId; + this.ProductName = productName; + this.SelectedVersionIndex = selectedVersionIndex; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public Guid Id { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets MixDate + /// + [DataMember(Name = "mixDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets ShopId + /// + [DataMember(Name = "shopId", EmitDefaultValue = false)] + public Guid ShopId { get; set; } + + /// + /// Gets or Sets TotalPrice + /// + [DataMember(Name = "totalPrice", EmitDefaultValue = true)] + public float? TotalPrice { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [DataMember(Name = "totalRecalculations", IsRequired = true, EmitDefaultValue = true)] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [DataMember(Name = "totalOverPoors", IsRequired = true, EmitDefaultValue = true)] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [DataMember(Name = "totalSkips", IsRequired = true, EmitDefaultValue = true)] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [DataMember(Name = "totalUnderPours", IsRequired = true, EmitDefaultValue = true)] + public int TotalUnderPours { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [DataMember(Name = "formulaVersionDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime FormulaVersionDate { get; set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [DataMember(Name = "someCode", EmitDefaultValue = true)] + public string SomeCode { get; set; } + + /// + /// Gets or Sets BatchNumber + /// + [DataMember(Name = "batchNumber", EmitDefaultValue = false)] + public string BatchNumber { get; set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [DataMember(Name = "brandCode", EmitDefaultValue = false)] + public string BrandCode { get; set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId { get; set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [DataMember(Name = "brandName", EmitDefaultValue = false)] + public string BrandName { get; set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [DataMember(Name = "categoryCode", EmitDefaultValue = false)] + public string CategoryCode { get; set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets ColorDescription + /// + [DataMember(Name = "colorDescription", EmitDefaultValue = false)] + public string ColorDescription { get; set; } + + /// + /// Gets or Sets Comment + /// + [DataMember(Name = "comment", EmitDefaultValue = false)] + public string Comment { get; set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [DataMember(Name = "commercialProductCode", EmitDefaultValue = false)] + public string CommercialProductCode { get; set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [DataMember(Name = "productLineCode", EmitDefaultValue = false)] + public string ProductLineCode { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country { get; set; } + + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy { get; set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [DataMember(Name = "createdByFirstName", EmitDefaultValue = false)] + public string CreatedByFirstName { get; set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [DataMember(Name = "createdByLastName", EmitDefaultValue = false)] + public string CreatedByLastName { get; set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [DataMember(Name = "deltaECalculationRepaired", EmitDefaultValue = false)] + public string DeltaECalculationRepaired { get; set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [DataMember(Name = "deltaECalculationSprayout", EmitDefaultValue = false)] + public string DeltaECalculationSprayout { get; set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [DataMember(Name = "ownColorVariantNumber", EmitDefaultValue = true)] + public int? OwnColorVariantNumber { get; set; } + + /// + /// Gets or Sets PrimerProductId + /// + [DataMember(Name = "primerProductId", EmitDefaultValue = false)] + public string PrimerProductId { get; set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [DataMember(Name = "productId", EmitDefaultValue = false)] + public string ProductId { get; set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [DataMember(Name = "productName", EmitDefaultValue = false)] + public string ProductName { get; set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [DataMember(Name = "selectedVersionIndex", EmitDefaultValue = false)] + public int SelectedVersionIndex { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixLog).AreEqual; + } + + /// + /// Returns true if MixLog instances are equal + /// + /// Instance of MixLog to be compared + /// Boolean + public bool Equals(MixLog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.MixDate != null) + { + hashCode = (hashCode * 59) + this.MixDate.GetHashCode(); + } + if (this.ShopId != null) + { + hashCode = (hashCode * 59) + this.ShopId.GetHashCode(); + } + if (this.TotalPrice != null) + { + hashCode = (hashCode * 59) + this.TotalPrice.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TotalRecalculations.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalOverPoors.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalSkips.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalUnderPours.GetHashCode(); + if (this.FormulaVersionDate != null) + { + hashCode = (hashCode * 59) + this.FormulaVersionDate.GetHashCode(); + } + if (this.SomeCode != null) + { + hashCode = (hashCode * 59) + this.SomeCode.GetHashCode(); + } + if (this.BatchNumber != null) + { + hashCode = (hashCode * 59) + this.BatchNumber.GetHashCode(); + } + if (this.BrandCode != null) + { + hashCode = (hashCode * 59) + this.BrandCode.GetHashCode(); + } + if (this.BrandId != null) + { + hashCode = (hashCode * 59) + this.BrandId.GetHashCode(); + } + if (this.BrandName != null) + { + hashCode = (hashCode * 59) + this.BrandName.GetHashCode(); + } + if (this.CategoryCode != null) + { + hashCode = (hashCode * 59) + this.CategoryCode.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.ColorDescription != null) + { + hashCode = (hashCode * 59) + this.ColorDescription.GetHashCode(); + } + if (this.Comment != null) + { + hashCode = (hashCode * 59) + this.Comment.GetHashCode(); + } + if (this.CommercialProductCode != null) + { + hashCode = (hashCode * 59) + this.CommercialProductCode.GetHashCode(); + } + if (this.ProductLineCode != null) + { + hashCode = (hashCode * 59) + this.ProductLineCode.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.CreatedBy != null) + { + hashCode = (hashCode * 59) + this.CreatedBy.GetHashCode(); + } + if (this.CreatedByFirstName != null) + { + hashCode = (hashCode * 59) + this.CreatedByFirstName.GetHashCode(); + } + if (this.CreatedByLastName != null) + { + hashCode = (hashCode * 59) + this.CreatedByLastName.GetHashCode(); + } + if (this.DeltaECalculationRepaired != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationRepaired.GetHashCode(); + } + if (this.DeltaECalculationSprayout != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationSprayout.GetHashCode(); + } + if (this.OwnColorVariantNumber != null) + { + hashCode = (hashCode * 59) + this.OwnColorVariantNumber.GetHashCode(); + } + if (this.PrimerProductId != null) + { + hashCode = (hashCode * 59) + this.PrimerProductId.GetHashCode(); + } + if (this.ProductId != null) + { + hashCode = (hashCode * 59) + this.ProductId.GetHashCode(); + } + if (this.ProductName != null) + { + hashCode = (hashCode * 59) + this.ProductName.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SelectedVersionIndex.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 96f73638696..29cc7e0a716 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 6655a24203a..3fd2f0ed719 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml index 673de491c71..6cfc875b074 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index c1e8a6a006a..29606505b22 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml index 673de491c71..6cfc875b074 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index b22f6a7d289..942acffc239 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj index addc6411ef6..51c96d7c8ea 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update annotations + false diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml index 673de491c71..6cfc875b074 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 0685800345a..51fbdfa548b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 96162ec5341..b380debad30 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update annotations + false diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES index 0af518f942a..e918fe15600 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/.openapi-generator/FILES @@ -51,6 +51,7 @@ docs/List.md docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md +docs/MixLog.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelClient.md @@ -173,6 +174,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md b/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md index e6d7ac9fd98..9d4fea5304c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/README.md @@ -211,6 +211,7 @@ Class | Method | HTTP request | Description - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) + - [Model.MixLog](docs/MixLog.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/MixLog.md b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/MixLog.md new file mode 100644 index 00000000000..1872e30daaa --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **Guid** | | +**Description** | **string** | | +**MixDate** | **DateTime** | | +**ShopId** | **Guid** | | [optional] +**TotalPrice** | **float?** | | [optional] +**TotalRecalculations** | **int** | | +**TotalOverPoors** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**FormulaVersionDate** | **DateTime** | | +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int?** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..887be61a957 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,345 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 0685800345a..51fbdfa548b 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..3a847cecd05 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,527 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + [DataContract(Name = "MixLog")] + public partial class MixLog : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MixLog() { } + /// + /// Initializes a new instance of the class. + /// + /// id (required). + /// description (required). + /// mixDate (required). + /// shopId. + /// totalPrice. + /// totalRecalculations (required). + /// totalOverPoors (required). + /// totalSkips (required). + /// totalUnderPours (required). + /// formulaVersionDate (required). + /// SomeCode is only required for color mixes. + /// batchNumber. + /// BrandCode is only required for non-color mixes. + /// BrandId is only required for color mixes. + /// BrandName is only required for color mixes. + /// CategoryCode is not used anymore. + /// Color is only required for color mixes. + /// colorDescription. + /// comment. + /// commercialProductCode. + /// ProductLineCode is only required for color mixes. + /// country. + /// createdBy. + /// createdByFirstName. + /// createdByLastName. + /// deltaECalculationRepaired. + /// deltaECalculationSprayout. + /// ownColorVariantNumber. + /// primerProductId. + /// ProductId is only required for color mixes. + /// ProductName is only required for color mixes. + /// selectedVersionIndex. + public MixLog(Guid id = default(Guid), string description = default(string), DateTime mixDate = default(DateTime), Guid shopId = default(Guid), float? totalPrice = default(float?), int totalRecalculations = default(int), int totalOverPoors = default(int), int totalSkips = default(int), int totalUnderPours = default(int), DateTime formulaVersionDate = default(DateTime), string someCode = default(string), string batchNumber = default(string), string brandCode = default(string), string brandId = default(string), string brandName = default(string), string categoryCode = default(string), string color = default(string), string colorDescription = default(string), string comment = default(string), string commercialProductCode = default(string), string productLineCode = default(string), string country = default(string), string createdBy = default(string), string createdByFirstName = default(string), string createdByLastName = default(string), string deltaECalculationRepaired = default(string), string deltaECalculationSprayout = default(string), int? ownColorVariantNumber = default(int?), string primerProductId = default(string), string productId = default(string), string productName = default(string), int selectedVersionIndex = default(int)) + { + this.Id = id; + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for MixLog and cannot be null"); + } + this.Description = description; + this.MixDate = mixDate; + this.TotalRecalculations = totalRecalculations; + this.TotalOverPoors = totalOverPoors; + this.TotalSkips = totalSkips; + this.TotalUnderPours = totalUnderPours; + this.FormulaVersionDate = formulaVersionDate; + this.ShopId = shopId; + this.TotalPrice = totalPrice; + this.SomeCode = someCode; + this.BatchNumber = batchNumber; + this.BrandCode = brandCode; + this.BrandId = brandId; + this.BrandName = brandName; + this.CategoryCode = categoryCode; + this.Color = color; + this.ColorDescription = colorDescription; + this.Comment = comment; + this.CommercialProductCode = commercialProductCode; + this.ProductLineCode = productLineCode; + this.Country = country; + this.CreatedBy = createdBy; + this.CreatedByFirstName = createdByFirstName; + this.CreatedByLastName = createdByLastName; + this.DeltaECalculationRepaired = deltaECalculationRepaired; + this.DeltaECalculationSprayout = deltaECalculationSprayout; + this.OwnColorVariantNumber = ownColorVariantNumber; + this.PrimerProductId = primerProductId; + this.ProductId = productId; + this.ProductName = productName; + this.SelectedVersionIndex = selectedVersionIndex; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public Guid Id { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets MixDate + /// + [DataMember(Name = "mixDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets ShopId + /// + [DataMember(Name = "shopId", EmitDefaultValue = false)] + public Guid ShopId { get; set; } + + /// + /// Gets or Sets TotalPrice + /// + [DataMember(Name = "totalPrice", EmitDefaultValue = true)] + public float? TotalPrice { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [DataMember(Name = "totalRecalculations", IsRequired = true, EmitDefaultValue = true)] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [DataMember(Name = "totalOverPoors", IsRequired = true, EmitDefaultValue = true)] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [DataMember(Name = "totalSkips", IsRequired = true, EmitDefaultValue = true)] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [DataMember(Name = "totalUnderPours", IsRequired = true, EmitDefaultValue = true)] + public int TotalUnderPours { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [DataMember(Name = "formulaVersionDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime FormulaVersionDate { get; set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [DataMember(Name = "someCode", EmitDefaultValue = true)] + public string SomeCode { get; set; } + + /// + /// Gets or Sets BatchNumber + /// + [DataMember(Name = "batchNumber", EmitDefaultValue = false)] + public string BatchNumber { get; set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [DataMember(Name = "brandCode", EmitDefaultValue = false)] + public string BrandCode { get; set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId { get; set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [DataMember(Name = "brandName", EmitDefaultValue = false)] + public string BrandName { get; set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [DataMember(Name = "categoryCode", EmitDefaultValue = false)] + public string CategoryCode { get; set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets ColorDescription + /// + [DataMember(Name = "colorDescription", EmitDefaultValue = false)] + public string ColorDescription { get; set; } + + /// + /// Gets or Sets Comment + /// + [DataMember(Name = "comment", EmitDefaultValue = false)] + public string Comment { get; set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [DataMember(Name = "commercialProductCode", EmitDefaultValue = false)] + public string CommercialProductCode { get; set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [DataMember(Name = "productLineCode", EmitDefaultValue = false)] + public string ProductLineCode { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country { get; set; } + + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy { get; set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [DataMember(Name = "createdByFirstName", EmitDefaultValue = false)] + public string CreatedByFirstName { get; set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [DataMember(Name = "createdByLastName", EmitDefaultValue = false)] + public string CreatedByLastName { get; set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [DataMember(Name = "deltaECalculationRepaired", EmitDefaultValue = false)] + public string DeltaECalculationRepaired { get; set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [DataMember(Name = "deltaECalculationSprayout", EmitDefaultValue = false)] + public string DeltaECalculationSprayout { get; set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [DataMember(Name = "ownColorVariantNumber", EmitDefaultValue = true)] + public int? OwnColorVariantNumber { get; set; } + + /// + /// Gets or Sets PrimerProductId + /// + [DataMember(Name = "primerProductId", EmitDefaultValue = false)] + public string PrimerProductId { get; set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [DataMember(Name = "productId", EmitDefaultValue = false)] + public string ProductId { get; set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [DataMember(Name = "productName", EmitDefaultValue = false)] + public string ProductName { get; set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [DataMember(Name = "selectedVersionIndex", EmitDefaultValue = false)] + public int SelectedVersionIndex { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixLog).AreEqual; + } + + /// + /// Returns true if MixLog instances are equal + /// + /// Instance of MixLog to be compared + /// Boolean + public bool Equals(MixLog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.MixDate != null) + { + hashCode = (hashCode * 59) + this.MixDate.GetHashCode(); + } + if (this.ShopId != null) + { + hashCode = (hashCode * 59) + this.ShopId.GetHashCode(); + } + if (this.TotalPrice != null) + { + hashCode = (hashCode * 59) + this.TotalPrice.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TotalRecalculations.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalOverPoors.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalSkips.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalUnderPours.GetHashCode(); + if (this.FormulaVersionDate != null) + { + hashCode = (hashCode * 59) + this.FormulaVersionDate.GetHashCode(); + } + if (this.SomeCode != null) + { + hashCode = (hashCode * 59) + this.SomeCode.GetHashCode(); + } + if (this.BatchNumber != null) + { + hashCode = (hashCode * 59) + this.BatchNumber.GetHashCode(); + } + if (this.BrandCode != null) + { + hashCode = (hashCode * 59) + this.BrandCode.GetHashCode(); + } + if (this.BrandId != null) + { + hashCode = (hashCode * 59) + this.BrandId.GetHashCode(); + } + if (this.BrandName != null) + { + hashCode = (hashCode * 59) + this.BrandName.GetHashCode(); + } + if (this.CategoryCode != null) + { + hashCode = (hashCode * 59) + this.CategoryCode.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.ColorDescription != null) + { + hashCode = (hashCode * 59) + this.ColorDescription.GetHashCode(); + } + if (this.Comment != null) + { + hashCode = (hashCode * 59) + this.Comment.GetHashCode(); + } + if (this.CommercialProductCode != null) + { + hashCode = (hashCode * 59) + this.CommercialProductCode.GetHashCode(); + } + if (this.ProductLineCode != null) + { + hashCode = (hashCode * 59) + this.ProductLineCode.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.CreatedBy != null) + { + hashCode = (hashCode * 59) + this.CreatedBy.GetHashCode(); + } + if (this.CreatedByFirstName != null) + { + hashCode = (hashCode * 59) + this.CreatedByFirstName.GetHashCode(); + } + if (this.CreatedByLastName != null) + { + hashCode = (hashCode * 59) + this.CreatedByLastName.GetHashCode(); + } + if (this.DeltaECalculationRepaired != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationRepaired.GetHashCode(); + } + if (this.DeltaECalculationSprayout != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationSprayout.GetHashCode(); + } + if (this.OwnColorVariantNumber != null) + { + hashCode = (hashCode * 59) + this.OwnColorVariantNumber.GetHashCode(); + } + if (this.PrimerProductId != null) + { + hashCode = (hashCode * 59) + this.PrimerProductId.GetHashCode(); + } + if (this.ProductId != null) + { + hashCode = (hashCode * 59) + this.ProductId.GetHashCode(); + } + if (this.ProductName != null) + { + hashCode = (hashCode * 59) + this.ProductName.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SelectedVersionIndex.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 96162ec5341..b380debad30 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update annotations + false diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 721eade2ad1..ca1bceca626 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,6 +18,7 @@ git Minor update annotations + false diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/.openapi-generator/FILES b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/.openapi-generator/FILES index 1e54de3472d..afe863b77d7 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/.openapi-generator/FILES @@ -51,6 +51,7 @@ docs/List.md docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md +docs/MixLog.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelClient.md @@ -174,6 +175,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md index 549f51ae333..54bd7223abf 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/README.md @@ -199,6 +199,7 @@ Class | Method | HTTP request | Description - [Model.LiteralStringClass](docs/LiteralStringClass.md) - [Model.Mammal](docs/Mammal.md) - [Model.MapTest](docs/MapTest.md) + - [Model.MixLog](docs/MixLog.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](docs/Model200Response.md) - [Model.ModelClient](docs/ModelClient.md) diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixLog.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixLog.md new file mode 100644 index 00000000000..1872e30daaa --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **Guid** | | +**Description** | **string** | | +**MixDate** | **DateTime** | | +**ShopId** | **Guid** | | [optional] +**TotalPrice** | **float?** | | [optional] +**TotalRecalculations** | **int** | | +**TotalOverPoors** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**FormulaVersionDate** | **DateTime** | | +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int?** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..887be61a957 --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,345 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Fact] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Fact] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + + /// + /// Test the property 'Description' + /// + [Fact] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + + /// + /// Test the property 'MixDate' + /// + [Fact] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + + /// + /// Test the property 'ShopId' + /// + [Fact] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + + /// + /// Test the property 'TotalPrice' + /// + [Fact] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + + /// + /// Test the property 'TotalRecalculations' + /// + [Fact] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + + /// + /// Test the property 'TotalOverPoors' + /// + [Fact] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + + /// + /// Test the property 'TotalSkips' + /// + [Fact] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + + /// + /// Test the property 'TotalUnderPours' + /// + [Fact] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + + /// + /// Test the property 'FormulaVersionDate' + /// + [Fact] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + + /// + /// Test the property 'SomeCode' + /// + [Fact] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + + /// + /// Test the property 'BatchNumber' + /// + [Fact] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + + /// + /// Test the property 'BrandCode' + /// + [Fact] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + + /// + /// Test the property 'BrandId' + /// + [Fact] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + + /// + /// Test the property 'BrandName' + /// + [Fact] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + + /// + /// Test the property 'CategoryCode' + /// + [Fact] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + + /// + /// Test the property 'Color' + /// + [Fact] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + + /// + /// Test the property 'ColorDescription' + /// + [Fact] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + + /// + /// Test the property 'Comment' + /// + [Fact] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + + /// + /// Test the property 'CommercialProductCode' + /// + [Fact] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + + /// + /// Test the property 'ProductLineCode' + /// + [Fact] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + + /// + /// Test the property 'Country' + /// + [Fact] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + + /// + /// Test the property 'CreatedBy' + /// + [Fact] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + + /// + /// Test the property 'CreatedByFirstName' + /// + [Fact] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + + /// + /// Test the property 'CreatedByLastName' + /// + [Fact] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Fact] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Fact] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Fact] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + + /// + /// Test the property 'PrimerProductId' + /// + [Fact] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + + /// + /// Test the property 'ProductId' + /// + [Fact] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + + /// + /// Test the property 'ProductName' + /// + [Fact] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + + /// + /// Test the property 'SelectedVersionIndex' + /// + [Fact] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + } +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..3fa1c7d095b --- /dev/null +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,1214 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + [DataContract(Name = "MixLog")] + public partial class MixLog : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MixLog() + { + this.AdditionalProperties = new Dictionary(); + } + /// + /// Initializes a new instance of the class. + /// + /// id (required). + /// description (required). + /// mixDate (required). + /// shopId. + /// totalPrice. + /// totalRecalculations (required). + /// totalOverPoors (required). + /// totalSkips (required). + /// totalUnderPours (required). + /// formulaVersionDate (required). + /// SomeCode is only required for color mixes. + /// batchNumber. + /// BrandCode is only required for non-color mixes. + /// BrandId is only required for color mixes. + /// BrandName is only required for color mixes. + /// CategoryCode is not used anymore. + /// Color is only required for color mixes. + /// colorDescription. + /// comment. + /// commercialProductCode. + /// ProductLineCode is only required for color mixes. + /// country. + /// createdBy. + /// createdByFirstName. + /// createdByLastName. + /// deltaECalculationRepaired. + /// deltaECalculationSprayout. + /// ownColorVariantNumber. + /// primerProductId. + /// ProductId is only required for color mixes. + /// ProductName is only required for color mixes. + /// selectedVersionIndex. + public MixLog(Guid id = default(Guid), string description = default(string), DateTime mixDate = default(DateTime), Guid shopId = default(Guid), float? totalPrice = default(float?), int totalRecalculations = default(int), int totalOverPoors = default(int), int totalSkips = default(int), int totalUnderPours = default(int), DateTime formulaVersionDate = default(DateTime), string someCode = default(string), string batchNumber = default(string), string brandCode = default(string), string brandId = default(string), string brandName = default(string), string categoryCode = default(string), string color = default(string), string colorDescription = default(string), string comment = default(string), string commercialProductCode = default(string), string productLineCode = default(string), string country = default(string), string createdBy = default(string), string createdByFirstName = default(string), string createdByLastName = default(string), string deltaECalculationRepaired = default(string), string deltaECalculationSprayout = default(string), int? ownColorVariantNumber = default(int?), string primerProductId = default(string), string productId = default(string), string productName = default(string), int selectedVersionIndex = default(int)) + { + this._Id = id; + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for MixLog and cannot be null"); + } + this._Description = description; + this._MixDate = mixDate; + this._TotalRecalculations = totalRecalculations; + this._TotalOverPoors = totalOverPoors; + this._TotalSkips = totalSkips; + this._TotalUnderPours = totalUnderPours; + this._FormulaVersionDate = formulaVersionDate; + this._ShopId = shopId; + if (this.ShopId != null) + { + this._flagShopId = true; + } + this._TotalPrice = totalPrice; + if (this.TotalPrice != null) + { + this._flagTotalPrice = true; + } + this._SomeCode = someCode; + if (this.SomeCode != null) + { + this._flagSomeCode = true; + } + this._BatchNumber = batchNumber; + if (this.BatchNumber != null) + { + this._flagBatchNumber = true; + } + this._BrandCode = brandCode; + if (this.BrandCode != null) + { + this._flagBrandCode = true; + } + this._BrandId = brandId; + if (this.BrandId != null) + { + this._flagBrandId = true; + } + this._BrandName = brandName; + if (this.BrandName != null) + { + this._flagBrandName = true; + } + this._CategoryCode = categoryCode; + if (this.CategoryCode != null) + { + this._flagCategoryCode = true; + } + this._Color = color; + if (this.Color != null) + { + this._flagColor = true; + } + this._ColorDescription = colorDescription; + if (this.ColorDescription != null) + { + this._flagColorDescription = true; + } + this._Comment = comment; + if (this.Comment != null) + { + this._flagComment = true; + } + this._CommercialProductCode = commercialProductCode; + if (this.CommercialProductCode != null) + { + this._flagCommercialProductCode = true; + } + this._ProductLineCode = productLineCode; + if (this.ProductLineCode != null) + { + this._flagProductLineCode = true; + } + this._Country = country; + if (this.Country != null) + { + this._flagCountry = true; + } + this._CreatedBy = createdBy; + if (this.CreatedBy != null) + { + this._flagCreatedBy = true; + } + this._CreatedByFirstName = createdByFirstName; + if (this.CreatedByFirstName != null) + { + this._flagCreatedByFirstName = true; + } + this._CreatedByLastName = createdByLastName; + if (this.CreatedByLastName != null) + { + this._flagCreatedByLastName = true; + } + this._DeltaECalculationRepaired = deltaECalculationRepaired; + if (this.DeltaECalculationRepaired != null) + { + this._flagDeltaECalculationRepaired = true; + } + this._DeltaECalculationSprayout = deltaECalculationSprayout; + if (this.DeltaECalculationSprayout != null) + { + this._flagDeltaECalculationSprayout = true; + } + this._OwnColorVariantNumber = ownColorVariantNumber; + if (this.OwnColorVariantNumber != null) + { + this._flagOwnColorVariantNumber = true; + } + this._PrimerProductId = primerProductId; + if (this.PrimerProductId != null) + { + this._flagPrimerProductId = true; + } + this._ProductId = productId; + if (this.ProductId != null) + { + this._flagProductId = true; + } + this._ProductName = productName; + if (this.ProductName != null) + { + this._flagProductName = true; + } + this._SelectedVersionIndex = selectedVersionIndex; + if (this.SelectedVersionIndex != null) + { + this._flagSelectedVersionIndex = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public Guid Id + { + get{ return _Id;} + set + { + _Id = value; + _flagId = true; + } + } + private Guid _Id; + private bool _flagId; + + /// + /// Returns false as Id should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeId() + { + return _flagId; + } + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description + { + get{ return _Description;} + set + { + _Description = value; + _flagDescription = true; + } + } + private string _Description; + private bool _flagDescription; + + /// + /// Returns false as Description should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeDescription() + { + return _flagDescription; + } + /// + /// Gets or Sets MixDate + /// + [DataMember(Name = "mixDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime MixDate + { + get{ return _MixDate;} + set + { + _MixDate = value; + _flagMixDate = true; + } + } + private DateTime _MixDate; + private bool _flagMixDate; + + /// + /// Returns false as MixDate should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeMixDate() + { + return _flagMixDate; + } + /// + /// Gets or Sets ShopId + /// + [DataMember(Name = "shopId", EmitDefaultValue = false)] + public Guid ShopId + { + get{ return _ShopId;} + set + { + _ShopId = value; + _flagShopId = true; + } + } + private Guid _ShopId; + private bool _flagShopId; + + /// + /// Returns false as ShopId should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeShopId() + { + return _flagShopId; + } + /// + /// Gets or Sets TotalPrice + /// + [DataMember(Name = "totalPrice", EmitDefaultValue = true)] + public float? TotalPrice + { + get{ return _TotalPrice;} + set + { + _TotalPrice = value; + _flagTotalPrice = true; + } + } + private float? _TotalPrice; + private bool _flagTotalPrice; + + /// + /// Returns false as TotalPrice should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTotalPrice() + { + return _flagTotalPrice; + } + /// + /// Gets or Sets TotalRecalculations + /// + [DataMember(Name = "totalRecalculations", IsRequired = true, EmitDefaultValue = true)] + public int TotalRecalculations + { + get{ return _TotalRecalculations;} + set + { + _TotalRecalculations = value; + _flagTotalRecalculations = true; + } + } + private int _TotalRecalculations; + private bool _flagTotalRecalculations; + + /// + /// Returns false as TotalRecalculations should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTotalRecalculations() + { + return _flagTotalRecalculations; + } + /// + /// Gets or Sets TotalOverPoors + /// + [DataMember(Name = "totalOverPoors", IsRequired = true, EmitDefaultValue = true)] + public int TotalOverPoors + { + get{ return _TotalOverPoors;} + set + { + _TotalOverPoors = value; + _flagTotalOverPoors = true; + } + } + private int _TotalOverPoors; + private bool _flagTotalOverPoors; + + /// + /// Returns false as TotalOverPoors should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTotalOverPoors() + { + return _flagTotalOverPoors; + } + /// + /// Gets or Sets TotalSkips + /// + [DataMember(Name = "totalSkips", IsRequired = true, EmitDefaultValue = true)] + public int TotalSkips + { + get{ return _TotalSkips;} + set + { + _TotalSkips = value; + _flagTotalSkips = true; + } + } + private int _TotalSkips; + private bool _flagTotalSkips; + + /// + /// Returns false as TotalSkips should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTotalSkips() + { + return _flagTotalSkips; + } + /// + /// Gets or Sets TotalUnderPours + /// + [DataMember(Name = "totalUnderPours", IsRequired = true, EmitDefaultValue = true)] + public int TotalUnderPours + { + get{ return _TotalUnderPours;} + set + { + _TotalUnderPours = value; + _flagTotalUnderPours = true; + } + } + private int _TotalUnderPours; + private bool _flagTotalUnderPours; + + /// + /// Returns false as TotalUnderPours should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeTotalUnderPours() + { + return _flagTotalUnderPours; + } + /// + /// Gets or Sets FormulaVersionDate + /// + [DataMember(Name = "formulaVersionDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime FormulaVersionDate + { + get{ return _FormulaVersionDate;} + set + { + _FormulaVersionDate = value; + _flagFormulaVersionDate = true; + } + } + private DateTime _FormulaVersionDate; + private bool _flagFormulaVersionDate; + + /// + /// Returns false as FormulaVersionDate should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeFormulaVersionDate() + { + return _flagFormulaVersionDate; + } + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [DataMember(Name = "someCode", EmitDefaultValue = true)] + public string SomeCode + { + get{ return _SomeCode;} + set + { + _SomeCode = value; + _flagSomeCode = true; + } + } + private string _SomeCode; + private bool _flagSomeCode; + + /// + /// Returns false as SomeCode should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSomeCode() + { + return _flagSomeCode; + } + /// + /// Gets or Sets BatchNumber + /// + [DataMember(Name = "batchNumber", EmitDefaultValue = false)] + public string BatchNumber + { + get{ return _BatchNumber;} + set + { + _BatchNumber = value; + _flagBatchNumber = true; + } + } + private string _BatchNumber; + private bool _flagBatchNumber; + + /// + /// Returns false as BatchNumber should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBatchNumber() + { + return _flagBatchNumber; + } + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [DataMember(Name = "brandCode", EmitDefaultValue = false)] + public string BrandCode + { + get{ return _BrandCode;} + set + { + _BrandCode = value; + _flagBrandCode = true; + } + } + private string _BrandCode; + private bool _flagBrandCode; + + /// + /// Returns false as BrandCode should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBrandCode() + { + return _flagBrandCode; + } + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId + { + get{ return _BrandId;} + set + { + _BrandId = value; + _flagBrandId = true; + } + } + private string _BrandId; + private bool _flagBrandId; + + /// + /// Returns false as BrandId should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBrandId() + { + return _flagBrandId; + } + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [DataMember(Name = "brandName", EmitDefaultValue = false)] + public string BrandName + { + get{ return _BrandName;} + set + { + _BrandName = value; + _flagBrandName = true; + } + } + private string _BrandName; + private bool _flagBrandName; + + /// + /// Returns false as BrandName should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeBrandName() + { + return _flagBrandName; + } + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [DataMember(Name = "categoryCode", EmitDefaultValue = false)] + public string CategoryCode + { + get{ return _CategoryCode;} + set + { + _CategoryCode = value; + _flagCategoryCode = true; + } + } + private string _CategoryCode; + private bool _flagCategoryCode; + + /// + /// Returns false as CategoryCode should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCategoryCode() + { + return _flagCategoryCode; + } + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color + { + get{ return _Color;} + set + { + _Color = value; + _flagColor = true; + } + } + private string _Color; + private bool _flagColor; + + /// + /// Returns false as Color should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeColor() + { + return _flagColor; + } + /// + /// Gets or Sets ColorDescription + /// + [DataMember(Name = "colorDescription", EmitDefaultValue = false)] + public string ColorDescription + { + get{ return _ColorDescription;} + set + { + _ColorDescription = value; + _flagColorDescription = true; + } + } + private string _ColorDescription; + private bool _flagColorDescription; + + /// + /// Returns false as ColorDescription should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeColorDescription() + { + return _flagColorDescription; + } + /// + /// Gets or Sets Comment + /// + [DataMember(Name = "comment", EmitDefaultValue = false)] + public string Comment + { + get{ return _Comment;} + set + { + _Comment = value; + _flagComment = true; + } + } + private string _Comment; + private bool _flagComment; + + /// + /// Returns false as Comment should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeComment() + { + return _flagComment; + } + /// + /// Gets or Sets CommercialProductCode + /// + [DataMember(Name = "commercialProductCode", EmitDefaultValue = false)] + public string CommercialProductCode + { + get{ return _CommercialProductCode;} + set + { + _CommercialProductCode = value; + _flagCommercialProductCode = true; + } + } + private string _CommercialProductCode; + private bool _flagCommercialProductCode; + + /// + /// Returns false as CommercialProductCode should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCommercialProductCode() + { + return _flagCommercialProductCode; + } + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [DataMember(Name = "productLineCode", EmitDefaultValue = false)] + public string ProductLineCode + { + get{ return _ProductLineCode;} + set + { + _ProductLineCode = value; + _flagProductLineCode = true; + } + } + private string _ProductLineCode; + private bool _flagProductLineCode; + + /// + /// Returns false as ProductLineCode should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeProductLineCode() + { + return _flagProductLineCode; + } + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country + { + get{ return _Country;} + set + { + _Country = value; + _flagCountry = true; + } + } + private string _Country; + private bool _flagCountry; + + /// + /// Returns false as Country should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCountry() + { + return _flagCountry; + } + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy + { + get{ return _CreatedBy;} + set + { + _CreatedBy = value; + _flagCreatedBy = true; + } + } + private string _CreatedBy; + private bool _flagCreatedBy; + + /// + /// Returns false as CreatedBy should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCreatedBy() + { + return _flagCreatedBy; + } + /// + /// Gets or Sets CreatedByFirstName + /// + [DataMember(Name = "createdByFirstName", EmitDefaultValue = false)] + public string CreatedByFirstName + { + get{ return _CreatedByFirstName;} + set + { + _CreatedByFirstName = value; + _flagCreatedByFirstName = true; + } + } + private string _CreatedByFirstName; + private bool _flagCreatedByFirstName; + + /// + /// Returns false as CreatedByFirstName should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCreatedByFirstName() + { + return _flagCreatedByFirstName; + } + /// + /// Gets or Sets CreatedByLastName + /// + [DataMember(Name = "createdByLastName", EmitDefaultValue = false)] + public string CreatedByLastName + { + get{ return _CreatedByLastName;} + set + { + _CreatedByLastName = value; + _flagCreatedByLastName = true; + } + } + private string _CreatedByLastName; + private bool _flagCreatedByLastName; + + /// + /// Returns false as CreatedByLastName should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeCreatedByLastName() + { + return _flagCreatedByLastName; + } + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [DataMember(Name = "deltaECalculationRepaired", EmitDefaultValue = false)] + public string DeltaECalculationRepaired + { + get{ return _DeltaECalculationRepaired;} + set + { + _DeltaECalculationRepaired = value; + _flagDeltaECalculationRepaired = true; + } + } + private string _DeltaECalculationRepaired; + private bool _flagDeltaECalculationRepaired; + + /// + /// Returns false as DeltaECalculationRepaired should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeDeltaECalculationRepaired() + { + return _flagDeltaECalculationRepaired; + } + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [DataMember(Name = "deltaECalculationSprayout", EmitDefaultValue = false)] + public string DeltaECalculationSprayout + { + get{ return _DeltaECalculationSprayout;} + set + { + _DeltaECalculationSprayout = value; + _flagDeltaECalculationSprayout = true; + } + } + private string _DeltaECalculationSprayout; + private bool _flagDeltaECalculationSprayout; + + /// + /// Returns false as DeltaECalculationSprayout should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeDeltaECalculationSprayout() + { + return _flagDeltaECalculationSprayout; + } + /// + /// Gets or Sets OwnColorVariantNumber + /// + [DataMember(Name = "ownColorVariantNumber", EmitDefaultValue = true)] + public int? OwnColorVariantNumber + { + get{ return _OwnColorVariantNumber;} + set + { + _OwnColorVariantNumber = value; + _flagOwnColorVariantNumber = true; + } + } + private int? _OwnColorVariantNumber; + private bool _flagOwnColorVariantNumber; + + /// + /// Returns false as OwnColorVariantNumber should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeOwnColorVariantNumber() + { + return _flagOwnColorVariantNumber; + } + /// + /// Gets or Sets PrimerProductId + /// + [DataMember(Name = "primerProductId", EmitDefaultValue = false)] + public string PrimerProductId + { + get{ return _PrimerProductId;} + set + { + _PrimerProductId = value; + _flagPrimerProductId = true; + } + } + private string _PrimerProductId; + private bool _flagPrimerProductId; + + /// + /// Returns false as PrimerProductId should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializePrimerProductId() + { + return _flagPrimerProductId; + } + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [DataMember(Name = "productId", EmitDefaultValue = false)] + public string ProductId + { + get{ return _ProductId;} + set + { + _ProductId = value; + _flagProductId = true; + } + } + private string _ProductId; + private bool _flagProductId; + + /// + /// Returns false as ProductId should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeProductId() + { + return _flagProductId; + } + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [DataMember(Name = "productName", EmitDefaultValue = false)] + public string ProductName + { + get{ return _ProductName;} + set + { + _ProductName = value; + _flagProductName = true; + } + } + private string _ProductName; + private bool _flagProductName; + + /// + /// Returns false as ProductName should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeProductName() + { + return _flagProductName; + } + /// + /// Gets or Sets SelectedVersionIndex + /// + [DataMember(Name = "selectedVersionIndex", EmitDefaultValue = false)] + public int SelectedVersionIndex + { + get{ return _SelectedVersionIndex;} + set + { + _SelectedVersionIndex = value; + _flagSelectedVersionIndex = true; + } + } + private int _SelectedVersionIndex; + private bool _flagSelectedVersionIndex; + + /// + /// Returns false as SelectedVersionIndex should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeSelectedVersionIndex() + { + return _flagSelectedVersionIndex; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixLog).AreEqual; + } + + /// + /// Returns true if MixLog instances are equal + /// + /// Instance of MixLog to be compared + /// Boolean + public bool Equals(MixLog input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.MixDate != null) + { + hashCode = (hashCode * 59) + this.MixDate.GetHashCode(); + } + if (this.ShopId != null) + { + hashCode = (hashCode * 59) + this.ShopId.GetHashCode(); + } + if (this.TotalPrice != null) + { + hashCode = (hashCode * 59) + this.TotalPrice.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TotalRecalculations.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalOverPoors.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalSkips.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalUnderPours.GetHashCode(); + if (this.FormulaVersionDate != null) + { + hashCode = (hashCode * 59) + this.FormulaVersionDate.GetHashCode(); + } + if (this.SomeCode != null) + { + hashCode = (hashCode * 59) + this.SomeCode.GetHashCode(); + } + if (this.BatchNumber != null) + { + hashCode = (hashCode * 59) + this.BatchNumber.GetHashCode(); + } + if (this.BrandCode != null) + { + hashCode = (hashCode * 59) + this.BrandCode.GetHashCode(); + } + if (this.BrandId != null) + { + hashCode = (hashCode * 59) + this.BrandId.GetHashCode(); + } + if (this.BrandName != null) + { + hashCode = (hashCode * 59) + this.BrandName.GetHashCode(); + } + if (this.CategoryCode != null) + { + hashCode = (hashCode * 59) + this.CategoryCode.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.ColorDescription != null) + { + hashCode = (hashCode * 59) + this.ColorDescription.GetHashCode(); + } + if (this.Comment != null) + { + hashCode = (hashCode * 59) + this.Comment.GetHashCode(); + } + if (this.CommercialProductCode != null) + { + hashCode = (hashCode * 59) + this.CommercialProductCode.GetHashCode(); + } + if (this.ProductLineCode != null) + { + hashCode = (hashCode * 59) + this.ProductLineCode.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.CreatedBy != null) + { + hashCode = (hashCode * 59) + this.CreatedBy.GetHashCode(); + } + if (this.CreatedByFirstName != null) + { + hashCode = (hashCode * 59) + this.CreatedByFirstName.GetHashCode(); + } + if (this.CreatedByLastName != null) + { + hashCode = (hashCode * 59) + this.CreatedByLastName.GetHashCode(); + } + if (this.DeltaECalculationRepaired != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationRepaired.GetHashCode(); + } + if (this.DeltaECalculationSprayout != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationSprayout.GetHashCode(); + } + if (this.OwnColorVariantNumber != null) + { + hashCode = (hashCode * 59) + this.OwnColorVariantNumber.GetHashCode(); + } + if (this.PrimerProductId != null) + { + hashCode = (hashCode * 59) + this.PrimerProductId.GetHashCode(); + } + if (this.ProductId != null) + { + hashCode = (hashCode * 59) + this.ProductId.GetHashCode(); + } + if (this.ProductName != null) + { + hashCode = (hashCode * 59) + this.ProductName.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SelectedVersionIndex.GetHashCode(); + if (this.AdditionalProperties != null) + { + hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 5aa9418b32b..3e394392958 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml index 673de491c71..6cfc875b074 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml @@ -1304,6 +1304,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2894,6 +2898,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 5aa9418b32b..3e394392958 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,7 @@ https://github.com/GIT_USER_ID/GIT_REPO_ID.git git Minor update + false diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/.openapi-generator/FILES b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/.openapi-generator/FILES index b73f11d50f1..2b84fd7b3a0 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/.openapi-generator/FILES @@ -49,6 +49,7 @@ docs/List.md docs/LiteralStringClass.md docs/Mammal.md docs/MapTest.md +docs/MixLog.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md docs/ModelClient.md @@ -170,6 +171,7 @@ src/Org.OpenAPITools/Model/List.cs src/Org.OpenAPITools/Model/LiteralStringClass.cs src/Org.OpenAPITools/Model/Mammal.cs src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixLog.cs src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs src/Org.OpenAPITools/Model/Model200Response.cs src/Org.OpenAPITools/Model/ModelClient.cs diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md index bf2f5491fd9..17bca178772 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/README.md @@ -185,6 +185,7 @@ Class | Method | HTTP request | Description - [Model.LiteralStringClass](LiteralStringClass.md) - [Model.Mammal](Mammal.md) - [Model.MapTest](MapTest.md) + - [Model.MixLog](MixLog.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](MixedPropertiesAndAdditionalPropertiesClass.md) - [Model.Model200Response](Model200Response.md) - [Model.ModelClient](ModelClient.md) diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml index a7e5643fd01..e4713d2621c 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml @@ -1278,6 +1278,10 @@ components: type: array RolesReportsHash: description: Role report Hash + example: + role: + name: name + role_uuid: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: role_uuid: format: uuid @@ -2702,6 +2706,108 @@ components: - a_objVariableobject - pkiNotificationtestID type: object + MixLog: + properties: + id: + format: uuid + type: string + description: + type: string + mixDate: + format: date-time + type: string + shopId: + format: uuid + type: string + totalPrice: + format: float + nullable: true + type: number + totalRecalculations: + format: int32 + type: integer + totalOverPoors: + format: int32 + type: integer + totalSkips: + format: int32 + type: integer + totalUnderPours: + format: int32 + type: integer + formulaVersionDate: + format: date-time + type: string + someCode: + description: SomeCode is only required for color mixes + nullable: true + type: string + batchNumber: + type: string + brandCode: + description: BrandCode is only required for non-color mixes + type: string + brandId: + description: BrandId is only required for color mixes + type: string + brandName: + description: BrandName is only required for color mixes + type: string + categoryCode: + description: CategoryCode is not used anymore + type: string + color: + description: Color is only required for color mixes + type: string + colorDescription: + type: string + comment: + type: string + commercialProductCode: + type: string + productLineCode: + description: ProductLineCode is only required for color mixes + type: string + country: + type: string + createdBy: + type: string + createdByFirstName: + type: string + createdByLastName: + type: string + deltaECalculationRepaired: + type: string + deltaECalculationSprayout: + type: string + ownColorVariantNumber: + format: int32 + nullable: true + type: integer + primerProductId: + type: string + productId: + description: ProductId is only required for color mixes + type: string + productName: + description: ProductName is only required for color mixes + type: string + selectedVersionIndex: + format: int32 + type: integer + required: + - description + - formulaVersionDate + - id + - mixDate + - totalOverPoors + - totalRecalculations + - totalSkips + - totalUnderPours + type: object + uuid: + format: uuid + type: string _foo_get_default_response: example: string: @@ -2862,6 +2968,8 @@ components: - country type: object RolesReportsHash_role: + example: + name: name properties: name: type: string diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/MixLog.md b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/MixLog.md new file mode 100644 index 00000000000..1872e30daaa --- /dev/null +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/MixLog.md @@ -0,0 +1,41 @@ +# Org.OpenAPITools.Model.MixLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **Guid** | | +**Description** | **string** | | +**MixDate** | **DateTime** | | +**ShopId** | **Guid** | | [optional] +**TotalPrice** | **float?** | | [optional] +**TotalRecalculations** | **int** | | +**TotalOverPoors** | **int** | | +**TotalSkips** | **int** | | +**TotalUnderPours** | **int** | | +**FormulaVersionDate** | **DateTime** | | +**SomeCode** | **string** | SomeCode is only required for color mixes | [optional] +**BatchNumber** | **string** | | [optional] +**BrandCode** | **string** | BrandCode is only required for non-color mixes | [optional] +**BrandId** | **string** | BrandId is only required for color mixes | [optional] +**BrandName** | **string** | BrandName is only required for color mixes | [optional] +**CategoryCode** | **string** | CategoryCode is not used anymore | [optional] +**Color** | **string** | Color is only required for color mixes | [optional] +**ColorDescription** | **string** | | [optional] +**Comment** | **string** | | [optional] +**CommercialProductCode** | **string** | | [optional] +**ProductLineCode** | **string** | ProductLineCode is only required for color mixes | [optional] +**Country** | **string** | | [optional] +**CreatedBy** | **string** | | [optional] +**CreatedByFirstName** | **string** | | [optional] +**CreatedByLastName** | **string** | | [optional] +**DeltaECalculationRepaired** | **string** | | [optional] +**DeltaECalculationSprayout** | **string** | | [optional] +**OwnColorVariantNumber** | **int?** | | [optional] +**PrimerProductId** | **string** | | [optional] +**ProductId** | **string** | ProductId is only required for color mixes | [optional] +**ProductName** | **string** | ProductName is only required for color mixes | [optional] +**SelectedVersionIndex** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs new file mode 100644 index 00000000000..11edb7f8e5e --- /dev/null +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/MixLogTests.cs @@ -0,0 +1,314 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing MixLog + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class MixLogTests : IDisposable + { + // TODO uncomment below to declare an instance variable for MixLog + //private MixLog instance; + + public MixLogTests() + { + // TODO uncomment below to create an instance of MixLog + //instance = new MixLog(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of MixLog + /// + [Test] + public void MixLogInstanceTest() + { + // TODO uncomment below to test "IsType" MixLog + //Assert.IsType(instance); + } + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO unit test for the property 'Id' + } + /// + /// Test the property 'Description' + /// + [Test] + public void DescriptionTest() + { + // TODO unit test for the property 'Description' + } + /// + /// Test the property 'MixDate' + /// + [Test] + public void MixDateTest() + { + // TODO unit test for the property 'MixDate' + } + /// + /// Test the property 'ShopId' + /// + [Test] + public void ShopIdTest() + { + // TODO unit test for the property 'ShopId' + } + /// + /// Test the property 'TotalPrice' + /// + [Test] + public void TotalPriceTest() + { + // TODO unit test for the property 'TotalPrice' + } + /// + /// Test the property 'TotalRecalculations' + /// + [Test] + public void TotalRecalculationsTest() + { + // TODO unit test for the property 'TotalRecalculations' + } + /// + /// Test the property 'TotalOverPoors' + /// + [Test] + public void TotalOverPoorsTest() + { + // TODO unit test for the property 'TotalOverPoors' + } + /// + /// Test the property 'TotalSkips' + /// + [Test] + public void TotalSkipsTest() + { + // TODO unit test for the property 'TotalSkips' + } + /// + /// Test the property 'TotalUnderPours' + /// + [Test] + public void TotalUnderPoursTest() + { + // TODO unit test for the property 'TotalUnderPours' + } + /// + /// Test the property 'FormulaVersionDate' + /// + [Test] + public void FormulaVersionDateTest() + { + // TODO unit test for the property 'FormulaVersionDate' + } + /// + /// Test the property 'SomeCode' + /// + [Test] + public void SomeCodeTest() + { + // TODO unit test for the property 'SomeCode' + } + /// + /// Test the property 'BatchNumber' + /// + [Test] + public void BatchNumberTest() + { + // TODO unit test for the property 'BatchNumber' + } + /// + /// Test the property 'BrandCode' + /// + [Test] + public void BrandCodeTest() + { + // TODO unit test for the property 'BrandCode' + } + /// + /// Test the property 'BrandId' + /// + [Test] + public void BrandIdTest() + { + // TODO unit test for the property 'BrandId' + } + /// + /// Test the property 'BrandName' + /// + [Test] + public void BrandNameTest() + { + // TODO unit test for the property 'BrandName' + } + /// + /// Test the property 'CategoryCode' + /// + [Test] + public void CategoryCodeTest() + { + // TODO unit test for the property 'CategoryCode' + } + /// + /// Test the property 'Color' + /// + [Test] + public void ColorTest() + { + // TODO unit test for the property 'Color' + } + /// + /// Test the property 'ColorDescription' + /// + [Test] + public void ColorDescriptionTest() + { + // TODO unit test for the property 'ColorDescription' + } + /// + /// Test the property 'Comment' + /// + [Test] + public void CommentTest() + { + // TODO unit test for the property 'Comment' + } + /// + /// Test the property 'CommercialProductCode' + /// + [Test] + public void CommercialProductCodeTest() + { + // TODO unit test for the property 'CommercialProductCode' + } + /// + /// Test the property 'ProductLineCode' + /// + [Test] + public void ProductLineCodeTest() + { + // TODO unit test for the property 'ProductLineCode' + } + /// + /// Test the property 'Country' + /// + [Test] + public void CountryTest() + { + // TODO unit test for the property 'Country' + } + /// + /// Test the property 'CreatedBy' + /// + [Test] + public void CreatedByTest() + { + // TODO unit test for the property 'CreatedBy' + } + /// + /// Test the property 'CreatedByFirstName' + /// + [Test] + public void CreatedByFirstNameTest() + { + // TODO unit test for the property 'CreatedByFirstName' + } + /// + /// Test the property 'CreatedByLastName' + /// + [Test] + public void CreatedByLastNameTest() + { + // TODO unit test for the property 'CreatedByLastName' + } + /// + /// Test the property 'DeltaECalculationRepaired' + /// + [Test] + public void DeltaECalculationRepairedTest() + { + // TODO unit test for the property 'DeltaECalculationRepaired' + } + /// + /// Test the property 'DeltaECalculationSprayout' + /// + [Test] + public void DeltaECalculationSprayoutTest() + { + // TODO unit test for the property 'DeltaECalculationSprayout' + } + /// + /// Test the property 'OwnColorVariantNumber' + /// + [Test] + public void OwnColorVariantNumberTest() + { + // TODO unit test for the property 'OwnColorVariantNumber' + } + /// + /// Test the property 'PrimerProductId' + /// + [Test] + public void PrimerProductIdTest() + { + // TODO unit test for the property 'PrimerProductId' + } + /// + /// Test the property 'ProductId' + /// + [Test] + public void ProductIdTest() + { + // TODO unit test for the property 'ProductId' + } + /// + /// Test the property 'ProductName' + /// + [Test] + public void ProductNameTest() + { + // TODO unit test for the property 'ProductName' + } + /// + /// Test the property 'SelectedVersionIndex' + /// + [Test] + public void SelectedVersionIndexTest() + { + // TODO unit test for the property 'SelectedVersionIndex' + } + } +} diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index 256f338e181..26a72daaf38 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -90,7 +90,7 @@ namespace Org.OpenAPITools.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs new file mode 100644 index 00000000000..dfc02b8315c --- /dev/null +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixLog.cs @@ -0,0 +1,675 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// MixLog + /// + [DataContract(Name = "MixLog")] + public partial class MixLog : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MixLog() { } + /// + /// Initializes a new instance of the class. + /// + /// id (required). + /// description (required). + /// mixDate (required). + /// shopId. + /// totalPrice. + /// totalRecalculations (required). + /// totalOverPoors (required). + /// totalSkips (required). + /// totalUnderPours (required). + /// formulaVersionDate (required). + /// SomeCode is only required for color mixes. + /// batchNumber. + /// BrandCode is only required for non-color mixes. + /// BrandId is only required for color mixes. + /// BrandName is only required for color mixes. + /// CategoryCode is not used anymore. + /// Color is only required for color mixes. + /// colorDescription. + /// comment. + /// commercialProductCode. + /// ProductLineCode is only required for color mixes. + /// country. + /// createdBy. + /// createdByFirstName. + /// createdByLastName. + /// deltaECalculationRepaired. + /// deltaECalculationSprayout. + /// ownColorVariantNumber. + /// primerProductId. + /// ProductId is only required for color mixes. + /// ProductName is only required for color mixes. + /// selectedVersionIndex. + public MixLog(Guid id = default(Guid), string description = default(string), DateTime mixDate = default(DateTime), Guid shopId = default(Guid), float? totalPrice = default(float?), int totalRecalculations = default(int), int totalOverPoors = default(int), int totalSkips = default(int), int totalUnderPours = default(int), DateTime formulaVersionDate = default(DateTime), string someCode = default(string), string batchNumber = default(string), string brandCode = default(string), string brandId = default(string), string brandName = default(string), string categoryCode = default(string), string color = default(string), string colorDescription = default(string), string comment = default(string), string commercialProductCode = default(string), string productLineCode = default(string), string country = default(string), string createdBy = default(string), string createdByFirstName = default(string), string createdByLastName = default(string), string deltaECalculationRepaired = default(string), string deltaECalculationSprayout = default(string), int? ownColorVariantNumber = default(int?), string primerProductId = default(string), string productId = default(string), string productName = default(string), int selectedVersionIndex = default(int)) + { + this.Id = id; + // to ensure "description" is required (not null) + if (description == null) + { + throw new ArgumentNullException("description is a required property for MixLog and cannot be null"); + } + this.Description = description; + this.MixDate = mixDate; + this.TotalRecalculations = totalRecalculations; + this.TotalOverPoors = totalOverPoors; + this.TotalSkips = totalSkips; + this.TotalUnderPours = totalUnderPours; + this.FormulaVersionDate = formulaVersionDate; + this.ShopId = shopId; + this.TotalPrice = totalPrice; + this.SomeCode = someCode; + this.BatchNumber = batchNumber; + this.BrandCode = brandCode; + this.BrandId = brandId; + this.BrandName = brandName; + this.CategoryCode = categoryCode; + this.Color = color; + this.ColorDescription = colorDescription; + this.Comment = comment; + this.CommercialProductCode = commercialProductCode; + this.ProductLineCode = productLineCode; + this.Country = country; + this.CreatedBy = createdBy; + this.CreatedByFirstName = createdByFirstName; + this.CreatedByLastName = createdByLastName; + this.DeltaECalculationRepaired = deltaECalculationRepaired; + this.DeltaECalculationSprayout = deltaECalculationSprayout; + this.OwnColorVariantNumber = ownColorVariantNumber; + this.PrimerProductId = primerProductId; + this.ProductId = productId; + this.ProductName = productName; + this.SelectedVersionIndex = selectedVersionIndex; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public Guid Id { get; set; } + + /// + /// Gets or Sets Description + /// + [DataMember(Name = "description", IsRequired = true, EmitDefaultValue = true)] + public string Description { get; set; } + + /// + /// Gets or Sets MixDate + /// + [DataMember(Name = "mixDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime MixDate { get; set; } + + /// + /// Gets or Sets ShopId + /// + [DataMember(Name = "shopId", EmitDefaultValue = false)] + public Guid ShopId { get; set; } + + /// + /// Gets or Sets TotalPrice + /// + [DataMember(Name = "totalPrice", EmitDefaultValue = true)] + public float? TotalPrice { get; set; } + + /// + /// Gets or Sets TotalRecalculations + /// + [DataMember(Name = "totalRecalculations", IsRequired = true, EmitDefaultValue = true)] + public int TotalRecalculations { get; set; } + + /// + /// Gets or Sets TotalOverPoors + /// + [DataMember(Name = "totalOverPoors", IsRequired = true, EmitDefaultValue = true)] + public int TotalOverPoors { get; set; } + + /// + /// Gets or Sets TotalSkips + /// + [DataMember(Name = "totalSkips", IsRequired = true, EmitDefaultValue = true)] + public int TotalSkips { get; set; } + + /// + /// Gets or Sets TotalUnderPours + /// + [DataMember(Name = "totalUnderPours", IsRequired = true, EmitDefaultValue = true)] + public int TotalUnderPours { get; set; } + + /// + /// Gets or Sets FormulaVersionDate + /// + [DataMember(Name = "formulaVersionDate", IsRequired = true, EmitDefaultValue = true)] + public DateTime FormulaVersionDate { get; set; } + + /// + /// SomeCode is only required for color mixes + /// + /// SomeCode is only required for color mixes + [DataMember(Name = "someCode", EmitDefaultValue = true)] + public string SomeCode { get; set; } + + /// + /// Gets or Sets BatchNumber + /// + [DataMember(Name = "batchNumber", EmitDefaultValue = false)] + public string BatchNumber { get; set; } + + /// + /// BrandCode is only required for non-color mixes + /// + /// BrandCode is only required for non-color mixes + [DataMember(Name = "brandCode", EmitDefaultValue = false)] + public string BrandCode { get; set; } + + /// + /// BrandId is only required for color mixes + /// + /// BrandId is only required for color mixes + [DataMember(Name = "brandId", EmitDefaultValue = false)] + public string BrandId { get; set; } + + /// + /// BrandName is only required for color mixes + /// + /// BrandName is only required for color mixes + [DataMember(Name = "brandName", EmitDefaultValue = false)] + public string BrandName { get; set; } + + /// + /// CategoryCode is not used anymore + /// + /// CategoryCode is not used anymore + [DataMember(Name = "categoryCode", EmitDefaultValue = false)] + public string CategoryCode { get; set; } + + /// + /// Color is only required for color mixes + /// + /// Color is only required for color mixes + [DataMember(Name = "color", EmitDefaultValue = false)] + public string Color { get; set; } + + /// + /// Gets or Sets ColorDescription + /// + [DataMember(Name = "colorDescription", EmitDefaultValue = false)] + public string ColorDescription { get; set; } + + /// + /// Gets or Sets Comment + /// + [DataMember(Name = "comment", EmitDefaultValue = false)] + public string Comment { get; set; } + + /// + /// Gets or Sets CommercialProductCode + /// + [DataMember(Name = "commercialProductCode", EmitDefaultValue = false)] + public string CommercialProductCode { get; set; } + + /// + /// ProductLineCode is only required for color mixes + /// + /// ProductLineCode is only required for color mixes + [DataMember(Name = "productLineCode", EmitDefaultValue = false)] + public string ProductLineCode { get; set; } + + /// + /// Gets or Sets Country + /// + [DataMember(Name = "country", EmitDefaultValue = false)] + public string Country { get; set; } + + /// + /// Gets or Sets CreatedBy + /// + [DataMember(Name = "createdBy", EmitDefaultValue = false)] + public string CreatedBy { get; set; } + + /// + /// Gets or Sets CreatedByFirstName + /// + [DataMember(Name = "createdByFirstName", EmitDefaultValue = false)] + public string CreatedByFirstName { get; set; } + + /// + /// Gets or Sets CreatedByLastName + /// + [DataMember(Name = "createdByLastName", EmitDefaultValue = false)] + public string CreatedByLastName { get; set; } + + /// + /// Gets or Sets DeltaECalculationRepaired + /// + [DataMember(Name = "deltaECalculationRepaired", EmitDefaultValue = false)] + public string DeltaECalculationRepaired { get; set; } + + /// + /// Gets or Sets DeltaECalculationSprayout + /// + [DataMember(Name = "deltaECalculationSprayout", EmitDefaultValue = false)] + public string DeltaECalculationSprayout { get; set; } + + /// + /// Gets or Sets OwnColorVariantNumber + /// + [DataMember(Name = "ownColorVariantNumber", EmitDefaultValue = true)] + public int? OwnColorVariantNumber { get; set; } + + /// + /// Gets or Sets PrimerProductId + /// + [DataMember(Name = "primerProductId", EmitDefaultValue = false)] + public string PrimerProductId { get; set; } + + /// + /// ProductId is only required for color mixes + /// + /// ProductId is only required for color mixes + [DataMember(Name = "productId", EmitDefaultValue = false)] + public string ProductId { get; set; } + + /// + /// ProductName is only required for color mixes + /// + /// ProductName is only required for color mixes + [DataMember(Name = "productName", EmitDefaultValue = false)] + public string ProductName { get; set; } + + /// + /// Gets or Sets SelectedVersionIndex + /// + [DataMember(Name = "selectedVersionIndex", EmitDefaultValue = false)] + public int SelectedVersionIndex { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MixLog {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" MixDate: ").Append(MixDate).Append("\n"); + sb.Append(" ShopId: ").Append(ShopId).Append("\n"); + sb.Append(" TotalPrice: ").Append(TotalPrice).Append("\n"); + sb.Append(" TotalRecalculations: ").Append(TotalRecalculations).Append("\n"); + sb.Append(" TotalOverPoors: ").Append(TotalOverPoors).Append("\n"); + sb.Append(" TotalSkips: ").Append(TotalSkips).Append("\n"); + sb.Append(" TotalUnderPours: ").Append(TotalUnderPours).Append("\n"); + sb.Append(" FormulaVersionDate: ").Append(FormulaVersionDate).Append("\n"); + sb.Append(" SomeCode: ").Append(SomeCode).Append("\n"); + sb.Append(" BatchNumber: ").Append(BatchNumber).Append("\n"); + sb.Append(" BrandCode: ").Append(BrandCode).Append("\n"); + sb.Append(" BrandId: ").Append(BrandId).Append("\n"); + sb.Append(" BrandName: ").Append(BrandName).Append("\n"); + sb.Append(" CategoryCode: ").Append(CategoryCode).Append("\n"); + sb.Append(" Color: ").Append(Color).Append("\n"); + sb.Append(" ColorDescription: ").Append(ColorDescription).Append("\n"); + sb.Append(" Comment: ").Append(Comment).Append("\n"); + sb.Append(" CommercialProductCode: ").Append(CommercialProductCode).Append("\n"); + sb.Append(" ProductLineCode: ").Append(ProductLineCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" CreatedBy: ").Append(CreatedBy).Append("\n"); + sb.Append(" CreatedByFirstName: ").Append(CreatedByFirstName).Append("\n"); + sb.Append(" CreatedByLastName: ").Append(CreatedByLastName).Append("\n"); + sb.Append(" DeltaECalculationRepaired: ").Append(DeltaECalculationRepaired).Append("\n"); + sb.Append(" DeltaECalculationSprayout: ").Append(DeltaECalculationSprayout).Append("\n"); + sb.Append(" OwnColorVariantNumber: ").Append(OwnColorVariantNumber).Append("\n"); + sb.Append(" PrimerProductId: ").Append(PrimerProductId).Append("\n"); + sb.Append(" ProductId: ").Append(ProductId).Append("\n"); + sb.Append(" ProductName: ").Append(ProductName).Append("\n"); + sb.Append(" SelectedVersionIndex: ").Append(SelectedVersionIndex).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as MixLog); + } + + /// + /// Returns true if MixLog instances are equal + /// + /// Instance of MixLog to be compared + /// Boolean + public bool Equals(MixLog input) + { + if (input == null) + { + return false; + } + return + ( + this.Id == input.Id || + (this.Id != null && + this.Id.Equals(input.Id)) + ) && + ( + this.Description == input.Description || + (this.Description != null && + this.Description.Equals(input.Description)) + ) && + ( + this.MixDate == input.MixDate || + (this.MixDate != null && + this.MixDate.Equals(input.MixDate)) + ) && + ( + this.ShopId == input.ShopId || + (this.ShopId != null && + this.ShopId.Equals(input.ShopId)) + ) && + ( + this.TotalPrice == input.TotalPrice || + (this.TotalPrice != null && + this.TotalPrice.Equals(input.TotalPrice)) + ) && + ( + this.TotalRecalculations == input.TotalRecalculations || + this.TotalRecalculations.Equals(input.TotalRecalculations) + ) && + ( + this.TotalOverPoors == input.TotalOverPoors || + this.TotalOverPoors.Equals(input.TotalOverPoors) + ) && + ( + this.TotalSkips == input.TotalSkips || + this.TotalSkips.Equals(input.TotalSkips) + ) && + ( + this.TotalUnderPours == input.TotalUnderPours || + this.TotalUnderPours.Equals(input.TotalUnderPours) + ) && + ( + this.FormulaVersionDate == input.FormulaVersionDate || + (this.FormulaVersionDate != null && + this.FormulaVersionDate.Equals(input.FormulaVersionDate)) + ) && + ( + this.SomeCode == input.SomeCode || + (this.SomeCode != null && + this.SomeCode.Equals(input.SomeCode)) + ) && + ( + this.BatchNumber == input.BatchNumber || + (this.BatchNumber != null && + this.BatchNumber.Equals(input.BatchNumber)) + ) && + ( + this.BrandCode == input.BrandCode || + (this.BrandCode != null && + this.BrandCode.Equals(input.BrandCode)) + ) && + ( + this.BrandId == input.BrandId || + (this.BrandId != null && + this.BrandId.Equals(input.BrandId)) + ) && + ( + this.BrandName == input.BrandName || + (this.BrandName != null && + this.BrandName.Equals(input.BrandName)) + ) && + ( + this.CategoryCode == input.CategoryCode || + (this.CategoryCode != null && + this.CategoryCode.Equals(input.CategoryCode)) + ) && + ( + this.Color == input.Color || + (this.Color != null && + this.Color.Equals(input.Color)) + ) && + ( + this.ColorDescription == input.ColorDescription || + (this.ColorDescription != null && + this.ColorDescription.Equals(input.ColorDescription)) + ) && + ( + this.Comment == input.Comment || + (this.Comment != null && + this.Comment.Equals(input.Comment)) + ) && + ( + this.CommercialProductCode == input.CommercialProductCode || + (this.CommercialProductCode != null && + this.CommercialProductCode.Equals(input.CommercialProductCode)) + ) && + ( + this.ProductLineCode == input.ProductLineCode || + (this.ProductLineCode != null && + this.ProductLineCode.Equals(input.ProductLineCode)) + ) && + ( + this.Country == input.Country || + (this.Country != null && + this.Country.Equals(input.Country)) + ) && + ( + this.CreatedBy == input.CreatedBy || + (this.CreatedBy != null && + this.CreatedBy.Equals(input.CreatedBy)) + ) && + ( + this.CreatedByFirstName == input.CreatedByFirstName || + (this.CreatedByFirstName != null && + this.CreatedByFirstName.Equals(input.CreatedByFirstName)) + ) && + ( + this.CreatedByLastName == input.CreatedByLastName || + (this.CreatedByLastName != null && + this.CreatedByLastName.Equals(input.CreatedByLastName)) + ) && + ( + this.DeltaECalculationRepaired == input.DeltaECalculationRepaired || + (this.DeltaECalculationRepaired != null && + this.DeltaECalculationRepaired.Equals(input.DeltaECalculationRepaired)) + ) && + ( + this.DeltaECalculationSprayout == input.DeltaECalculationSprayout || + (this.DeltaECalculationSprayout != null && + this.DeltaECalculationSprayout.Equals(input.DeltaECalculationSprayout)) + ) && + ( + this.OwnColorVariantNumber == input.OwnColorVariantNumber || + (this.OwnColorVariantNumber != null && + this.OwnColorVariantNumber.Equals(input.OwnColorVariantNumber)) + ) && + ( + this.PrimerProductId == input.PrimerProductId || + (this.PrimerProductId != null && + this.PrimerProductId.Equals(input.PrimerProductId)) + ) && + ( + this.ProductId == input.ProductId || + (this.ProductId != null && + this.ProductId.Equals(input.ProductId)) + ) && + ( + this.ProductName == input.ProductName || + (this.ProductName != null && + this.ProductName.Equals(input.ProductName)) + ) && + ( + this.SelectedVersionIndex == input.SelectedVersionIndex || + this.SelectedVersionIndex.Equals(input.SelectedVersionIndex) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Id != null) + { + hashCode = (hashCode * 59) + this.Id.GetHashCode(); + } + if (this.Description != null) + { + hashCode = (hashCode * 59) + this.Description.GetHashCode(); + } + if (this.MixDate != null) + { + hashCode = (hashCode * 59) + this.MixDate.GetHashCode(); + } + if (this.ShopId != null) + { + hashCode = (hashCode * 59) + this.ShopId.GetHashCode(); + } + if (this.TotalPrice != null) + { + hashCode = (hashCode * 59) + this.TotalPrice.GetHashCode(); + } + hashCode = (hashCode * 59) + this.TotalRecalculations.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalOverPoors.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalSkips.GetHashCode(); + hashCode = (hashCode * 59) + this.TotalUnderPours.GetHashCode(); + if (this.FormulaVersionDate != null) + { + hashCode = (hashCode * 59) + this.FormulaVersionDate.GetHashCode(); + } + if (this.SomeCode != null) + { + hashCode = (hashCode * 59) + this.SomeCode.GetHashCode(); + } + if (this.BatchNumber != null) + { + hashCode = (hashCode * 59) + this.BatchNumber.GetHashCode(); + } + if (this.BrandCode != null) + { + hashCode = (hashCode * 59) + this.BrandCode.GetHashCode(); + } + if (this.BrandId != null) + { + hashCode = (hashCode * 59) + this.BrandId.GetHashCode(); + } + if (this.BrandName != null) + { + hashCode = (hashCode * 59) + this.BrandName.GetHashCode(); + } + if (this.CategoryCode != null) + { + hashCode = (hashCode * 59) + this.CategoryCode.GetHashCode(); + } + if (this.Color != null) + { + hashCode = (hashCode * 59) + this.Color.GetHashCode(); + } + if (this.ColorDescription != null) + { + hashCode = (hashCode * 59) + this.ColorDescription.GetHashCode(); + } + if (this.Comment != null) + { + hashCode = (hashCode * 59) + this.Comment.GetHashCode(); + } + if (this.CommercialProductCode != null) + { + hashCode = (hashCode * 59) + this.CommercialProductCode.GetHashCode(); + } + if (this.ProductLineCode != null) + { + hashCode = (hashCode * 59) + this.ProductLineCode.GetHashCode(); + } + if (this.Country != null) + { + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + } + if (this.CreatedBy != null) + { + hashCode = (hashCode * 59) + this.CreatedBy.GetHashCode(); + } + if (this.CreatedByFirstName != null) + { + hashCode = (hashCode * 59) + this.CreatedByFirstName.GetHashCode(); + } + if (this.CreatedByLastName != null) + { + hashCode = (hashCode * 59) + this.CreatedByLastName.GetHashCode(); + } + if (this.DeltaECalculationRepaired != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationRepaired.GetHashCode(); + } + if (this.DeltaECalculationSprayout != null) + { + hashCode = (hashCode * 59) + this.DeltaECalculationSprayout.GetHashCode(); + } + if (this.OwnColorVariantNumber != null) + { + hashCode = (hashCode * 59) + this.OwnColorVariantNumber.GetHashCode(); + } + if (this.PrimerProductId != null) + { + hashCode = (hashCode * 59) + this.PrimerProductId.GetHashCode(); + } + if (this.ProductId != null) + { + hashCode = (hashCode * 59) + this.ProductId.GetHashCode(); + } + if (this.ProductName != null) + { + hashCode = (hashCode * 59) + this.ProductName.GetHashCode(); + } + hashCode = (hashCode * 59) + this.SelectedVersionIndex.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex new file mode 100644 index 00000000000..efbb7eacea8 --- /dev/null +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/deprecated_object.ex @@ -0,0 +1,22 @@ +# NOTE: This file is auto generated by OpenAPI Generator 7.0.0-SNAPSHOT (https://openapi-generator.tech). +# Do not edit this file manually. + +defmodule OpenapiPetstore.Model.DeprecatedObject do + @moduledoc """ + + """ + + @derive Jason.Encoder + defstruct [ + :name + ] + + @type t :: %__MODULE__{ + :name => String.t | nil + } + + def decode(value) do + value + end +end + diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 66cc7f921a4..c56879d3aca 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -178,7 +178,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator/FILES similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES rename to samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator/FILES diff --git a/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v3/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java-helidon-client/mp/README.md b/samples/client/petstore/java-helidon-client/v3/mp/README.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/README.md rename to samples/client/petstore/java-helidon-client/v3/mp/README.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/AdditionalPropertiesClass.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/AllOfWithSingleRef.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/AllOfWithSingleRef.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Animal.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Animal.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Animal.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Animal.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/AnotherFakeApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/AnotherFakeApi.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayOfNumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ArrayTest.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Capitalization.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Capitalization.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Cat.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Cat.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Cat.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Cat.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Category.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Category.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Category.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Category.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ChildWithNullable.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ChildWithNullable.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ChildWithNullable.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ChildWithNullable.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ClassModel.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ClassModel.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Client.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Client.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Client.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Client.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/DefaultApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/DefaultApi.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/DeprecatedObject.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/DeprecatedObject.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Dog.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Dog.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Dog.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Dog.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/EnumArrays.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/EnumArrays.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/EnumClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/EnumClass.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/EnumTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/EnumTest.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FakeApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FakeApi.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FakeBigDecimalMap200Response.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FakeBigDecimalMap200Response.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FakeBigDecimalMap200Response.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FakeClassnameTags123Api.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FakeClassnameTags123Api.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FileSchemaTestClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FileSchemaTestClass.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Foo.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Foo.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Foo.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Foo.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FooGetDefaultResponse.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FooGetDefaultResponse.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/FormatTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/FormatTest.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/HasOnlyReadOnly.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/HealthCheckResult.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/HealthCheckResult.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/MapTest.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/MapTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/MapTest.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/MapTest.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Model200Response.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Model200Response.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ModelApiResponse.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ModelApiResponse.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ModelFile.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ModelFile.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelList.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ModelList.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ModelList.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ModelList.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ModelReturn.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ModelReturn.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Name.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Name.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Name.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Name.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/NullableClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/NullableClass.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/NumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/NumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ObjectWithDeprecatedFields.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Order.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Order.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Order.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Order.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterComposite.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterComposite.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnum.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnum.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumDefaultValue.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumInteger.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumInteger.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/OuterObjectWithEnumProperty.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ParentWithNullable.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ParentWithNullable.md similarity index 84% rename from samples/client/petstore/java-helidon-client/mp/docs/ParentWithNullable.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java-helidon-client/mp/docs/ParentWithNullable.md +++ b/samples/client/petstore/java-helidon-client/v3/mp/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Pet.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Pet.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/Pet.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Pet.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/PetApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/PetApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/PetApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/PetApi.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/ReadOnlyFirst.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/ReadOnlyFirst.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/SingleRefType.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/SingleRefType.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/SpecialModelName.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/SpecialModelName.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/StoreApi.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Tag.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/Tag.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Tag.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/Tag.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/User.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/User.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/User.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/User.md diff --git a/samples/client/petstore/java-helidon-client/mp/docs/UserApi.md b/samples/client/petstore/java-helidon-client/v3/mp/docs/UserApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/docs/UserApi.md rename to samples/client/petstore/java-helidon-client/v3/mp/docs/UserApi.md diff --git a/samples/client/petstore/java-helidon-client/mp/pom.xml b/samples/client/petstore/java-helidon-client/v3/mp/pom.xml similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/pom.xml rename to samples/client/petstore/java-helidon-client/v3/mp/pom.xml index a2ee1e24771..7da1d625b79 100644 --- a/samples/client/petstore/java-helidon-client/mp/pom.xml +++ b/samples/client/petstore/java-helidon-client/v3/mp/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-mp - 3.0.1 + 3.2.7 petstore-helidon-client-mp diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/ApiException.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/ApiException.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Animal.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Animal.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ArrayTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Capitalization.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Capitalization.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Cat.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Cat.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Category.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Category.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ClassModel.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ClassModel.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Client.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Client.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Dog.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Dog.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumArrays.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumArrays.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumClass.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/EnumTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Foo.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Foo.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FormatTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/FormatTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/MapTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/MapTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Model200Response.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Model200Response.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelFile.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelFile.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelList.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelList.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelReturn.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ModelReturn.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Name.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Name.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/NullableClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/NullableClass.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/NumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/NumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Order.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Order.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterComposite.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterComposite.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnum.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnum.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java similarity index 97% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 25c24ff8602..d22980be614 100644 --- a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -31,7 +31,7 @@ public class ParentWithNullable { public enum TypeEnum { - CHILDWITHNULLABLE(String.valueOf("ChildWithNullable")); + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); String value; diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Pet.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Pet.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/SingleRefType.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/SingleRefType.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Tag.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/Tag.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/User.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java similarity index 80% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java index a953ad7bd89..1a717f22c91 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,8 +14,10 @@ package org.openapitools.client.api; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; @@ -24,6 +26,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import org.junit.jupiter.api.BeforeAll; @@ -58,6 +61,16 @@ public class FakeApiTest { } + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() throws Exception { + //FakeBigDecimalMap200Response response = client.fakeBigDecimalMap(); + //assertNotNull(response); + } + /** * Health check endpoint * @@ -132,6 +145,20 @@ public class FakeApiTest { //assertNotNull(response); } + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() throws Exception { + //void response = client.testAdditionalPropertiesReference(requestBody); + //assertNotNull(response); + } + /** * @throws ApiException * if the Api call fails @@ -232,6 +259,20 @@ public class FakeApiTest { //assertNotNull(response); } + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() throws Exception { + //void response = client.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //assertNotNull(response); + } + /** * test json serialization of form data * @@ -246,6 +287,20 @@ public class FakeApiTest { //assertNotNull(response); } + /** + * test nullable parent property + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testNullableTest() throws Exception { + //void response = client.testNullable(childWithNullable); + //assertNotNull(response); + } + /** * @throws ApiException * if the Api call fails @@ -256,4 +311,18 @@ public class FakeApiTest { //assertNotNull(response); } + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() throws Exception { + //void response = client.testStringMapReference(requestBody); + //assertNotNull(response); + } + } diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 008d620d506..7f291540411 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -23,7 +23,6 @@ import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for AdditionalPropertiesClass */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index ad55c6f2c7d..709ed248c3d 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.SingleRefType; import org.junit.jupiter.api.Test; - /** * Model tests for AllOfWithSingleRef */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AnimalTest.java similarity index 94% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AnimalTest.java index c38a031c2ee..fb63d5826c2 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,12 +21,9 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import org.junit.jupiter.api.Test; - /** * Model tests for Animal */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 5a886da823a..c101bb32ced 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -20,11 +20,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfArrayOfNumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 6b0d615c0ee..9d0fb9edf4c 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -20,11 +20,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfNumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java index be3f20c9a37..5383565a80f 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayTest */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 18e9b9dbf0c..9197586ba93 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Capitalization */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CatTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CatTest.java index d78fcb63591..4b42f739457 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CatTest.java @@ -25,7 +25,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Cat */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CategoryTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CategoryTest.java index 12d4b6a6441..56aac4351d0 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Category */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java index 035b80969f6..1811595c423 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ClassModel */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClientTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClientTest.java index 9b4899ae227..91cf48da972 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ClientTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Client */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index 54347091cc7..6164386e74c 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for DeprecatedObject */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DogTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DogTest.java index 6819c78158a..db2d706f7c0 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/DogTest.java @@ -25,7 +25,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Dog */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 4d249658722..92c16197a69 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -19,11 +19,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for EnumArrays */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java index 11bf230be71..fcc2b414936 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for EnumClass */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java similarity index 97% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java index ec0d37ce367..d0e89364e96 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -24,12 +24,10 @@ import org.openapitools.client.model.OuterEnumInteger; import org.openapitools.client.model.OuterEnumIntegerDefaultValue; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for EnumTest */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 846646eb944..bf520789104 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; import org.junit.jupiter.api.Test; - /** * Model tests for FileSchemaTestClass */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 14639567d81..46605ccd462 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.Foo; import org.junit.jupiter.api.Test; - /** * Model tests for FooGetDefaultResponse */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooTest.java index 6ad35f67e28..2fefdd23102 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FooTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Foo */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java index 773e76967ef..a6acb49c365 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -26,7 +26,6 @@ import java.util.UUID; import org.junit.jupiter.api.Test; - /** * Model tests for FormatTest */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index b956d12d747..09c18c0a082 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for HasOnlyReadOnly */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java similarity index 96% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 3267defa3a6..3efed3019ac 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -20,12 +20,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for HealthCheckResult */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MapTestTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MapTestTest.java index ac308e40089..9ccbfde6765 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -23,7 +23,6 @@ import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for MapTest */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 72a7a2a961c..785ef99658f 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 79bd883d4c4..4014471af25 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Model200Response */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 79b915c9675..2e3d402ff27 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelApiResponse */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java index c10fa3927e3..bd6ef680022 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelFile */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelListTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelListTest.java index 7c09d2e78e8..b8ec3ecd7bc 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelList */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 8c99cb5220f..e1d4e18788b 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelReturn */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NameTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NameTest.java index 8795299bfae..396f82dc643 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NameTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Name */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java index 95997f952e7..694c5a49fce 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -22,17 +22,16 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for NullableClass */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index f1af4caf2ec..40f55c0d0d0 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -22,7 +22,6 @@ import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for NumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index 14f312e38a6..7b8cf33e6e7 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -20,12 +20,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; import org.junit.jupiter.api.Test; - /** * Model tests for ObjectWithDeprecatedFields */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OrderTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OrderTest.java index e99bf8d598d..7521c5e5806 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OrderTest.java @@ -22,7 +22,6 @@ import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; - /** * Model tests for Order */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 28b832d5db9..37dc9deb32f 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -22,7 +22,6 @@ import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for OuterComposite */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 75313d6581d..3700a01dcd6 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumDefaultValue */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index df4527f0d49..1d2f7440113 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumIntegerDefaultValue */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 87c29d2fd72..f12081aad69 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumInteger */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 226fc34f402..b65122cea12 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnum */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 24984008abf..9bafdc4b5d8 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.OuterEnumInteger; import org.junit.jupiter.api.Test; - /** * Model tests for OuterObjectWithEnumProperty */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/PetTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/PetTest.java index 6de3524dcc4..0f2970f254b 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -28,7 +29,6 @@ import org.openapitools.client.model.Tag; import org.junit.jupiter.api.Test; - /** * Model tests for Pet */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 332a1b116c7..3bbb4d28ac4 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ReadOnlyFirst */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 82f51f683de..ed805286a01 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for SingleRefType */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index e1d4d10b94f..2aa6eaf5ab2 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for SpecialModelName */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/TagTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/TagTest.java index ff32e6c114f..e203d6bf42b 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/TagTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Tag */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/UserTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java rename to samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/UserTest.java index 32404a5e38e..c8827f4e71d 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/model/UserTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for User */ diff --git a/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator/FILES similarity index 100% rename from samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES rename to samples/client/petstore/java-helidon-client/v3/se/.openapi-generator/FILES diff --git a/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v3/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java-helidon-client/se/README.md b/samples/client/petstore/java-helidon-client/v3/se/README.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/README.md rename to samples/client/petstore/java-helidon-client/v3/se/README.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v3/se/docs/AdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/AdditionalPropertiesClass.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/v3/se/docs/AllOfWithSingleRef.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/AllOfWithSingleRef.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Animal.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Animal.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Animal.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Animal.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/AnotherFakeApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/AnotherFakeApi.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ArrayOfArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ArrayOfArrayOfNumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ArrayOfNumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ArrayOfNumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ArrayTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ArrayTest.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Capitalization.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Capitalization.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Capitalization.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Cat.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Cat.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Cat.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Cat.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Category.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Category.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Category.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Category.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ChildWithNullable.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ChildWithNullable.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ChildWithNullable.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ChildWithNullable.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ClassModel.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ClassModel.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ClassModel.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Client.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Client.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Client.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Client.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/DefaultApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/DefaultApi.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/v3/se/docs/DeprecatedObject.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/DeprecatedObject.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Dog.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Dog.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Dog.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Dog.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/v3/se/docs/EnumArrays.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/EnumArrays.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/v3/se/docs/EnumClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/EnumClass.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/EnumClass.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/v3/se/docs/EnumTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/EnumTest.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/EnumTest.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FakeApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FakeApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FakeApi.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FakeBigDecimalMap200Response.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FakeBigDecimalMap200Response.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FakeBigDecimalMap200Response.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FakeClassnameTags123Api.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FakeClassnameTags123Api.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FileSchemaTestClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FileSchemaTestClass.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Foo.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Foo.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Foo.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Foo.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FooGetDefaultResponse.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FooGetDefaultResponse.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/v3/se/docs/FormatTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/FormatTest.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/FormatTest.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/v3/se/docs/HasOnlyReadOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/HasOnlyReadOnly.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/v3/se/docs/HealthCheckResult.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/HealthCheckResult.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/MapTest.md b/samples/client/petstore/java-helidon-client/v3/se/docs/MapTest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/MapTest.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/MapTest.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v3/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Model200Response.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Model200Response.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Model200Response.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ModelApiResponse.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ModelApiResponse.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ModelFile.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ModelFile.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ModelFile.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelList.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ModelList.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ModelList.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ModelList.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ModelReturn.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ModelReturn.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Name.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Name.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Name.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Name.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/v3/se/docs/NullableClass.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/NullableClass.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/NullableClass.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/v3/se/docs/NumberOnly.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/NumberOnly.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ObjectWithDeprecatedFields.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ObjectWithDeprecatedFields.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/Order.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Order.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Order.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Order.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterComposite.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterComposite.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnum.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnum.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumDefaultValue.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumDefaultValue.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumInteger.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumInteger.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumIntegerDefaultValue.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterEnumIntegerDefaultValue.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/v3/se/docs/OuterObjectWithEnumProperty.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/OuterObjectWithEnumProperty.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ParentWithNullable.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ParentWithNullable.md similarity index 84% rename from samples/client/petstore/java-helidon-client/se/docs/ParentWithNullable.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java-helidon-client/se/docs/ParentWithNullable.md +++ b/samples/client/petstore/java-helidon-client/v3/se/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java-helidon-client/se/docs/Pet.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Pet.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/Pet.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/Pet.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/PetApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/PetApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/PetApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/PetApi.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/v3/se/docs/ReadOnlyFirst.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/ReadOnlyFirst.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/v3/se/docs/SingleRefType.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/SingleRefType.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/v3/se/docs/SpecialModelName.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/SpecialModelName.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/StoreApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/StoreApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/StoreApi.md diff --git a/samples/client/petstore/java-helidon-client/v3/se/docs/Tag.md b/samples/client/petstore/java-helidon-client/v3/se/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v3/se/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/v3/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/User.md b/samples/client/petstore/java-helidon-client/v3/se/docs/User.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/User.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/User.md diff --git a/samples/client/petstore/java-helidon-client/se/docs/UserApi.md b/samples/client/petstore/java-helidon-client/v3/se/docs/UserApi.md similarity index 100% rename from samples/client/petstore/java-helidon-client/se/docs/UserApi.md rename to samples/client/petstore/java-helidon-client/v3/se/docs/UserApi.md diff --git a/samples/client/petstore/java-helidon-client/se/pom.xml b/samples/client/petstore/java-helidon-client/v3/se/pom.xml similarity index 98% rename from samples/client/petstore/java-helidon-client/se/pom.xml rename to samples/client/petstore/java-helidon-client/v3/se/pom.xml index 860ad51810a..228466f175a 100644 --- a/samples/client/petstore/java-helidon-client/se/pom.xml +++ b/samples/client/petstore/java-helidon-client/v3/se/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-se - 3.0.1 + 3.2.7 petstore-helidon-client-se diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiClient.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiClient.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiResponse.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiResponse.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiResponseBase.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/ApiResponseBase.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/Pair.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/Pair.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/DefaultApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/DefaultApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/PetApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/PetApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/PetApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/PetApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/ResponseType.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/ResponseType.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/StoreApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/StoreApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/UserApi.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/UserApi.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/UserApiImpl.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/api/UserApiImpl.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Animal.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Animal.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ArrayTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Capitalization.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Capitalization.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Cat.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Cat.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Category.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Category.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ClassModel.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ClassModel.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Client.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Client.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Dog.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Dog.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumArrays.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumArrays.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumClass.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/EnumTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Foo.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Foo.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FormatTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/FormatTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/MapTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/MapTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Model200Response.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Model200Response.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelFile.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelFile.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelList.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelList.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelReturn.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ModelReturn.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Name.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Name.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/NullableClass.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/NullableClass.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/NumberOnly.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/NumberOnly.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Order.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Order.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterComposite.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterComposite.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnum.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnum.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java similarity index 97% rename from samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 25c24ff8602..d22980be614 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -31,7 +31,7 @@ public class ParentWithNullable { public enum TypeEnum { - CHILDWITHNULLABLE(String.valueOf("ChildWithNullable")); + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); String value; diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Pet.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Pet.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/SingleRefType.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/SingleRefType.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/SpecialModelName.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/SpecialModelName.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Tag.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/Tag.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/User.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java rename to samples/client/petstore/java-helidon-client/v3/se/src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/FakeApiTest.java similarity index 82% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/FakeApiTest.java index c4dfd1fcf85..daeb2b708ff 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,8 +14,10 @@ package org.openapitools.client.api; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; @@ -26,6 +28,7 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; @@ -64,6 +67,22 @@ public class FakeApiTest { api = FakeApiImpl.create(apiClient); } + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeBigDecimalMap(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + /** * Health check endpoint */ @@ -190,6 +209,24 @@ public class FakeApiTest { // TODO: test validations } + /** + * test referenced additionalProperties + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // TODO - assign values to the input arguments. + Map requestBody = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testAdditionalPropertiesReference(requestBody); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + /** * * For this test, the body has to be a binary file. @@ -387,6 +424,24 @@ public class FakeApiTest { // TODO: test validations } + /** + * test inline free-form additionalProperties + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // TODO - assign values to the input arguments. + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + /** * test json serialization of form data * @@ -407,6 +462,24 @@ public class FakeApiTest { // TODO: test validations } + /** + * test nullable parent property + * + */ + @Test + public void testNullableTest() { + // TODO - assign values to the input arguments. + ChildWithNullable childWithNullable = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testNullable(childWithNullable); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + /** * * To test the collection format in query parameters @@ -437,4 +510,22 @@ public class FakeApiTest { // TODO: test validations } + /** + * test referenced string map + * + */ + @Test + public void testStringMapReferenceTest() { + // TODO - assign values to the input arguments. + Map requestBody = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testStringMapReference(requestBody); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + } diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/PetApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/PetApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/StoreApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/StoreApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/UserApiTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/api/UserApiTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 008d620d506..7f291540411 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -23,7 +23,6 @@ import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for AdditionalPropertiesClass */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index ad55c6f2c7d..709ed248c3d 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.SingleRefType; import org.junit.jupiter.api.Test; - /** * Model tests for AllOfWithSingleRef */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AnimalTest.java similarity index 94% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AnimalTest.java index c38a031c2ee..fb63d5826c2 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,12 +21,9 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; import org.junit.jupiter.api.Test; - /** * Model tests for Animal */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 5a886da823a..c101bb32ced 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -20,11 +20,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfArrayOfNumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 6b0d615c0ee..9d0fb9edf4c 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -20,11 +20,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfNumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java index be3f20c9a37..5383565a80f 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayTest */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 18e9b9dbf0c..9197586ba93 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Capitalization */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CatTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CatTest.java index d78fcb63591..4b42f739457 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CatTest.java @@ -25,7 +25,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Cat */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CategoryTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CategoryTest.java index 12d4b6a6441..56aac4351d0 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Category */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClassModelTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClassModelTest.java index 035b80969f6..1811595c423 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ClassModel */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClientTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClientTest.java index 9b4899ae227..91cf48da972 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ClientTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Client */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index 54347091cc7..6164386e74c 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for DeprecatedObject */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DogTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DogTest.java index 6819c78158a..db2d706f7c0 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/DogTest.java @@ -25,7 +25,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Dog */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 4d249658722..92c16197a69 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -19,11 +19,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for EnumArrays */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumClassTest.java index 11bf230be71..fcc2b414936 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for EnumClass */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumTestTest.java similarity index 97% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumTestTest.java index ec0d37ce367..d0e89364e96 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -24,12 +24,10 @@ import org.openapitools.client.model.OuterEnumInteger; import org.openapitools.client.model.OuterEnumIntegerDefaultValue; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for EnumTest */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 846646eb944..bf520789104 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -19,12 +19,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; import org.junit.jupiter.api.Test; - /** * Model tests for FileSchemaTestClass */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 14639567d81..46605ccd462 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.Foo; import org.junit.jupiter.api.Test; - /** * Model tests for FooGetDefaultResponse */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooTest.java index 6ad35f67e28..2fefdd23102 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FooTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Foo */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FormatTestTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FormatTestTest.java index 773e76967ef..a6acb49c365 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -26,7 +26,6 @@ import java.util.UUID; import org.junit.jupiter.api.Test; - /** * Model tests for FormatTest */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index b956d12d747..09c18c0a082 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for HasOnlyReadOnly */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java similarity index 96% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 3267defa3a6..3efed3019ac 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -20,12 +20,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for HealthCheckResult */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MapTestTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MapTestTest.java index ac308e40089..9ccbfde6765 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -23,7 +23,6 @@ import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for MapTest */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 72a7a2a961c..785ef99658f 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -26,7 +26,6 @@ import org.openapitools.client.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 79bd883d4c4..4014471af25 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Model200Response */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 79b915c9675..2e3d402ff27 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelApiResponse */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelFileTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelFileTest.java index c10fa3927e3..bd6ef680022 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelFile */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelListTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelListTest.java index 7c09d2e78e8..b8ec3ecd7bc 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelList */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 8c99cb5220f..e1d4e18788b 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ModelReturn */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NameTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NameTest.java index 8795299bfae..396f82dc643 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NameTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Name */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NullableClassTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NullableClassTest.java index 95997f952e7..694c5a49fce 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -22,17 +22,16 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import org.junit.jupiter.api.Test; - /** * Model tests for NullableClass */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index f1af4caf2ec..40f55c0d0d0 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -22,7 +22,6 @@ import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for NumberOnly */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index 14f312e38a6..7b8cf33e6e7 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -20,12 +20,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; import org.junit.jupiter.api.Test; - /** * Model tests for ObjectWithDeprecatedFields */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OrderTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OrderTest.java index e99bf8d598d..7521c5e5806 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OrderTest.java @@ -22,7 +22,6 @@ import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; - /** * Model tests for Order */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 28b832d5db9..37dc9deb32f 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -22,7 +22,6 @@ import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for OuterComposite */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 75313d6581d..3700a01dcd6 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumDefaultValue */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index df4527f0d49..1d2f7440113 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumIntegerDefaultValue */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 87c29d2fd72..f12081aad69 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumInteger */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java index 226fc34f402..b65122cea12 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnum */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 24984008abf..9bafdc4b5d8 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -22,7 +22,6 @@ import org.openapitools.client.model.OuterEnumInteger; import org.junit.jupiter.api.Test; - /** * Model tests for OuterObjectWithEnumProperty */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/PetTest.java similarity index 98% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/PetTest.java index 6de3524dcc4..0f2970f254b 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -28,7 +29,6 @@ import org.openapitools.client.model.Tag; import org.junit.jupiter.api.Test; - /** * Model tests for Pet */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 332a1b116c7..3bbb4d28ac4 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for ReadOnlyFirst */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 82f51f683de..ed805286a01 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -16,7 +16,6 @@ package org.openapitools.client.model; import org.junit.jupiter.api.Test; - /** * Model tests for SingleRefType */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index e1d4d10b94f..2aa6eaf5ab2 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for SpecialModelName */ diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/TagTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/TagTest.java index ff32e6c114f..e203d6bf42b 100644 --- a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/TagTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for Tag */ diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java similarity index 100% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/UserTest.java similarity index 99% rename from samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java rename to samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/UserTest.java index 32404a5e38e..c8827f4e71d 100644 --- a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java-helidon-client/v3/se/src/test/java/org/openapitools/client/model/UserTest.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.junit.jupiter.api.Test; - /** * Model tests for User */ diff --git a/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/FILES new file mode 100644 index 00000000000..11d4e6e441f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/FILES @@ -0,0 +1,120 @@ +README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/ApiException.java +src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildWithNullable.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/client/model/ParentWithNullable.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java-helidon-client/v4/mp/README.md b/samples/client/petstore/java-helidon-client/v4/mp/README.md new file mode 100644 index 00000000000..18c68cbe838 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/README.md @@ -0,0 +1,7 @@ +# OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +## Overview +This project was generated using the Helidon OpenAPI Generator. diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..fe69a56eebf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..4146d56a372 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Animal.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Animal.md new file mode 100644 index 00000000000..d9b32f14c88 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..86cfd1bdc7c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/AnotherFakeApi.md @@ -0,0 +1,44 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..0188db3eb13 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..a5753530aad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayTest.md new file mode 100644 index 00000000000..36077c9df30 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Capitalization.md new file mode 100644 index 00000000000..82a812711de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Cat.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Cat.md new file mode 100644 index 00000000000..390dd519c8c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Category.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Category.md new file mode 100644 index 00000000000..ab6d1ec334d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ChildWithNullable.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ChildWithNullable.md new file mode 100644 index 00000000000..73c0dd6d473 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ClassModel.md new file mode 100644 index 00000000000..af46dea1f6c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Client.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Client.md new file mode 100644 index 00000000000..ef07b4ab8b9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/DefaultApi.md new file mode 100644 index 00000000000..d94c3e5f15b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/DefaultApi.md @@ -0,0 +1,39 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/DeprecatedObject.md new file mode 100644 index 00000000000..48de1d62442 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Dog.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Dog.md new file mode 100644 index 00000000000..972c981c0d0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumArrays.md new file mode 100644 index 00000000000..b2222d5beb2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumClass.md new file mode 100644 index 00000000000..b314590a759 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumTest.md new file mode 100644 index 00000000000..380a2aef0bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeApi.md new file mode 100644 index 00000000000..4cdd475689d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeApi.md @@ -0,0 +1,826 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> void fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> void testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testBodyWithBinary + +> void testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of form data + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> void testNullable(childWithNullable) + +test nullable parent property + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> void testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 00000000000..475be1d2d73 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..bcea773b6fb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FakeClassnameTags123Api.md @@ -0,0 +1,44 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..85d1a063669 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Foo.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Foo.md new file mode 100644 index 00000000000..6b3f0556528 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/webclient/docs/InlineResponseDefault.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FooGetDefaultResponse.md similarity index 87% rename from samples/client/petstore/java/webclient/docs/InlineResponseDefault.md rename to samples/client/petstore/java-helidon-client/v4/mp/docs/FooGetDefaultResponse.md index 41cadb0373c..ff3d7a3a56c 100644 --- a/samples/client/petstore/java/webclient/docs/InlineResponseDefault.md +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FooGetDefaultResponse.md @@ -1,6 +1,6 @@ -# InlineResponseDefault +# FooGetDefaultResponse ## Properties diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/FormatTest.md new file mode 100644 index 00000000000..01b8c777ae0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..29da5205dbb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/HealthCheckResult.md new file mode 100644 index 00000000000..4885e6f1cad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/MapTest.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/MapTest.md new file mode 100644 index 00000000000..54380188e1d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a5ddf0faa6a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Model200Response.md new file mode 100644 index 00000000000..109411580c6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelApiResponse.md new file mode 100644 index 00000000000..e374c2dd2de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelFile.md new file mode 100644 index 00000000000..adcde984f52 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelList.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelList.md new file mode 100644 index 00000000000..f93ab7dde8d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelReturn.md new file mode 100644 index 00000000000..0bd356861eb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Name.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Name.md new file mode 100644 index 00000000000..c901d943530 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/NullableClass.md new file mode 100644 index 00000000000..fa98c5c6d98 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/NumberOnly.md new file mode 100644 index 00000000000..b8ed1a4cfae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..f1cf571f4c0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Order.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Order.md new file mode 100644 index 00000000000..27af32855c5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterComposite.md new file mode 100644 index 00000000000..98b56e0763f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnum.md new file mode 100644 index 00000000000..1f9b723eb8e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..cbc7f4ba54d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..f71dea30ad0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..99e6389f427 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..0fafaaa2715 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ParentWithNullable.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ParentWithNullable.md new file mode 100644 index 00000000000..e4d32298563 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Pet.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Pet.md new file mode 100644 index 00000000000..54af77a9f5a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **Set<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/PetApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/PetApi.md new file mode 100644 index 00000000000..2f1e3c02a2e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/PetApi.md @@ -0,0 +1,349 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> void addPet(pet) + +Add a new pet to the store + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> void deletePet(petId, apiKey) + +Deletes a pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> void updatePet(pet) + +Update an existing pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..ad6af7ee155 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/SingleRefType.md new file mode 100644 index 00000000000..cc269bb871f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/SpecialModelName.md new file mode 100644 index 00000000000..4b6a06e3622 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/StoreApi.md new file mode 100644 index 00000000000..f306d5948cc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/StoreApi.md @@ -0,0 +1,153 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/Tag.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/User.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/User.md new file mode 100644 index 00000000000..08813e4b10b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/User.md @@ -0,0 +1,20 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/docs/UserApi.md b/samples/client/petstore/java-helidon-client/v4/mp/docs/UserApi.md new file mode 100644 index 00000000000..5f33613cbe5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/docs/UserApi.md @@ -0,0 +1,300 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> void createUser(user) + +Create user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithArrayInput + +> void createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithListInput + +> void createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## deleteUser + +> void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> void logoutUser() + +Logs out current logged in user session + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## updateUser + +> void updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/pom.xml b/samples/client/petstore/java-helidon-client/v4/mp/pom.xml new file mode 100644 index 00000000000..f9d8a53e5a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-mp + 4.0.8 + + + petstore-helidon-client-mp + petstore-helidon-client-mp + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + jar + + + 0.2.6 + + + + + io.helidon.microprofile.rest-client + helidon-microprofile-rest-client + + + io.helidon.microprofile.config + helidon-microprofile-config + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.json + jakarta.json-api + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + io.smallrye + jandex-maven-plugin + + + make-index + + + + + + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..71c7449b406 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..dd96c18c0d3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..c2a678cc0f0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Client; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/another-fake/dummy") +public interface AnotherFakeApi { + + /** + * To test special tags + * To test special tags and operation ID starting with number + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiException.java new file mode 100644 index 00000000000..c05f1ebf842 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiException.java @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.Response; + +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private final Response response; + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java new file mode 100644 index 00000000000..4c425b56695 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.Provider; + +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..a53eaf73daf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,44 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.FooGetDefaultResponse; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/foo") +public interface DefaultApi { + + @GET + + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 00000000000..717ed943691 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,213 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake") +public interface FakeApi { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException, ProcessingException; + + /** + * Health check endpoint + */ + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; + + /** + * test http signature authentication + */ + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException, ProcessingException; + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(String body) throws ApiException, ProcessingException; + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + + /** + * test referenced additionalProperties + * + */ + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + void testAdditionalPropertiesReference(Map requestBody) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(File body) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") String query, User user) throws ApiException, ProcessingException; + + /** + * To test \"client\" model + * To test \"client\" model + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(Client client) throws ApiException, ProcessingException; + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + @POST + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@FormParam("number") BigDecimal number, @FormParam("double") Double _double, @FormParam("pattern_without_delimiter") String patternWithoutDelimiter, @FormParam("byte") byte[] _byte, @FormParam("integer") Integer integer, @FormParam("int32") Integer int32, @FormParam("int64") Long int64, @FormParam("float") Float _float, @FormParam("string") String string, @FormParam("binary") File binary, @FormParam("date") LocalDate date, @FormParam("dateTime") OffsetDateTime dateTime, @FormParam("password") String password, @FormParam("callback") String paramCallback) throws ApiException, ProcessingException; + + /** + * To test enum parameters + * To test enum parameters + */ + @GET + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam("enum_form_string_array") List enumFormStringArray, @FormParam("enum_form_string") String enumFormString) throws ApiException, ProcessingException; + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + */ + @DELETE + + void testGroupParameters(@QueryParam("required_string_group") Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group) throws ApiException, ProcessingException; + + /** + * test inline additionalProperties + * + */ + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + + /** + * test inline free-form additionalProperties + * + */ + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException, ProcessingException; + + /** + * test json serialization of form data + * + */ + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@FormParam("param") String param, @FormParam("param2") String param2) throws ApiException, ProcessingException; + + /** + * test nullable parent property + * + */ + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + void testNullable(ChildWithNullable childWithNullable) throws ApiException, ProcessingException; + + @PUT + @Path("/test-query-parameters") + void testQueryParameterCollectionFormat(@QueryParam("pipe") List pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; + + /** + * test referenced string map + * + */ + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(Map requestBody) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..aaeb4a55e40 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Client; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake_classname_test") +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * To test class name in snake case + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..0248f2e6912 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,126 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("") +public interface PetApi { + + /** + * Add a new pet to the store + * + */ + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void addPet(Pet pet) throws ApiException, ProcessingException; + + /** + * Deletes a pet + * + */ + @DELETE + @Path("/pet/{petId}") + void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + */ + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + List findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @deprecated + */ + @Deprecated + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + Set findPetsByTags(@QueryParam("tags") Set tags) throws ApiException, ProcessingException; + + /** + * Find pet by ID + * Returns a single pet + */ + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; + + /** + * Update an existing pet + * + */ + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void updatePet(Pet pet) throws ApiException, ProcessingException; + + /** + * Updates a pet in the store with form data + * + */ + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + void updatePetWithForm(@PathParam("petId") Long petId, @FormParam("name") String name, @FormParam("status") String status) throws ApiException, ProcessingException; + + /** + * uploads an image + * + */ + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFile(@PathParam("petId") Long petId, @FormParam("additionalMetadata") String additionalMetadata, @FormParam("file") File _file) throws ApiException, ProcessingException; + + /** + * uploads an image (required) + * + */ + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam("requiredFile") File requiredFile, @FormParam("additionalMetadata") String additionalMetadata) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..b6f3f383a4d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Order; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/store") +public interface StoreApi { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @DELETE + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId) throws ApiException, ProcessingException; + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Map getInventory() throws ApiException, ProcessingException; + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + */ + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + Order getOrderById(@PathParam("order_id") Long orderId) throws ApiException, ProcessingException; + + /** + * Place an order for a pet + * + */ + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Order placeOrder(Order order) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..48e64286d87 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,110 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

    This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/user") +public interface UserApi { + + /** + * Create user + * This can only be done by the logged in user. + */ + @POST + + @Consumes({ "application/json" }) + void createUser(User user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + */ + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + void createUsersWithArrayInput(List user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + */ + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + void createUsersWithListInput(List user) throws ApiException, ProcessingException; + + /** + * Delete user + * This can only be done by the logged in user. + */ + @DELETE + @Path("/{username}") + void deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Get user by user name + * + */ + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + User getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Logs user into the system + * + */ + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + String loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException; + + /** + * Logs out current logged in user session + * + */ + @GET + @Path("/logout") + void logoutUser() throws ApiException, ProcessingException; + + /** + * Updated user + * This can only be done by the logged in user. + */ + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + void updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..abc3d296fa3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class AdditionalPropertiesClass { + + private Map mapProperty = null; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + **/ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + **/ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..cb7b8b0a681 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + + + + +public class AllOfWithSingleRef { + + private String username; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + **/ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 00000000000..52742a478bb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Animal { + + private String className; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + /** + * Set className + **/ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + **/ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..80114154d94 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + **/ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..b06f05338a4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + + +public class ArrayOfNumberOnly { + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + **/ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 00000000000..d9ee320b0bd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,138 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + + + + +public class ArrayTest { + + private List arrayOfString = null; + + private List> arrayArrayOfInteger = null; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + **/ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + **/ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + **/ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 00000000000..f6d3fde93d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,191 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Capitalization { + + private String smallCamel; + + private String capitalCamel; + + private String smallSnake; + + private String capitalSnake; + + private String scAETHFlowPoints; + + /** + * Name of the pet + **/ + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + **/ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + **/ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + **/ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + **/ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + **/ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + **/ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..be9c6954561 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..8da99011104 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Category { + + private Long id; + + private String name = "default-name"; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 00000000000..90b2f7ceb09 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,78 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; + + + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + **/ + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 00000000000..de44db959bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model with \"_class\" property + **/ + +public class ClassModel { + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 00000000000..0ad715df8de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Client { + + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + **/ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 00000000000..aaaed8e7f3e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class DeprecatedObject { + + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..069dab8392d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Dog extends Animal { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 00000000000..38d88dc16fd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,146 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + + + + +public class EnumArrays { + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private JustSymbolEnum justSymbol; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + **/ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + **/ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 00000000000..eed52272f70 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 00000000000..538f09adced --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,325 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + + + + +public class EnumTest { + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringEnum enumString; + +public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringRequiredEnum enumStringRequired; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumIntegerEnum enumInteger; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumNumberEnum enumNumber; + + private OuterEnum outerEnum; + + private OuterEnumInteger outerEnumInteger; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + **/ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + **/ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + **/ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + **/ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + **/ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + **/ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + **/ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + **/ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..f671eb33e5c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + + + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + **/ + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + **/ + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + this.someMap.put(key, someMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..f867e747aab --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; + + + + +public class FileSchemaTestClass { + + private ModelFile _file; + + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + **/ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + **/ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + this.files.add(filesItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 00000000000..fcafaf7682c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Foo { + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + **/ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..27971dae916 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + + + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + **/ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 00000000000..1f3fc84b65a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,439 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + + + + +public class FormatTest { + + private Integer integer; + + private Integer int32; + + private Long int64; + + private BigDecimal number; + + private Float _float; + + private Double _double; + + private BigDecimal decimal; + + private String string; + + private byte[] _byte; + + private File binary; + + private LocalDate date; + + private OffsetDateTime dateTime; + + private UUID uuid; + + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + /** + * Set integer + **/ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + **/ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + **/ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + **/ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + /** + * Set _float + **/ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + /** + * Set _double + **/ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + **/ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + /** + * Set string + **/ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + **/ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + **/ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public LocalDate getDate() { + return date; + } + + /** + * Set date + **/ + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + **/ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + **/ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..72566c02dde --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class HasOnlyReadOnly { + + private String bar; + + private String foo; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 00000000000..35e104b4b12 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + + + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + **/ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 00000000000..ec54a8ae421 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,185 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class MapTest { + + private Map> mapMapOfString = null; + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private Map mapOfEnumString = null; + + private Map directMap = null; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + **/ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + **/ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + **/ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + **/ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..de307d1e286 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,129 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + + + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + + private OffsetDateTime dateTime; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + **/ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 00000000000..393f65f83e9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name starting with number + **/ + +public class Model200Response { + + private Integer name; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..881fc2677d2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,119 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelApiResponse { + + private Integer code; + + private String type; + + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + **/ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + **/ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 00000000000..3c1cf785ea5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Must be named `File` for test. + **/ + +public class ModelFile { + + /** + * Test capitalization + **/ + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + **/ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 00000000000..0c2e7ffb39d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelList { + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + **/ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 00000000000..7d948f62e2c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing reserved words + **/ + +public class ModelReturn { + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + **/ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 00000000000..ba07eb91523 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name same as property name + **/ + +public class Name { + + private Integer name; + + private Integer snakeCase; + + private String property; + + private Integer _123number; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + **/ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 00000000000..91af4dd3894 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,367 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + + + + +public class NullableClass extends HashMap { + + private Integer integerProp; + + private BigDecimal numberProp; + + private Boolean booleanProp; + + private String stringProp; + + private LocalDate dateProp; + + private OffsetDateTime datetimeProp; + + private List arrayNullableProp = null; + + private List arrayAndItemsNullableProp = null; + + private List arrayItemsNullable = null; + + private Map objectNullableProp = null; + + private Map objectAndItemsNullableProp = null; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + **/ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + **/ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + **/ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + **/ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public LocalDate getDateProp() { + return dateProp; + } + + /** + * Set dateProp + **/ + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + **/ + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + **/ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + **/ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + **/ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + **/ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + **/ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + **/ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 00000000000..5d493bccf26 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + **/ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..254b7df22cb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,158 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + + + + +public class ObjectWithDeprecatedFields { + + private String uuid; + + private BigDecimal id; + + private DeprecatedObject deprecatedRef; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + **/ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + **/ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + **/ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + this.bars.add(barsItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..84ce8e3fa1f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,213 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + + + + +public class Order { + + private Long id; + + private Long petId; + + private Integer quantity; + + private OffsetDateTime shipDate; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * Order Status + **/ + private StatusEnum status; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public OffsetDateTime getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 00000000000..6ba3d1712d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,120 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class OuterComposite { + + private BigDecimal myNumber; + + private String myString; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + **/ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + **/ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + **/ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 00000000000..9fe96db3f6e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..f5b732f784f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 00000000000..0ca88b32ee6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..06f9fe6c371 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..b25e8e37ae7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + + + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + **/ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 00000000000..d22980be614 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + + + + +public class ParentWithNullable { + +public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private TypeEnum type; + + private String nullableProperty; + + /** + * Get type + * @return type + **/ + public TypeEnum getType() { + return type; + } + + /** + * Set type + **/ + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + **/ + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..3960d437277 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,231 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + + + + +public class Pet { + + private Long id; + + private Category category; + + private String name; + + private Set photoUrls = new LinkedHashSet<>(); + + private List tags = null; + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * pet status in the store + **/ + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + public Set getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + **/ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..15344cbf0dc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ReadOnlyFirst { + + private String bar; + + private String baz; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + **/ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 00000000000..d46fc6c116f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 00000000000..af5166268f7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + **/ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..1dee37e3936 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Tag { + + private Long id; + + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..e46c4bb382d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..c088a4d15d5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class User { + + private Long id; + + private String username; + + private String firstName; + + private String lastName; + + private String email; + + private String password; + + private String phone; + + /** + * User Status + **/ + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + **/ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..ce1d8264fb5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private static AnotherFakeApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(AnotherFakeApi.class); + } + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws Exception { + //Client response = client.call123testSpecialTags(client); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..26e73e54574 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private static DefaultApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(DefaultApi.class); + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() throws Exception { + //FooGetDefaultResponse response = client.fooGet(); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 00000000000..1a717f22c91 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,328 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private static FakeApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeApi.class); + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() throws Exception { + //FakeBigDecimalMap200Response response = client.fakeBigDecimalMap(); + //assertNotNull(response); + } + + /** + * Health check endpoint + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws Exception { + //HealthCheckResult response = client.fakeHealthGet(); + //assertNotNull(response); + } + + /** + * test http signature authentication + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHttpSignatureTestTest() throws Exception { + //void response = client.fakeHttpSignatureTest(pet, query1, header1); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws Exception { + //Boolean response = client.fakeOuterBooleanSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws Exception { + //OuterComposite response = client.fakeOuterCompositeSerialize(outerComposite); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws Exception { + //BigDecimal response = client.fakeOuterNumberSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws Exception { + //String response = client.fakeOuterStringSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() throws Exception { + //OuterObjectWithEnumProperty response = client.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //assertNotNull(response); + } + + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() throws Exception { + //void response = client.testAdditionalPropertiesReference(requestBody); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithBinaryTest() throws Exception { + //void response = client.testBodyWithBinary(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws Exception { + //void response = client.testBodyWithFileSchema(fileSchemaTestClass); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws Exception { + //void response = client.testBodyWithQueryParams(query, user); + //assertNotNull(response); + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws Exception { + //Client response = client.testClientModel(client); + //assertNotNull(response); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws Exception { + //void response = client.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //assertNotNull(response); + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws Exception { + //void response = client.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //assertNotNull(response); + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws Exception { + //void response = client.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //assertNotNull(response); + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws Exception { + //void response = client.testInlineAdditionalProperties(requestBody); + //assertNotNull(response); + } + + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() throws Exception { + //void response = client.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //assertNotNull(response); + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws Exception { + //void response = client.testJsonFormData(param, param2); + //assertNotNull(response); + } + + /** + * test nullable parent property + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testNullableTest() throws Exception { + //void response = client.testNullable(childWithNullable); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws Exception { + //void response = client.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //assertNotNull(response); + } + + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() throws Exception { + //void response = client.testStringMapReference(requestBody); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 00000000000..bc5ecc08403 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private static FakeClassnameTags123Api client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeClassnameTags123Api.class); + } + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws Exception { + //Client response = client.testClassname(client); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..66959d421f7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,179 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for PetApi + */ +public class PetApiTest { + + private static PetApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(PetApi.class); + } + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws Exception { + //void response = client.addPet(pet); + //assertNotNull(response); + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws Exception { + //void response = client.deletePet(petId, apiKey); + //assertNotNull(response); + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws Exception { + //List response = client.findPetsByStatus(status); + //assertNotNull(response); + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws Exception { + //Set response = client.findPetsByTags(tags); + //assertNotNull(response); + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws Exception { + //Pet response = client.getPetById(petId); + //assertNotNull(response); + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws Exception { + //void response = client.updatePet(pet); + //assertNotNull(response); + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws Exception { + //void response = client.updatePetWithForm(petId, name, status); + //assertNotNull(response); + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws Exception { + //ModelApiResponse response = client.uploadFile(petId, additionalMetadata, _file); + //assertNotNull(response); + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws Exception { + //ModelApiResponse response = client.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..f9a8bd7ab11 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,106 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private static StoreApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(StoreApi.class); + } + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws Exception { + //void response = client.deleteOrder(orderId); + //assertNotNull(response); + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws Exception { + //Map response = client.getInventory(); + //assertNotNull(response); + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws Exception { + //Order response = client.getOrderById(orderId); + //assertNotNull(response); + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws Exception { + //Order response = client.placeOrder(order); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..dfbfc41d41b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,163 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for UserApi + */ +public class UserApiTest { + + private static UserApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(UserApi.class); + } + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws Exception { + //void response = client.createUser(user); + //assertNotNull(response); + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws Exception { + //void response = client.createUsersWithArrayInput(user); + //assertNotNull(response); + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws Exception { + //void response = client.createUsersWithListInput(user); + //assertNotNull(response); + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws Exception { + //void response = client.deleteUser(username); + //assertNotNull(response); + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws Exception { + //User response = client.getUserByName(username); + //assertNotNull(response); + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws Exception { + //String response = client.loginUser(username, password); + //assertNotNull(response); + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws Exception { + //void response = client.logoutUser(); + //assertNotNull(response); + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws Exception { + //void response = client.updateUser(username, user); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..7f291540411 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..709ed248c3d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 00000000000..fb63d5826c2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..c101bb32ced --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..9d0fb9edf4c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 00000000000..5383565a80f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 00000000000..9197586ba93 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,86 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..4b42f739457 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..56aac4351d0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 00000000000..68acb8c5234 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 00000000000..1811595c423 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 00000000000..91cf48da972 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..6164386e74c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..db2d706f7c0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 00000000000..92c16197a69 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 00000000000..fcc2b414936 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 00000000000..d0e89364e96 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,109 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 00000000000..f7674730f57 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..bf520789104 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..46605ccd462 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 00000000000..2fefdd23102 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 00000000000..a6acb49c365 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,171 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..09c18c0a082 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..3efed3019ac --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 00000000000..9ccbfde6765 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,72 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..785ef99658f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 00000000000..4014471af25 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..2e3d402ff27 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,62 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 00000000000..bd6ef680022 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 00000000000..b8ec3ecd7bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 00000000000..e1d4e18788b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 00000000000..396f82dc643 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,70 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 00000000000..694c5a49fce --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,145 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 00000000000..40f55c0d0d0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..7b8cf33e6e7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..7521c5e5806 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,87 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 00000000000..37dc9deb32f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..3700a01dcd6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..1d2f7440113 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..f12081aad69 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 00000000000..b65122cea12 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..9bafdc4b5d8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 00000000000..a0fe79ed444 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..0f2970f254b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,94 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..3bbb4d28ac4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..ed805286a01 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..2aa6eaf5ab2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..e203d6bf42b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..4283de111c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..c8827f4e71d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,102 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml b/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml +++ b/samples/client/petstore/java/apache-httpclient/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/apache-httpclient/docs/ParentWithNullable.md b/samples/client/petstore/java/apache-httpclient/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/apache-httpclient/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/apache-httpclient/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/apache-httpclient/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/apache-httpclient/gradlew b/samples/client/petstore/java/apache-httpclient/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/apache-httpclient/gradlew +++ b/samples/client/petstore/java/apache-httpclient/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/apache-httpclient/gradlew.bat b/samples/client/petstore/java/apache-httpclient/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/apache-httpclient/gradlew.bat +++ b/samples/client/petstore/java/apache-httpclient/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/apache-httpclient/pom.xml b/samples/client/petstore/java/apache-httpclient/pom.xml index a619f987ac6..487bc0bba13 100644 --- a/samples/client/petstore/java/apache-httpclient/pom.xml +++ b/samples/client/petstore/java/apache-httpclient/pom.xml @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.2.5 @@ -84,7 +84,6 @@ -Xms512m -Xmx1500m methods 10 - pertest @@ -244,11 +243,11 @@ jackson-jaxrs-json-provider ${jackson-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + org.openapitools jackson-databind-nullable @@ -262,8 +261,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -275,6 +274,6 @@ 2.15.2 0.2.6 1.3.5 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 9a59a1b930c..9f66d5da617 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import java.time.OffsetDateTime; -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; @@ -871,7 +870,7 @@ public class ApiClient extends JavaTimeFormatter { } return objectMapper.readValue(content, valueType); - } else if ("text/plain".equalsIgnoreCase(mimeType)) { + } else if (mimeType.toLowerCase().startsWith("text/")) { // convert input stream to string return (T) EntityUtils.toString(entity); } else { diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5f7333cfbb7..84de2a4f670 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -79,7 +79,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 4f1897290bd..980be8ec243 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -70,7 +70,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java index bee80ae983f..30e7337ce5c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Animal.java @@ -52,7 +52,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -82,7 +82,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 751495432c9..3bb3331b52d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -85,7 +85,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -119,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java index 3da9f5b4537..4851d3a039a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -85,7 +85,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -111,7 +110,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -137,7 +135,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -163,7 +160,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -189,7 +185,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java index 96ddf0c8245..41b54c7ec7f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Category.java @@ -69,7 +69,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 67e188cbb86..695ca7dd9f0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -142,7 +142,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java index 622c74ba48a..4e7ba2a256e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -246,7 +246,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -272,7 +271,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -298,7 +296,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -324,7 +321,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -358,7 +354,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -384,7 +379,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -410,7 +404,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 9b8372641cf..e1de2fcf94f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -73,7 +73,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index b950cbde21a..7dec3c6b5c5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -73,7 +73,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java index 939300a26f4..ab205f9d34c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -133,7 +133,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -161,7 +160,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -187,7 +185,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -215,7 +212,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -243,7 +239,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -271,7 +266,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -297,7 +291,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -323,7 +316,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -349,7 +341,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -375,7 +366,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -401,7 +391,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -427,7 +416,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -453,7 +441,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -479,7 +466,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -505,7 +491,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 14bde270f37..dde8ec31120 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -44,7 +44,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -69,7 +71,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java index 26d005501f3..8288e44202d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -122,7 +122,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -156,7 +155,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -190,7 +188,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a505ff7158d..59d1e25e1da 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -78,7 +78,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -104,7 +103,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java index 5121fb01b4f..e81885ce408 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -70,7 +70,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ac24b06c2ca..ccea22fa758 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -74,7 +74,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -100,7 +99,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java index aacb72c6bda..9dbce4f2d3f 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Name.java @@ -51,7 +51,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -87,7 +89,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -102,7 +103,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -128,7 +128,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java index c491c761e68..ddd30b29fda 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -130,7 +130,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -164,7 +163,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -198,7 +196,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -232,7 +229,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -266,7 +262,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -300,7 +295,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -346,7 +340,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -392,7 +385,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -426,7 +418,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -472,7 +463,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -518,7 +508,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index f721d76b63c..2f20ee169ae 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -82,7 +82,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -110,7 +109,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -138,7 +136,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java index cdfb7c11d0b..f22051c7afb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Order.java @@ -123,7 +123,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -149,7 +148,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -175,7 +173,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -201,7 +198,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -227,7 +223,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 941c8723e84..4a4ceb09ff8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -74,7 +74,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -100,7 +99,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 850e6380166..5e14211369a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -55,7 +55,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -88,7 +88,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -118,7 +118,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java index e6a95e850ef..dd8a171628c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Pet.java @@ -130,7 +130,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -156,7 +155,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -182,7 +180,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -217,7 +214,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -251,7 +247,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 9b85f589349..b535252ceb7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,7 +43,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -66,7 +68,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java index 71e15a253c1..54d7b3628d8 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/Tag.java @@ -69,7 +69,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java index e774717a636..454b7c60aa9 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/User.java @@ -93,7 +93,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -119,7 +118,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -145,7 +143,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -171,7 +168,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -197,7 +193,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -223,7 +218,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -249,7 +243,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index e6db7f775a5..fa2ead53485 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +27,7 @@ import java.util.Map; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java index 32943c2bb91..a057e1c6ebb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -29,7 +29,7 @@ import java.util.Map; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java index 5bdb09bab41..dbc0cceb6eb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -26,9 +26,9 @@ import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -40,7 +40,7 @@ import java.util.Map; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 99d49a695dd..125162d60ca 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +27,7 @@ import java.util.Map; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/PetApiTest.java index 6a8c50258e6..50c24acbfad 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -18,9 +18,9 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.util.ArrayList; import java.util.HashMap; @@ -30,7 +30,7 @@ import java.util.Map; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/StoreApiTest.java index c7df74110db..5abd4f0bc88 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +27,7 @@ import java.util.Map; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/UserApiTest.java index cffd945d327..325d33fcc69 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +27,7 @@ import java.util.Map; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 4f6fd800ab7..832d746f72d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index 41e6497ecee..d4426e578e4 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index d2e17831ba7..9df6e6291a6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 14fd8022feb..11d4d7313ac 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 58b7521c6a7..7fce2f458ff 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 10ad938f52c..3d98032d55a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index bcbb9c54b27..ad7d482159a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index f7662d6c469..e4bebcd2389 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..8c231167d61 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AnimalTest.java index 930e5c17d07..2b04312bbeb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.BigCat; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..7d6ca2902ab 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..1db82cbdea3 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..4a3a3cc839a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..1f133e4142e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CatTest.java index 90fdba14c24..50037f54841 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CatTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; import org.openapitools.client.model.BigCat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..84df0f1e24d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec3..a109c6f7175 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..0efd2b03752 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..9fee039a47a 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..06d58640393 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..0f9f43fd3ca 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..bd426ae14b5 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..19518a5f665 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumTestTest.java index 8907cfa8e8f..223a3d674bb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..1792f6169d9 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..53b20d7bdd3 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..85c3e9a29e7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..b1825eb48eb 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java index 48bec93d994..ceaa76fef09 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,9 +23,9 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..9a76d3c9534 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9..d627568b70c 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,9 +22,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..c85527e8536 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..c5f70f4c8f0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,9 +23,9 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..0952e6472d0 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..d57f8680047 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..4b2d7105211 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..f39c6a118e3 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..a6968d2b87e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..39ff782a3ea 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..86e5a4e7249 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -29,9 +29,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..88a5503ccf9 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..72978f65097 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..17f411d1ede 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..11d7eeac3b7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..db6de4ebd34 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..44b97d47c2e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..908c8ce7e21 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..f7293142020 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..579a7f62fa7 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13..828d360428e 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -25,9 +25,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..a10e870d0fd 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/PetTest.java @@ -25,9 +25,9 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..11ab8eaf4fe 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..7db38f4f338 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..c5d7ce076d6 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..382a573036b 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9d..8e5a4ba75d2 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 8c096c188fc..07eccf57ece 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index b1655df6165..3ce00657e25 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..eccfbf5e126 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/XmlItemTest.java index 4bab95a9126..5dfb646e7f3 100644 --- a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml b/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml +++ b/samples/client/petstore/java/feign-no-nullable/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/feign-no-nullable/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/feign-no-nullable/gradlew b/samples/client/petstore/java/feign-no-nullable/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/feign-no-nullable/gradlew +++ b/samples/client/petstore/java/feign-no-nullable/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/feign-no-nullable/gradlew.bat b/samples/client/petstore/java/feign-no-nullable/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/feign-no-nullable/gradlew.bat +++ b/samples/client/petstore/java/feign-no-nullable/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/feign/.github/workflows/maven.yml b/samples/client/petstore/java/feign/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/feign/.github/workflows/maven.yml +++ b/samples/client/petstore/java/feign/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/feign/gradlew b/samples/client/petstore/java/feign/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/feign/gradlew +++ b/samples/client/petstore/java/feign/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/feign/gradlew.bat b/samples/client/petstore/java/feign/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/feign/gradlew.bat +++ b/samples/client/petstore/java/feign/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ParentWithNullable.java index c1a4b84f9ea..793e37fd082 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml b/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml +++ b/samples/client/petstore/java/google-api-client/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/google-api-client/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/google-api-client/gradlew b/samples/client/petstore/java/google-api-client/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/google-api-client/gradlew +++ b/samples/client/petstore/java/google-api-client/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/google-api-client/gradlew.bat b/samples/client/petstore/java/google-api-client/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/google-api-client/gradlew.bat +++ b/samples/client/petstore/java/google-api-client/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index f8b9e2bb139..3ba4ec5e7ff 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -66,7 +66,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -252,8 +251,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -267,6 +266,6 @@ 0.2.6 1.3.5 1.0.0 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 85f60180cf0..07369d6cefd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -114,7 +114,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -148,7 +147,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -182,7 +180,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -216,7 +213,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -250,7 +246,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -284,7 +279,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -318,7 +312,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -352,7 +345,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -378,7 +370,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -404,7 +395,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index d30c63a276a..711644819bf 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -50,7 +50,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -80,7 +80,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 154e6cc2374..41b29a30249 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..accb755a668 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index 892a7af3b94..121bba4519c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -45,7 +45,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..ed8e1e2da05 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index f03d7aefbce..58a77ffded8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index 49835bfbd44..53ee553f740 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -224,7 +224,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -250,7 +249,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -276,7 +274,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -302,7 +299,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f4f44fa76aa..e149084b1a5 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index e82eb94222c..9ad002a3da0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -122,7 +122,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -150,7 +149,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -176,7 +174,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -204,7 +201,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -232,7 +228,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -260,7 +255,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -286,7 +280,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -312,7 +305,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -338,7 +330,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -364,7 +355,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -390,7 +380,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -416,7 +405,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -442,7 +430,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..9fc24a2b7f4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 2b1642eb26e..136e37557dd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e059b95f066..4ec2bb53611 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..517b2eb9f07 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..c8f27c57192 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..458314f0d83 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..05dfbdaeefa 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..7045f92dd8f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index f3978908526..180ee4787ba 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d585c01ecc3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..201029ba21a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 31061ea6669..579da79a3e7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -82,7 +82,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -108,7 +107,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -134,7 +132,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -160,7 +157,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index aa5f1182b3e..4fb1973cb1b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -86,7 +86,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -112,7 +111,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -138,7 +136,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -164,7 +161,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -190,7 +186,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 8ed799606d5..b501d23345c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 841129b4231..92837b71b1c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -178,7 +178,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -204,7 +203,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -230,7 +228,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -256,7 +253,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -290,7 +286,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -316,7 +311,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -342,7 +336,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -368,7 +361,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -394,7 +386,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -428,7 +419,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -462,7 +452,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -488,7 +477,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -514,7 +502,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -540,7 +527,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -566,7 +552,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -600,7 +585,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -634,7 +618,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -660,7 +643,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -686,7 +668,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -712,7 +693,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -738,7 +718,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -772,7 +751,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -806,7 +784,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -832,7 +809,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -858,7 +834,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -884,7 +859,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -910,7 +884,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -944,7 +917,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index a6bcac74ff4..7f8e3bb8df9 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; import java.util.UUID; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -29,12 +29,10 @@ import java.util.Map; /** * API tests for AnotherFakeApi */ -@Ignore public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); - /** * To test special tags * @@ -47,9 +45,10 @@ public class AnotherFakeApiTest { public void call123testSpecialTagsTest() throws IOException { UUID uuidTest = null; Client body = null; - Client response = api.call123testSpecialTags(uuidTest, body); + // uncomment below to test the API function + //Client response = api.call123testSpecialTags(uuidTest, body); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java index 01fda5aac29..274dfffd529 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -22,8 +22,8 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -36,12 +36,10 @@ import java.util.Map; /** * API tests for FakeApi */ -@Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); - /** * creates an XmlItem * @@ -53,11 +51,12 @@ public class FakeApiTest { @Test public void createXmlItemTest() throws IOException { XmlItem xmlItem = null; - api.createXmlItem(xmlItem); + // uncomment below to test the API function + //api.createXmlItem(xmlItem); // TODO: test validations } - + /** * * @@ -69,11 +68,12 @@ public class FakeApiTest { @Test public void fakeOuterBooleanSerializeTest() throws IOException { Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); + // uncomment below to test the API function + //Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations } - + /** * * @@ -85,11 +85,12 @@ public class FakeApiTest { @Test public void fakeOuterCompositeSerializeTest() throws IOException { OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + // uncomment below to test the API function + //OuterComposite response = api.fakeOuterCompositeSerialize(body); // TODO: test validations } - + /** * * @@ -101,11 +102,12 @@ public class FakeApiTest { @Test public void fakeOuterNumberSerializeTest() throws IOException { BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body); + // uncomment below to test the API function + //BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations } - + /** * * @@ -117,11 +119,12 @@ public class FakeApiTest { @Test public void fakeOuterStringSerializeTest() throws IOException { String body = null; - String response = api.fakeOuterStringSerialize(body); + // uncomment below to test the API function + //String response = api.fakeOuterStringSerialize(body); // TODO: test validations } - + /** * * @@ -133,11 +136,12 @@ public class FakeApiTest { @Test public void testBodyWithFileSchemaTest() throws IOException { FileSchemaTestClass body = null; - api.testBodyWithFileSchema(body); + // uncomment below to test the API function + //api.testBodyWithFileSchema(body); // TODO: test validations } - + /** * * @@ -150,11 +154,12 @@ public class FakeApiTest { public void testBodyWithQueryParamsTest() throws IOException { String query = null; User body = null; - api.testBodyWithQueryParams(query, body); + // uncomment below to test the API function + //api.testBodyWithQueryParams(query, body); // TODO: test validations } - + /** * To test \"client\" model * @@ -166,11 +171,12 @@ public class FakeApiTest { @Test public void testClientModelTest() throws IOException { Client body = null; - Client response = api.testClientModel(body); + // uncomment below to test the API function + //Client response = api.testClientModel(body); // TODO: test validations } - + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -195,11 +201,12 @@ public class FakeApiTest { OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + // uncomment below to test the API function + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); // TODO: test validations } - + /** * To test enum parameters * @@ -218,11 +225,12 @@ public class FakeApiTest { Double enumQueryDouble = null; List enumFormStringArray = null; String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + // uncomment below to test the API function + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); // TODO: test validations } - + /** * Fake endpoint to test group parameters (optional) * @@ -239,11 +247,12 @@ public class FakeApiTest { Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + // uncomment below to test the API function + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); // TODO: test validations } - + /** * test inline additionalProperties * @@ -255,11 +264,12 @@ public class FakeApiTest { @Test public void testInlineAdditionalPropertiesTest() throws IOException { Map param = null; - api.testInlineAdditionalProperties(param); + // uncomment below to test the API function + //api.testInlineAdditionalProperties(param); // TODO: test validations } - + /** * test json serialization of form data * @@ -272,11 +282,12 @@ public class FakeApiTest { public void testJsonFormDataTest() throws IOException { String param = null; String param2 = null; - api.testJsonFormData(param, param2); + // uncomment below to test the API function + //api.testJsonFormData(param, param2); // TODO: test validations } - + /** * * @@ -292,9 +303,10 @@ public class FakeApiTest { List http = null; List url = null; List context = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // uncomment below to test the API function + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 7336706db7c..bd5f014616a 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,8 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -28,12 +28,10 @@ import java.util.Map; /** * API tests for FakeClassnameTags123Api */ -@Ignore public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); - /** * To test class name in snake case * @@ -45,9 +43,10 @@ public class FakeClassnameTags123ApiTest { @Test public void testClassnameTest() throws IOException { Client body = null; - Client response = api.testClassname(body); + // uncomment below to test the API function + //Client response = api.testClassname(body); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java index ee0ecc7df51..fceb8e3a158 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,8 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -31,12 +31,10 @@ import java.util.Map; /** * API tests for PetApi */ -@Ignore public class PetApiTest { private final PetApi api = new PetApi(); - /** * Add a new pet to the store * @@ -48,11 +46,12 @@ public class PetApiTest { @Test public void addPetTest() throws IOException { Pet body = null; - api.addPet(body); + // uncomment below to test the API function + //api.addPet(body); // TODO: test validations } - + /** * Deletes a pet * @@ -65,11 +64,12 @@ public class PetApiTest { public void deletePetTest() throws IOException { Long petId = null; String apiKey = null; - api.deletePet(petId, apiKey); + // uncomment below to test the API function + //api.deletePet(petId, apiKey); // TODO: test validations } - + /** * Finds Pets by status * @@ -81,11 +81,12 @@ public class PetApiTest { @Test public void findPetsByStatusTest() throws IOException { List status = null; - List response = api.findPetsByStatus(status); + // uncomment below to test the API function + //List response = api.findPetsByStatus(status); // TODO: test validations } - + /** * Finds Pets by tags * @@ -97,11 +98,12 @@ public class PetApiTest { @Test public void findPetsByTagsTest() throws IOException { Set tags = null; - Set response = api.findPetsByTags(tags); + // uncomment below to test the API function + //Set response = api.findPetsByTags(tags); // TODO: test validations } - + /** * Find pet by ID * @@ -113,11 +115,12 @@ public class PetApiTest { @Test public void getPetByIdTest() throws IOException { Long petId = null; - Pet response = api.getPetById(petId); + // uncomment below to test the API function + //Pet response = api.getPetById(petId); // TODO: test validations } - + /** * Update an existing pet * @@ -129,11 +132,12 @@ public class PetApiTest { @Test public void updatePetTest() throws IOException { Pet body = null; - api.updatePet(body); + // uncomment below to test the API function + //api.updatePet(body); // TODO: test validations } - + /** * Updates a pet in the store with form data * @@ -147,11 +151,12 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - api.updatePetWithForm(petId, name, status); + // uncomment below to test the API function + //api.updatePetWithForm(petId, name, status); // TODO: test validations } - + /** * uploads an image * @@ -165,11 +170,12 @@ public class PetApiTest { Long petId = null; String additionalMetadata = null; File _file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + // uncomment below to test the API function + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); // TODO: test validations } - + /** * uploads an image (required) * @@ -183,9 +189,10 @@ public class PetApiTest { Long petId = null; File requiredFile = null; String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + // uncomment below to test the API function + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/StoreApiTest.java index 8f769519c2d..6ddc66f6a48 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,8 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -28,12 +28,10 @@ import java.util.Map; /** * API tests for StoreApi */ -@Ignore public class StoreApiTest { private final StoreApi api = new StoreApi(); - /** * Delete purchase order by ID * @@ -45,11 +43,12 @@ public class StoreApiTest { @Test public void deleteOrderTest() throws IOException { String orderId = null; - api.deleteOrder(orderId); + // uncomment below to test the API function + //api.deleteOrder(orderId); // TODO: test validations } - + /** * Returns pet inventories by status * @@ -60,11 +59,12 @@ public class StoreApiTest { */ @Test public void getInventoryTest() throws IOException { - Map response = api.getInventory(); + // uncomment below to test the API function + //Map response = api.getInventory(); // TODO: test validations } - + /** * Find purchase order by ID * @@ -76,11 +76,12 @@ public class StoreApiTest { @Test public void getOrderByIdTest() throws IOException { Long orderId = null; - Order response = api.getOrderById(orderId); + // uncomment below to test the API function + //Order response = api.getOrderById(orderId); // TODO: test validations } - + /** * Place an order for a pet * @@ -92,9 +93,10 @@ public class StoreApiTest { @Test public void placeOrderTest() throws IOException { Order body = null; - Order response = api.placeOrder(body); + // uncomment below to test the API function + //Order response = api.placeOrder(body); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/UserApiTest.java index 6035fe4cb18..1c28fd599e9 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.LocalDate; @@ -29,12 +29,10 @@ import java.util.Map; /** * API tests for UserApi */ -@Ignore public class UserApiTest { private final UserApi api = new UserApi(); - /** * Create user * @@ -46,11 +44,12 @@ public class UserApiTest { @Test public void createUserTest() throws IOException { User body = null; - api.createUser(body); + // uncomment below to test the API function + //api.createUser(body); // TODO: test validations } - + /** * Creates list of users with given input array * @@ -62,11 +61,12 @@ public class UserApiTest { @Test public void createUsersWithArrayInputTest() throws IOException { List body = null; - api.createUsersWithArrayInput(body); + // uncomment below to test the API function + //api.createUsersWithArrayInput(body); // TODO: test validations } - + /** * Creates list of users with given input array * @@ -78,11 +78,12 @@ public class UserApiTest { @Test public void createUsersWithListInputTest() throws IOException { List body = null; - api.createUsersWithListInput(body); + // uncomment below to test the API function + //api.createUsersWithListInput(body); // TODO: test validations } - + /** * Delete user * @@ -94,11 +95,12 @@ public class UserApiTest { @Test public void deleteUserTest() throws IOException { String username = null; - api.deleteUser(username); + // uncomment below to test the API function + //api.deleteUser(username); // TODO: test validations } - + /** * Get user by user name * @@ -110,11 +112,12 @@ public class UserApiTest { @Test public void getUserByNameTest() throws IOException { String username = null; - User response = api.getUserByName(username); + // uncomment below to test the API function + //User response = api.getUserByName(username); // TODO: test validations } - + /** * Logs user into the system * @@ -127,11 +130,12 @@ public class UserApiTest { public void loginUserTest() throws IOException { String username = null; String password = null; - String response = api.loginUser(username, password); + // uncomment below to test the API function + //String response = api.loginUser(username, password); // TODO: test validations } - + /** * Logs out current logged in user session * @@ -142,11 +146,12 @@ public class UserApiTest { */ @Test public void logoutUserTest() throws IOException { - api.logoutUser(); + // uncomment below to test the API function + //api.logoutUser(); // TODO: test validations } - + /** * Updated user * @@ -159,9 +164,10 @@ public class UserApiTest { public void updateUserTest() throws IOException { String username = null; User body = null; - api.updateUser(username, body); + // uncomment below to test the API function + //api.updateUser(username, body); // TODO: test validations } - + } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index 2a18763af1c..faacb289c17 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -42,7 +42,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index b38283c127c..b506ff7ae92 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -43,7 +43,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index c2e520f94bc..ba65ffedc14 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -42,7 +42,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 6f1b83dce1a..72854079e5e 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -44,7 +44,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -52,7 +52,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -60,7 +60,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -68,7 +68,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -76,7 +76,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -84,7 +84,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -92,7 +92,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -100,7 +100,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -108,7 +108,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -116,7 +116,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -124,7 +124,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 5ba29819117..916c2c2bcb3 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -42,7 +42,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index bb7004745ab..a099245eec5 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -43,7 +43,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index df3fb067d74..d47c9a37d1f 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -42,7 +42,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index 3e24921e49f..3820dd2e23c 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -42,7 +42,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AnimalTest.java index da5609b5489..24776d3cb51 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -43,7 +43,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -51,7 +51,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index cbc199f1575..6bbe877044d 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnlyTest { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 762f9d6dc33..eaf908bb1ab 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfNumberOnlyTest { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 20dc34a8c51..99c6bcf5360 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -22,21 +22,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java index 765bd150512..20bc4e0d424 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -44,7 +44,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -68,7 +68,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 4fd3728ab89..a0217acd1f2 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -40,7 +40,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -48,7 +48,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -56,7 +56,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -64,7 +64,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -72,7 +72,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -80,7 +80,7 @@ public class CapitalizationTest { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CatTest.java index d591bdd30ef..1b389a075be 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -44,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CategoryTest.java index 12de38c0c08..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -40,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClassModelTest.java index d1936d85e81..6ef5c744fbc 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -40,7 +40,7 @@ public class ClassModelTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClientTest.java index 7aa0f5859ff..8028f11bc2b 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -40,7 +40,7 @@ public class ClientTest { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/DogTest.java index 744c8a406fe..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,21 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -44,7 +44,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -60,7 +60,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 694e4196138..4a755b0d442 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public class EnumArraysTest { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumClassTest.java index 3f50e1bfb9e..48aa1a737fc 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumTestTest.java index b8d3359c906..b06e3eb195d 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -41,7 +41,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -49,7 +49,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -57,7 +57,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -65,7 +65,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -73,7 +73,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index fb8827a1e88..0048cb2c749 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -22,21 +22,21 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +44,7 @@ public class FileSchemaTestClassTest { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +52,7 @@ public class FileSchemaTestClassTest { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java index 058a8ad7d43..3060f7f2d56 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,21 +23,21 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -45,7 +45,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -53,7 +53,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -61,7 +61,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -69,7 +69,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -77,7 +77,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -85,7 +85,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -93,7 +93,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -101,7 +101,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -109,7 +109,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -117,7 +117,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -125,7 +125,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -133,7 +133,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -141,7 +141,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -149,7 +149,7 @@ public class FormatTestTest { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index bf777b061cc..908f0aff6ed 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -40,7 +40,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -48,7 +48,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MapTestTest.java index 50e909f0381..3752c5ba31f 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -42,7 +42,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -50,7 +50,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -58,7 +58,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -66,7 +66,7 @@ public class MapTestTest { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b16858dc17e..0f47e193af8 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,21 +23,21 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -45,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +53,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -61,7 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dd90f6799d3..5743b70142b 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -40,7 +40,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -48,7 +48,7 @@ public class Model200ResponseTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index e63f2ae5e9c..436e4abd59e 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -40,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -48,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -56,7 +56,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java index 264249edc1c..f128d7b9ac2 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -40,7 +40,7 @@ public class ModelFileTest { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java index 81fd2dcc6a6..92273f48d23 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -40,7 +40,7 @@ public class ModelListTest { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 5840d4f8f0c..1c5337654cd 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -40,7 +40,7 @@ public class ModelReturnTest { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NameTest.java index 9280c171539..1a6aa18fa20 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -40,7 +40,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -48,7 +48,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -56,7 +56,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -64,7 +64,7 @@ public class NameTest { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 63b5bc0440e..8623386a5e9 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -41,7 +41,7 @@ public class NumberOnlyTest { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java index e0fbb529af6..670c2535646 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -41,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -57,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -65,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -73,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -81,7 +81,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 840cf65c8d0..870a977da94 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -41,7 +41,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -49,7 +49,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -57,7 +57,7 @@ public class OuterCompositeTest { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java index b312b11a09e..0333ee657a0 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,19 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/PetTest.java index ca23198fbf1..2e4303f1e4b 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/PetTest.java @@ -26,21 +26,21 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b356d6993c5..c56da4290fa 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -40,7 +40,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -48,7 +48,7 @@ public class ReadOnlyFirstTest { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 8eb0b1bd269..9501cf722d6 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -40,7 +40,7 @@ public class SpecialModelNameTest { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TagTest.java index 6dc0868167c..dc9cf9742ef 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -40,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index 2e3312e5f38..7ee75c35731 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -44,7 +44,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,7 +52,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -60,7 +60,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -68,7 +68,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -76,7 +76,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 5df1bbd3d5b..5c77882f500 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -44,7 +44,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -52,7 +52,7 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -60,7 +60,7 @@ public class TypeHolderExampleTest { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -68,7 +68,7 @@ public class TypeHolderExampleTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -76,7 +76,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -84,7 +84,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/UserTest.java index b029d279409..69d274133b9 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -40,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -56,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -64,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -72,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -80,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -88,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -96,7 +96,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/XmlItemTest.java index e7b49511c93..d2e45fadf56 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -22,21 +22,21 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -44,7 +44,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -52,7 +52,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -60,7 +60,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -68,7 +68,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -76,7 +76,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -84,7 +84,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -92,7 +92,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -100,7 +100,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -108,7 +108,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -116,7 +116,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -124,7 +124,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -132,7 +132,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -140,7 +140,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -148,7 +148,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -156,7 +156,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -164,7 +164,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -172,7 +172,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -180,7 +180,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -188,7 +188,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -196,7 +196,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -204,7 +204,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -212,7 +212,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -220,7 +220,7 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -228,7 +228,7 @@ public class XmlItemTest { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -236,7 +236,7 @@ public class XmlItemTest { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -244,7 +244,7 @@ public class XmlItemTest { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -252,7 +252,7 @@ public class XmlItemTest { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -260,7 +260,7 @@ public class XmlItemTest { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -268,7 +268,7 @@ public class XmlItemTest { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml b/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml b/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml +++ b/samples/client/petstore/java/jersey2-java8/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/jersey2-java8/gradlew b/samples/client/petstore/java/jersey2-java8/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/jersey2-java8/gradlew +++ b/samples/client/petstore/java/jersey2-java8/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/jersey2-java8/gradlew.bat b/samples/client/petstore/java/jersey2-java8/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/jersey2-java8/gradlew.bat +++ b/samples/client/petstore/java/jersey2-java8/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/jersey3/.github/workflows/maven.yml b/samples/client/petstore/java/jersey3/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/jersey3/.github/workflows/maven.yml +++ b/samples/client/petstore/java/jersey3/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/jersey3/docs/ChildCat.md b/samples/client/petstore/java/jersey3/docs/ChildCat.md index 3f39832529b..258d87e5699 100644 --- a/samples/client/petstore/java/jersey3/docs/ChildCat.md +++ b/samples/client/petstore/java/jersey3/docs/ChildCat.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDCAT | "ChildCat" | +| CHILD_CAT | "ChildCat" | diff --git a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/jersey3/gradlew b/samples/client/petstore/java/jersey3/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/jersey3/gradlew +++ b/samples/client/petstore/java/jersey3/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/jersey3/gradlew.bat b/samples/client/petstore/java/jersey3/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/jersey3/gradlew.bat +++ b/samples/client/petstore/java/jersey3/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/README.md index e95301f74cd..4c3e40a34b5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/README.md @@ -1,4 +1,4 @@ -# OpenAPI Petstore - MicroProfile Rest Client +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml index 6e4d713cd54..aaec1094017 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/pom.xml @@ -56,9 +56,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -154,7 +154,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 3.2.7 2.15.2 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java index 2d96b4ae1e4..1bedcba64e4 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Category.java @@ -125,3 +125,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5babfa9c7c7..ddfadbcf410 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -158,3 +158,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java index a0d60790f2e..b4fd65862e2 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Order.java @@ -293,3 +293,4 @@ public class Order { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java index 76f7cf9ad73..cc6ecbaceec 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java @@ -323,3 +323,4 @@ public class Pet { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java index 8dbe24f5368..488983ce94f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Tag.java @@ -125,3 +125,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java index eb52b7e1339..2e70b010de3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/User.java @@ -320,3 +320,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/PetApiTest.java index 5ba1fd677b1..797c05009b0 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -40,7 +40,7 @@ public class PetApiTest { private PetApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -59,7 +59,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.addPet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -78,7 +78,7 @@ public class PetApiTest { Long petId = null; String apiKey = null; //api.deletePet(petId, apiKey); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -96,7 +96,7 @@ public class PetApiTest { // TODO: test validations List status = null; //List response = api.findPetsByStatus(status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -114,7 +114,7 @@ public class PetApiTest { // TODO: test validations List tags = null; //List response = api.findPetsByTags(tags); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -132,7 +132,7 @@ public class PetApiTest { // TODO: test validations Long petId = null; //Pet response = api.getPetById(petId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -150,7 +150,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.updatePet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -170,7 +170,7 @@ public class PetApiTest { String name = null; String status = null; //api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -190,7 +190,7 @@ public class PetApiTest { String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/StoreApiTest.java index d2267491d2d..0dd56e5a8ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -38,7 +38,7 @@ public class StoreApiTest { private StoreApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -57,7 +57,7 @@ public class StoreApiTest { // TODO: test validations String orderId = null; //api.deleteOrder(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -74,7 +74,7 @@ public class StoreApiTest { public void getInventoryTest() { // TODO: test validations //Map response = api.getInventory(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -92,7 +92,7 @@ public class StoreApiTest { // TODO: test validations Long orderId = null; //Order response = api.getOrderById(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -110,7 +110,7 @@ public class StoreApiTest { // TODO: test validations Order order = null; //Order response = api.placeOrder(order); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/UserApiTest.java index a391586b2e0..97dbcb65a74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import java.util.Date; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -39,7 +39,7 @@ public class UserApiTest { private UserApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -58,7 +58,7 @@ public class UserApiTest { // TODO: test validations User user = null; //api.createUser(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -76,7 +76,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithArrayInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -94,7 +94,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithListInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -112,7 +112,7 @@ public class UserApiTest { // TODO: test validations String username = null; //api.deleteUser(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -130,7 +130,7 @@ public class UserApiTest { // TODO: test validations String username = null; //User response = api.getUserByName(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -149,7 +149,7 @@ public class UserApiTest { String username = null; String password = null; //String response = api.loginUser(username, password); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -166,7 +166,7 @@ public class UserApiTest { public void logoutUserTest() { // TODO: test validations //api.logoutUser(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -185,7 +185,7 @@ public class UserApiTest { String username = null; User user = null; //api.updateUser(username, user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/CategoryTest.java index c4cfabbaa9a..c90a5364a5f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -40,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index d304c8ea4f4..ca84c5ea519 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -40,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -48,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -56,7 +56,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/OrderTest.java index 2f6b45ae473..d76f9c3e543 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -41,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -57,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -65,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -73,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -81,7 +81,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/PetTest.java index 89b100680bd..1398113cd87 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/PetTest.java @@ -19,24 +19,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -44,7 +45,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +53,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -60,7 +61,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -68,7 +69,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -76,7 +77,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -84,7 +85,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/TagTest.java index 24201a29941..2573ba6494f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -40,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/UserTest.java index 53f04f7a68b..3cbc09cd779 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -40,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -56,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -64,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -72,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -80,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -88,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -96,7 +96,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md index e95301f74cd..4c3e40a34b5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/README.md @@ -1,4 +1,4 @@ -# OpenAPI Petstore - MicroProfile Rest Client +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml index 5bbd1cc4126..fedd41b522c 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/pom.xml @@ -56,9 +56,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -143,7 +143,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 3.2.7 2.15.2 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java index aee5f670c01..f90df1d1bf3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -112,3 +112,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d97eccb6651..d66986b5478 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -143,3 +143,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java index 980b9eb151f..b6c0aec0c23 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -268,3 +268,4 @@ public class Order { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java index 79e2385dcf6..defd4504bc7 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -290,3 +290,4 @@ public class Pet { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java index 9b3265fdd66..283def00e3e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -112,3 +112,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java index 67af1789d14..26490077dd3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/main/java/org/openapitools/client/model/User.java @@ -295,3 +295,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java index 5ba1fd677b1..797c05009b0 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -40,7 +40,7 @@ public class PetApiTest { private PetApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -59,7 +59,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.addPet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -78,7 +78,7 @@ public class PetApiTest { Long petId = null; String apiKey = null; //api.deletePet(petId, apiKey); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -96,7 +96,7 @@ public class PetApiTest { // TODO: test validations List status = null; //List response = api.findPetsByStatus(status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -114,7 +114,7 @@ public class PetApiTest { // TODO: test validations List tags = null; //List response = api.findPetsByTags(tags); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -132,7 +132,7 @@ public class PetApiTest { // TODO: test validations Long petId = null; //Pet response = api.getPetById(petId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -150,7 +150,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.updatePet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -170,7 +170,7 @@ public class PetApiTest { String name = null; String status = null; //api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -190,7 +190,7 @@ public class PetApiTest { String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java index d2267491d2d..0dd56e5a8ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -38,7 +38,7 @@ public class StoreApiTest { private StoreApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -57,7 +57,7 @@ public class StoreApiTest { // TODO: test validations String orderId = null; //api.deleteOrder(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -74,7 +74,7 @@ public class StoreApiTest { public void getInventoryTest() { // TODO: test validations //Map response = api.getInventory(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -92,7 +92,7 @@ public class StoreApiTest { // TODO: test validations Long orderId = null; //Order response = api.getOrderById(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -110,7 +110,7 @@ public class StoreApiTest { // TODO: test validations Order order = null; //Order response = api.placeOrder(order); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java index a391586b2e0..97dbcb65a74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import java.util.Date; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -39,7 +39,7 @@ public class UserApiTest { private UserApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -58,7 +58,7 @@ public class UserApiTest { // TODO: test validations User user = null; //api.createUser(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -76,7 +76,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithArrayInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -94,7 +94,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithListInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -112,7 +112,7 @@ public class UserApiTest { // TODO: test validations String username = null; //api.deleteUser(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -130,7 +130,7 @@ public class UserApiTest { // TODO: test validations String username = null; //User response = api.getUserByName(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -149,7 +149,7 @@ public class UserApiTest { String username = null; String password = null; //String response = api.loginUser(username, password); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -166,7 +166,7 @@ public class UserApiTest { public void logoutUserTest() { // TODO: test validations //api.logoutUser(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -185,7 +185,7 @@ public class UserApiTest { String username = null; User user = null; //api.updateUser(username, user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java index c4cfabbaa9a..c90a5364a5f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -40,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index d304c8ea4f4..ca84c5ea519 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -40,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -48,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -56,7 +56,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java index 2f6b45ae473..d76f9c3e543 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,21 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -41,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -57,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -65,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -73,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -81,7 +81,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java index 89b100680bd..1398113cd87 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/PetTest.java @@ -19,24 +19,25 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -44,7 +45,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -52,7 +53,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -60,7 +61,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -68,7 +69,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -76,7 +77,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -84,7 +85,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java index 24201a29941..2573ba6494f 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -40,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java index 53f04f7a68b..3cbc09cd779 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jackson/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -40,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -56,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -64,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -72,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -80,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -88,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -96,7 +96,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0/README.md index e95301f74cd..4c3e40a34b5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/README.md @@ -1,4 +1,4 @@ -# OpenAPI Petstore - MicroProfile Rest Client +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml index 96d1ecac63c..0f3691d8ca9 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/pom.xml @@ -56,9 +56,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -152,7 +152,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 3.2.7 2.15.2 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java index f288f561181..aa7007ad5d5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b1a8ea4f25e..44eea59b3ee 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java index 6518f71fce6..d378038fc30 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ public class Order { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java index 50d982f0be7..822179523dc 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Pet.java @@ -265,3 +265,4 @@ public class Pet { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java index 09ed3b6f975..fecc6943bff 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java index 9dce754424b..e4f99ba38d3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/PetApiTest.java index 94de80f0b85..797c05009b0 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -30,8 +30,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - - /** * OpenAPI Petstore Test * @@ -42,7 +40,7 @@ public class PetApiTest { private PetApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -61,7 +59,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.addPet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -79,8 +77,8 @@ public class PetApiTest { // TODO: test validations Long petId = null; String apiKey = null; - //void response = api.deletePet(petId, apiKey); - //assertNotNull(response); + //api.deletePet(petId, apiKey); + //Assertions.assertNotNull(response); } @@ -98,7 +96,7 @@ public class PetApiTest { // TODO: test validations List status = null; //List response = api.findPetsByStatus(status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -116,7 +114,7 @@ public class PetApiTest { // TODO: test validations List tags = null; //List response = api.findPetsByTags(tags); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -134,7 +132,7 @@ public class PetApiTest { // TODO: test validations Long petId = null; //Pet response = api.getPetById(petId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -152,7 +150,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.updatePet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -171,8 +169,8 @@ public class PetApiTest { Long petId = null; String name = null; String status = null; - //void response = api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //api.updatePetWithForm(petId, name, status); + //Assertions.assertNotNull(response); } @@ -192,7 +190,7 @@ public class PetApiTest { String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/StoreApiTest.java index 712d7da2c16..0dd56e5a8ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - - /** * OpenAPI Petstore Test * @@ -40,7 +38,7 @@ public class StoreApiTest { private StoreApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -58,8 +56,8 @@ public class StoreApiTest { public void deleteOrderTest() { // TODO: test validations String orderId = null; - //void response = api.deleteOrder(orderId); - //assertNotNull(response); + //api.deleteOrder(orderId); + //Assertions.assertNotNull(response); } @@ -76,7 +74,7 @@ public class StoreApiTest { public void getInventoryTest() { // TODO: test validations //Map response = api.getInventory(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -94,7 +92,7 @@ public class StoreApiTest { // TODO: test validations Long orderId = null; //Order response = api.getOrderById(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -112,7 +110,7 @@ public class StoreApiTest { // TODO: test validations Order order = null; //Order response = api.placeOrder(order); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/UserApiTest.java index 898ba6b799d..97dbcb65a74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import java.util.Date; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -29,8 +29,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - - /** * OpenAPI Petstore Test * @@ -41,7 +39,7 @@ public class UserApiTest { private UserApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -59,8 +57,8 @@ public class UserApiTest { public void createUserTest() { // TODO: test validations User user = null; - //void response = api.createUser(user); - //assertNotNull(response); + //api.createUser(user); + //Assertions.assertNotNull(response); } @@ -77,8 +75,8 @@ public class UserApiTest { public void createUsersWithArrayInputTest() { // TODO: test validations List user = null; - //void response = api.createUsersWithArrayInput(user); - //assertNotNull(response); + //api.createUsersWithArrayInput(user); + //Assertions.assertNotNull(response); } @@ -95,8 +93,8 @@ public class UserApiTest { public void createUsersWithListInputTest() { // TODO: test validations List user = null; - //void response = api.createUsersWithListInput(user); - //assertNotNull(response); + //api.createUsersWithListInput(user); + //Assertions.assertNotNull(response); } @@ -113,8 +111,8 @@ public class UserApiTest { public void deleteUserTest() { // TODO: test validations String username = null; - //void response = api.deleteUser(username); - //assertNotNull(response); + //api.deleteUser(username); + //Assertions.assertNotNull(response); } @@ -132,7 +130,7 @@ public class UserApiTest { // TODO: test validations String username = null; //User response = api.getUserByName(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -151,7 +149,7 @@ public class UserApiTest { String username = null; String password = null; //String response = api.loginUser(username, password); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -167,8 +165,8 @@ public class UserApiTest { @Test public void logoutUserTest() { // TODO: test validations - //void response = api.logoutUser(); - //assertNotNull(response); + //api.logoutUser(); + //Assertions.assertNotNull(response); } @@ -186,8 +184,8 @@ public class UserApiTest { // TODO: test validations String username = null; User user = null; - //void response = api.updateUser(username, user); - //assertNotNull(response); + //api.updateUser(username, user); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java index 3f8a3046a4c..d0568f97766 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -13,22 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -36,7 +35,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -44,7 +43,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 31d3ca9f1fb..ddfa78c4ac3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -13,22 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -36,7 +35,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -44,7 +43,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -52,7 +51,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java index d80a7808674..0d23109bd82 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/OrderTest.java @@ -14,22 +14,21 @@ package org.openapitools.client.model; import java.util.Date; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -37,7 +36,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -45,7 +44,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -53,7 +52,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -61,7 +60,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -69,7 +68,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -77,7 +76,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java index 68f000a5762..e939e3b1d45 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/PetTest.java @@ -14,25 +14,25 @@ package org.openapitools.client.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -40,7 +40,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -56,7 +56,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -64,7 +64,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -72,7 +72,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -80,7 +80,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java index 857b9739671..5131a8a3e88 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/TagTest.java @@ -13,22 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -36,7 +35,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -44,7 +43,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java index 39dbbf2bf65..d0d84b12705 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0/src/test/java/org/openapitools/client/model/UserTest.java @@ -13,22 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -36,7 +35,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -44,7 +43,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -52,7 +51,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -60,7 +59,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -68,7 +67,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -76,7 +75,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -84,7 +83,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -92,7 +91,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/README.md b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/README.md index e95301f74cd..4c3e40a34b5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/README.md +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/README.md @@ -1,4 +1,4 @@ -# OpenAPI Petstore - MicroProfile Rest Client +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml index 0e9d09ffb0a..2f7a760809e 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/pom.xml @@ -56,9 +56,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -152,7 +152,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 3.2.7 2.15.2 diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java index f288f561181..aa7007ad5d5 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b1a8ea4f25e..44eea59b3ee 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java index 6518f71fce6..d378038fc30 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ public class Order { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java index 50d982f0be7..822179523dc 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java @@ -265,3 +265,4 @@ public class Pet { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java index 09ed3b6f975..fecc6943bff 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java index 9dce754424b..e4f99ba38d3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/PetApiTest.java index 5ba1fd677b1..797c05009b0 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -40,7 +40,7 @@ public class PetApiTest { private PetApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -59,7 +59,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.addPet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -78,7 +78,7 @@ public class PetApiTest { Long petId = null; String apiKey = null; //api.deletePet(petId, apiKey); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -96,7 +96,7 @@ public class PetApiTest { // TODO: test validations List status = null; //List response = api.findPetsByStatus(status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -114,7 +114,7 @@ public class PetApiTest { // TODO: test validations List tags = null; //List response = api.findPetsByTags(tags); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -132,7 +132,7 @@ public class PetApiTest { // TODO: test validations Long petId = null; //Pet response = api.getPetById(petId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -150,7 +150,7 @@ public class PetApiTest { // TODO: test validations Pet pet = null; //Pet response = api.updatePet(pet); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -170,7 +170,7 @@ public class PetApiTest { String name = null; String status = null; //api.updatePetWithForm(petId, name, status); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -190,7 +190,7 @@ public class PetApiTest { String additionalMetadata = null; org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/StoreApiTest.java index d2267491d2d..0dd56e5a8ed 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,9 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -38,7 +38,7 @@ public class StoreApiTest { private StoreApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -57,7 +57,7 @@ public class StoreApiTest { // TODO: test validations String orderId = null; //api.deleteOrder(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -74,7 +74,7 @@ public class StoreApiTest { public void getInventoryTest() { // TODO: test validations //Map response = api.getInventory(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -92,7 +92,7 @@ public class StoreApiTest { // TODO: test validations Long orderId = null; //Order response = api.getOrderById(orderId); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -110,7 +110,7 @@ public class StoreApiTest { // TODO: test validations Order order = null; //Order response = api.placeOrder(order); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/UserApiTest.java index a391586b2e0..97dbcb65a74 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import java.util.Date; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -39,7 +39,7 @@ public class UserApiTest { private UserApi client; private String baseUrl = "http://localhost:9080"; - @Before + @BeforeEach public void setup() throws MalformedURLException { // TODO initialize the client } @@ -58,7 +58,7 @@ public class UserApiTest { // TODO: test validations User user = null; //api.createUser(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -76,7 +76,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithArrayInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -94,7 +94,7 @@ public class UserApiTest { // TODO: test validations List user = null; //api.createUsersWithListInput(user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -112,7 +112,7 @@ public class UserApiTest { // TODO: test validations String username = null; //api.deleteUser(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -130,7 +130,7 @@ public class UserApiTest { // TODO: test validations String username = null; //User response = api.getUserByName(username); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -149,7 +149,7 @@ public class UserApiTest { String username = null; String password = null; //String response = api.loginUser(username, password); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -166,7 +166,7 @@ public class UserApiTest { public void logoutUserTest() { // TODO: test validations //api.logoutUser(); - //assertNotNull(response); + //Assertions.assertNotNull(response); } @@ -185,7 +185,7 @@ public class UserApiTest { String username = null; User user = null; //api.updateUser(username, user); - //assertNotNull(response); + //Assertions.assertNotNull(response); } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/CategoryTest.java index de8fb5b2ab2..d0568f97766 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -13,21 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -35,7 +35,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -43,7 +43,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index ec18c3b5a3d..ddfa78c4ac3 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -13,21 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -35,7 +35,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -43,7 +43,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -51,7 +51,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/OrderTest.java index 623cc884e22..0d23109bd82 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/OrderTest.java @@ -14,21 +14,21 @@ package org.openapitools.client.model; import java.util.Date; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -36,7 +36,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -44,7 +44,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -52,7 +52,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -60,7 +60,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -68,7 +68,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -76,7 +76,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/PetTest.java index 4ed68d492dd..e939e3b1d45 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/PetTest.java @@ -18,21 +18,21 @@ import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -40,7 +40,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -48,7 +48,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -56,7 +56,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -64,7 +64,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -72,7 +72,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -80,7 +80,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/TagTest.java index eb425b20960..5131a8a3e88 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/TagTest.java @@ -13,21 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -35,7 +35,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -43,7 +43,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/UserTest.java index b31687866d7..d0d84b12705 100644 --- a/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter/src/test/java/org/openapitools/client/model/UserTest.java @@ -13,21 +13,21 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -35,7 +35,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -43,7 +43,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -51,7 +51,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -59,7 +59,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -67,7 +67,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -75,7 +75,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -83,7 +83,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -91,7 +91,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/microprofile-rest-client/README.md b/samples/client/petstore/java/microprofile-rest-client/README.md index e95301f74cd..4c3e40a34b5 100644 --- a/samples/client/petstore/java/microprofile-rest-client/README.md +++ b/samples/client/petstore/java/microprofile-rest-client/README.md @@ -1,4 +1,4 @@ -# OpenAPI Petstore - MicroProfile Rest Client +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md index fdc9c56bd00..fb5361b0808 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/PetApi.md @@ -17,10 +17,12 @@ All URIs are relative to *http://petstore.swagger.io/v2* ## addPet -> void addPet(body) +> Pet addPet(pet) Add a new pet to the store + + ### Example ```java @@ -42,9 +44,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - void result = apiInstance.addPet(body); + Pet result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -62,11 +64,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type -[**void**](Void.md) +[**Pet**](Pet.md) ### Authorization @@ -75,12 +77,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **405** | Invalid input | - | @@ -90,6 +93,8 @@ public class Example { Deletes a pet + + ### Example ```java @@ -376,10 +381,12 @@ public class Example { ## updatePet -> void updatePet(body) +> Pet updatePet(pet) Update an existing pet + + ### Example ```java @@ -401,9 +408,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - void result = apiInstance.updatePet(body); + Pet result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -421,11 +428,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | ### Return type -[**void**](Void.md) +[**Pet**](Pet.md) ### Authorization @@ -434,12 +441,13 @@ public class Example { ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -451,6 +459,8 @@ public class Example { Updates a pet in the store with form data + + ### Example ```java @@ -524,6 +534,8 @@ public class Example { uploads an image + + ### Example ```java diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md index 4d90de84607..ae64b8574e2 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/StoreApi.md @@ -217,10 +217,12 @@ No authorization required ## placeOrder -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet + + ### Example ```java @@ -237,9 +239,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io/v2"); StoreApi apiInstance = new StoreApi(defaultClient); - Order body = new Order(); // Order | order placed for purchasing the pet + Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -257,7 +259,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**Order**](Order.md)| order placed for purchasing the pet | | +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | ### Return type @@ -269,7 +271,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md index babf04d1916..89c1bfc6026 100644 --- a/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md +++ b/samples/client/petstore/java/microprofile-rest-client/docs/UserApi.md @@ -17,7 +17,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* ## createUser -> void createUser(body) +> void createUser(user) Create user @@ -30,6 +30,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -37,11 +38,17 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); - User body = new User(); // User | Created user object + User user = new User(); // User | Created user object try { - void result = apiInstance.createUser(body); + void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -59,7 +66,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**User**](User.md)| Created user object | | +| **user** | [**User**](User.md)| Created user object | | ### Return type @@ -67,11 +74,11 @@ public class Example { ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined @@ -83,10 +90,12 @@ No authorization required ## createUsersWithArrayInput -> void createUsersWithArrayInput(body) +> void createUsersWithArrayInput(user) Creates list of users with given input array + + ### Example ```java @@ -94,6 +103,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -101,11 +111,17 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - void result = apiInstance.createUsersWithArrayInput(body); + void result = apiInstance.createUsersWithArrayInput(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); @@ -123,7 +139,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**List<User>**](User.md)| List of user object | | +| **user** | [**List<User>**](User.md)| List of user object | | ### Return type @@ -131,11 +147,11 @@ public class Example { ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined @@ -147,10 +163,12 @@ No authorization required ## createUsersWithListInput -> void createUsersWithListInput(body) +> void createUsersWithListInput(user) Creates list of users with given input array + + ### Example ```java @@ -158,6 +176,7 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -165,11 +184,17 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - void result = apiInstance.createUsersWithListInput(body); + void result = apiInstance.createUsersWithListInput(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); @@ -187,7 +212,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | [**List<User>**](User.md)| List of user object | | +| **user** | [**List<User>**](User.md)| List of user object | | ### Return type @@ -195,11 +220,11 @@ public class Example { ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined @@ -224,6 +249,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -231,6 +257,12 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -261,7 +293,7 @@ public class Example { ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -282,6 +314,8 @@ No authorization required Get user by user name + + ### Example ```java @@ -348,6 +382,8 @@ No authorization required Logs user into the system + + ### Example ```java @@ -405,7 +441,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | | **400** | Invalid username/password supplied | - | @@ -415,6 +451,8 @@ No authorization required Logs out current logged in user session + + ### Example ```java @@ -422,6 +460,7 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -429,6 +468,12 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -455,7 +500,7 @@ This endpoint does not need any parameter. ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -471,7 +516,7 @@ No authorization required ## updateUser -> void updateUser(username, body) +> void updateUser(username, user) Updated user @@ -484,6 +529,7 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.UserApi; @@ -491,12 +537,18 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted - User body = new User(); // User | Updated user object + User user = new User(); // User | Updated user object try { - void result = apiInstance.updateUser(username, body); + void result = apiInstance.updateUser(username, user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -515,7 +567,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **username** | **String**| name that need to be deleted | | -| **body** | [**User**](User.md)| Updated user object | | +| **user** | [**User**](User.md)| Updated user object | | ### Return type @@ -523,11 +575,11 @@ public class Example { ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/java/microprofile-rest-client/pom.xml b/samples/client/petstore/java/microprofile-rest-client/pom.xml index e73ae7a664a..3fd74e97414 100644 --- a/samples/client/petstore/java/microprofile-rest-client/pom.xml +++ b/samples/client/petstore/java/microprofile-rest-client/pom.xml @@ -56,9 +56,9 @@ - - junit - junit + + org.junit.jupiter + junit-jupiter-api ${junit.version} test @@ -152,7 +152,7 @@ ${java.version} 1.5.18 9.2.9.v20150224 - 4.13.2 + 5.10.2 1.4.14 3.2.7 2.15.2 diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java index fe8f0596df2..49b83482426 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -37,7 +37,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; * */ -@RegisterRestClient(configKey="petstore") +@RegisterRestClient(configKey="pet-api") @RegisterProvider(ApiExceptionMapper.class) @Path("/pet") public interface PetApi { @@ -45,15 +45,20 @@ public interface PetApi { /** * Add a new pet to the store * + * + * */ @POST @Consumes({ "application/json", "application/xml" }) - void addPet(Pet body) throws ApiException, ProcessingException; + @Produces({ "application/xml", "application/json" }) + Pet addPet(Pet pet) throws ApiException, ProcessingException; /** * Deletes a pet * + * + * */ @DELETE @Path("/{petId}") @@ -97,15 +102,20 @@ public interface PetApi { /** * Update an existing pet * + * + * */ @PUT @Consumes({ "application/json", "application/xml" }) - void updatePet(Pet body) throws ApiException, ProcessingException; + @Produces({ "application/xml", "application/json" }) + Pet updatePet(Pet pet) throws ApiException, ProcessingException; /** * Updates a pet in the store with form data * + * + * */ @POST @Path("/{petId}") @@ -115,6 +125,8 @@ public interface PetApi { /** * uploads an image * + * + * */ @POST @Path("/{petId}/uploadImage") diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java index 29466ef6c21..84e982c9e01 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/StoreApi.java @@ -35,7 +35,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; * */ -@RegisterRestClient(configKey="petstore") +@RegisterRestClient(configKey="store-api") @RegisterProvider(ApiExceptionMapper.class) @Path("/store") public interface StoreApi { @@ -75,9 +75,12 @@ public interface StoreApi { /** * Place an order for a pet * + * + * */ @POST @Path("/order") + @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) - Order placeOrder(Order body) throws ApiException, ProcessingException; + Order placeOrder(Order order) throws ApiException, ProcessingException; } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java index d1eb41adcb8..4a30e10a9fb 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -36,7 +36,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; * */ -@RegisterRestClient(configKey="petstore") +@RegisterRestClient(configKey="user-api") @RegisterProvider(ApiExceptionMapper.class) @Path("/user") public interface UserApi { @@ -49,23 +49,30 @@ public interface UserApi { */ @POST - void createUser(User body) throws ApiException, ProcessingException; + @Consumes({ "application/json" }) + void createUser(User user) throws ApiException, ProcessingException; /** * Creates list of users with given input array * + * + * */ @POST @Path("/createWithArray") - void createUsersWithArrayInput(List body) throws ApiException, ProcessingException; + @Consumes({ "application/json" }) + void createUsersWithArrayInput(List user) throws ApiException, ProcessingException; /** * Creates list of users with given input array * + * + * */ @POST @Path("/createWithList") - void createUsersWithListInput(List body) throws ApiException, ProcessingException; + @Consumes({ "application/json" }) + void createUsersWithListInput(List user) throws ApiException, ProcessingException; /** * Delete user @@ -80,6 +87,8 @@ public interface UserApi { /** * Get user by user name * + * + * */ @GET @Path("/{username}") @@ -89,6 +98,8 @@ public interface UserApi { /** * Logs user into the system * + * + * */ @GET @Path("/login") @@ -98,6 +109,8 @@ public interface UserApi { /** * Logs out current logged in user session * + * + * */ @GET @Path("/logout") @@ -111,5 +124,6 @@ public interface UserApi { */ @PUT @Path("/{username}") - void updateUser(@PathParam("username") String username, User body) throws ApiException, ProcessingException; + @Consumes({ "application/json" }) + void updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java index 1613327e6cf..d34db0dec2e 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Category.java @@ -101,3 +101,4 @@ public class Category { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 3d3a88c183d..bb7520afb0b 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -125,3 +125,4 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java index d7d4a68d886..204dc0ceb79 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Order.java @@ -243,3 +243,4 @@ public class Order { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java index c0d7cc69efa..3efc500eec7 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Pet.java @@ -216,7 +216,9 @@ public class Pet { /** * pet status in the store * @return status + * @deprecated **/ + @Deprecated public StatusEnum getStatus() { return status; } @@ -263,3 +265,4 @@ public class Pet { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java index 541d748c882..31b19492308 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/Tag.java @@ -101,3 +101,4 @@ public class Tag { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java index 243616b646d..da9326887b1 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/model/User.java @@ -248,3 +248,4 @@ public class User { return o.toString().replace("\n", "\n "); } } + diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/PetApiTest.java index 65f7952b06f..b77ce18cdeb 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -8,18 +8,6 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ @@ -28,9 +16,9 @@ package org.openapitools.client.api; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -40,20 +28,19 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - - +import java.util.Set; /** * OpenAPI Petstore Test * - * API tests for PetApi + * API tests for PetApi */ public class PetApiTest { private PetApi client; private String baseUrl = "http://localhost:9080"; - - @Before + + @BeforeEach public void setup() throws MalformedURLException { client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) @@ -65,34 +52,38 @@ public class PetApiTest { /** * Add a new pet to the store * + * + * * @throws ApiException * if the Api call fails */ @Test public void addPetTest() { - // TODO: test validations - Pet body = null; - //void response = api.addPet(body); - //assertNotNull(response); - - + // TODO: test validations + Pet pet = null; + //Pet response = api.addPet(pet); + //Assertions.assertNotNull(response); + + } /** * Deletes a pet * + * + * * @throws ApiException * if the Api call fails */ @Test public void deletePetTest() { - // TODO: test validations + // TODO: test validations Long petId = null; String apiKey = null; - //void response = api.deletePet(petId, apiKey); - //assertNotNull(response); - - + //api.deletePet(petId, apiKey); + //Assertions.assertNotNull(response); + + } /** @@ -105,12 +96,12 @@ public class PetApiTest { */ @Test public void findPetsByStatusTest() { - // TODO: test validations + // TODO: test validations List status = null; //List response = api.findPetsByStatus(status); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** @@ -123,12 +114,12 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - // TODO: test validations + // TODO: test validations List tags = null; //List response = api.findPetsByTags(tags); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** @@ -141,64 +132,70 @@ public class PetApiTest { */ @Test public void getPetByIdTest() { - // TODO: test validations + // TODO: test validations Long petId = null; //Pet response = api.getPetById(petId); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** * Update an existing pet * + * + * * @throws ApiException * if the Api call fails */ @Test public void updatePetTest() { - // TODO: test validations - Pet body = null; - //void response = api.updatePet(body); - //assertNotNull(response); - - + // TODO: test validations + Pet pet = null; + //Pet response = api.updatePet(pet); + //Assertions.assertNotNull(response); + + } /** * Updates a pet in the store with form data * + * + * * @throws ApiException * if the Api call fails */ @Test public void updatePetWithFormTest() { - // TODO: test validations + // TODO: test validations Long petId = null; String name = null; String status = null; - //void response = api.updatePetWithForm(petId, name, status); - //assertNotNull(response); - - + //api.updatePetWithForm(petId, name, status); + //Assertions.assertNotNull(response); + + } /** * uploads an image * + * + * * @throws ApiException * if the Api call fails */ @Test public void uploadFileTest() { - // TODO: test validations + // TODO: test validations Long petId = null; String additionalMetadata = null; - org.apache.cxf.jaxrs.ext.multipart.Attachment file = null; - //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - //assertNotNull(response); - - + org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + //Assertions.assertNotNull(response); + + } } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/StoreApiTest.java index ca77aa2845c..f3552677aeb 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -8,27 +8,15 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -38,20 +26,19 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - - +import java.util.Set; /** * OpenAPI Petstore Test * - * API tests for StoreApi + * API tests for StoreApi */ public class StoreApiTest { private StoreApi client; private String baseUrl = "http://localhost:9080"; - - @Before + + @BeforeEach public void setup() throws MalformedURLException { client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) @@ -70,12 +57,12 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() { - // TODO: test validations + // TODO: test validations String orderId = null; - //void response = api.deleteOrder(orderId); - //assertNotNull(response); - - + //api.deleteOrder(orderId); + //Assertions.assertNotNull(response); + + } /** @@ -88,11 +75,11 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - // TODO: test validations + // TODO: test validations //Map response = api.getInventory(); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** @@ -105,28 +92,30 @@ public class StoreApiTest { */ @Test public void getOrderByIdTest() { - // TODO: test validations + // TODO: test validations Long orderId = null; //Order response = api.getOrderById(orderId); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** * Place an order for a pet * + * + * * @throws ApiException * if the Api call fails */ @Test public void placeOrderTest() { - // TODO: test validations - Order body = null; - //Order response = api.placeOrder(body); - //assertNotNull(response); - - + // TODO: test validations + Order order = null; + //Order response = api.placeOrder(order); + //Assertions.assertNotNull(response); + + } } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/UserApiTest.java index d35e2dd537f..c051762215e 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -8,27 +8,16 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.api; +import java.util.Date; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Before; -import static org.junit.Assert.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; import org.eclipse.microprofile.rest.client.RestClientBuilder; @@ -38,20 +27,19 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - - +import java.util.Set; /** * OpenAPI Petstore Test * - * API tests for UserApi + * API tests for UserApi */ public class UserApiTest { private UserApi client; private String baseUrl = "http://localhost:9080"; - - @Before + + @BeforeEach public void setup() throws MalformedURLException { client = RestClientBuilder.newBuilder() .baseUrl(new URL(baseUrl)) @@ -70,44 +58,48 @@ public class UserApiTest { */ @Test public void createUserTest() { - // TODO: test validations - User body = null; - //void response = api.createUser(body); - //assertNotNull(response); - - + // TODO: test validations + User user = null; + //api.createUser(user); + //Assertions.assertNotNull(response); + + } /** * Creates list of users with given input array * + * + * * @throws ApiException * if the Api call fails */ @Test public void createUsersWithArrayInputTest() { - // TODO: test validations - List body = null; - //void response = api.createUsersWithArrayInput(body); - //assertNotNull(response); - - + // TODO: test validations + List user = null; + //api.createUsersWithArrayInput(user); + //Assertions.assertNotNull(response); + + } /** * Creates list of users with given input array * + * + * * @throws ApiException * if the Api call fails */ @Test public void createUsersWithListInputTest() { - // TODO: test validations - List body = null; - //void response = api.createUsersWithListInput(body); - //assertNotNull(response); - - + // TODO: test validations + List user = null; + //api.createUsersWithListInput(user); + //Assertions.assertNotNull(response); + + } /** @@ -120,60 +112,66 @@ public class UserApiTest { */ @Test public void deleteUserTest() { - // TODO: test validations + // TODO: test validations String username = null; - //void response = api.deleteUser(username); - //assertNotNull(response); - - + //api.deleteUser(username); + //Assertions.assertNotNull(response); + + } /** * Get user by user name * + * + * * @throws ApiException * if the Api call fails */ @Test public void getUserByNameTest() { - // TODO: test validations + // TODO: test validations String username = null; //User response = api.getUserByName(username); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** * Logs user into the system * + * + * * @throws ApiException * if the Api call fails */ @Test public void loginUserTest() { - // TODO: test validations + // TODO: test validations String username = null; String password = null; //String response = api.loginUser(username, password); - //assertNotNull(response); - - + //Assertions.assertNotNull(response); + + } /** * Logs out current logged in user session * + * + * * @throws ApiException * if the Api call fails */ @Test public void logoutUserTest() { - // TODO: test validations - //void response = api.logoutUser(); - //assertNotNull(response); - - + // TODO: test validations + //api.logoutUser(); + //Assertions.assertNotNull(response); + + } /** @@ -186,13 +184,13 @@ public class UserApiTest { */ @Test public void updateUserTest() { - // TODO: test validations + // TODO: test validations String username = null; - User body = null; - //void response = api.updateUser(username, body); - //assertNotNull(response); - - + User user = null; + //api.updateUser(username, user); + //Assertions.assertNotNull(response); + + } } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CategoryTest.java index ed7d3b4b930..d0568f97766 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -8,39 +8,26 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -48,7 +35,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +43,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index d234bec47d0..ddfa78c4ac3 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -8,39 +8,26 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -48,7 +35,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -56,7 +43,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -64,7 +51,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OrderTest.java index dbb897c0ac7..0d23109bd82 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/OrderTest.java @@ -8,40 +8,27 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; import java.util.Date; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -49,7 +36,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -57,7 +44,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -65,7 +52,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -73,7 +60,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -81,7 +68,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -89,7 +76,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/PetTest.java index 8c20696b93f..e939e3b1d45 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/PetTest.java @@ -8,43 +8,31 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -52,7 +40,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -60,7 +48,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -68,7 +56,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -76,7 +64,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -84,7 +72,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -92,7 +80,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TagTest.java index 32733bc2291..5131a8a3e88 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/TagTest.java @@ -8,39 +8,26 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -48,7 +35,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +43,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/UserTest.java index ba262205259..d0d84b12705 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/test/java/org/openapitools/client/model/UserTest.java @@ -8,39 +8,26 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -48,7 +35,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +43,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -64,7 +51,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -72,7 +59,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -80,7 +67,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -88,7 +75,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -96,7 +83,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -104,7 +91,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/native-async/.github/workflows/maven.yml b/samples/client/petstore/java/native-async/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/native-async/.github/workflows/maven.yml +++ b/samples/client/petstore/java/native-async/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/native-async/build.gradle b/samples/client/petstore/java/native-async/build.gradle index 9a13583ffe1..14a7bef07d6 100644 --- a/samples/client/petstore/java/native-async/build.gradle +++ b/samples/client/petstore/java/native-async/build.gradle @@ -68,7 +68,7 @@ artifacts { ext { jackson_version = "2.14.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" + junit_version = "5.10.2" httpmime_version = "4.5.13" } @@ -81,7 +81,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native-async/docs/ChildCat.md b/samples/client/petstore/java/native-async/docs/ChildCat.md index 3f39832529b..258d87e5699 100644 --- a/samples/client/petstore/java/native-async/docs/ChildCat.md +++ b/samples/client/petstore/java/native-async/docs/ChildCat.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDCAT | "ChildCat" | +| CHILD_CAT | "ChildCat" | diff --git a/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/native-async/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/native-async/gradlew b/samples/client/petstore/java/native-async/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/native-async/gradlew +++ b/samples/client/petstore/java/native-async/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/native-async/gradlew.bat b/samples/client/petstore/java/native-async/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/native-async/gradlew.bat +++ b/samples/client/petstore/java/native-async/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index 1ef3c46ae70..6416fe9fa2e 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -57,7 +57,7 @@
    maven-surefire-plugin - 3.0.0-M7 + 3.2.5 conf/log4j.properties @@ -242,8 +242,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -257,7 +257,7 @@ 0.2.6 1.3.5 4.5.14 - 4.13.2 + 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 8f841e28f6b..2ba68a0a537 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/DefaultApiTest.java index 833c05f9400..cc8fb840de0 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeApiTest.java index b7cb964f552..18b589c8d66 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -24,8 +24,8 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -38,7 +38,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6cc5bf21f80..3f82f64f048 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/PetApiTest.java index 6902beb14cc..80e50891f18 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.ApiException; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -31,7 +31,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/StoreApiTest.java index bc137893417..813e15129aa 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/UserApiTest.java index fd849a92b38..0d5a9396107 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -16,8 +16,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -30,7 +30,7 @@ import java.util.concurrent.CompletableFuture; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce42..6d12f2d7d10 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..8c231167d61 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AnimalTest.java index 15d5c977c6b..24d4c7cad74 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleReqTest.java index d9ccc722303..a169ab60d39 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleReqTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleTest.java index 2eb05360fa7..62100b06ec3 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/AppleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..7d6ca2902ab 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..1db82cbdea3 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..4a3a3cc839a 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaReqTest.java index 4600d943d5e..b605d146e40 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaReqTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaTest.java index 0f2d70f73bb..70be9e32c94 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BananaTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BasquePigTest.java index 0685bc78acd..43fa0a23f36 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BasquePigTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..1f133e4142e 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e3..867c64d5651 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..84df0f1e24d 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ChildCatTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ChildCatTest.java index 0a7641556e3..63cf65386e7 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ChildCatTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ChildCatTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentPet; import java.util.Set; import java.util.HashSet; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..0efd2b03752 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..9fee039a47a 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java index 8c22f071a84..995ed5daeb4 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DanishPigTest.java index 8f7c39b3870..8568207d971 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DanishPigTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..06d58640393 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..0f9f43fd3ca 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DrawingTest.java index 61b5ed74c4f..c2a0659731b 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DrawingTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -30,9 +30,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..bd426ae14b5 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..19518a5f665 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade7..8522172bdfc 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,9 +26,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java index 956462f1b11..d6450f92d36 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..1792f6169d9 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..53b20d7bdd3 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..85c3e9a29e7 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..b1825eb48eb 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da1004..2d1505241d8 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,9 +23,9 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitReqTest.java index f6042b16d49..59d4bcfc12b 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitReqTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitTest.java index 9da443eea30..e9153d8010a 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/FruitTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitTest.java index 8e70b77b8ba..2625ac7b07c 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java index 495240f4760..7ba9aa57e8e 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.ParentPet; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..9a76d3c9534 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9..d627568b70c 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,9 +22,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java index d1eb131972f..494aeb29719 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MammalTest.java index 17c804511d0..ff3ec21df4b 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MammalTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MammalTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Pig; import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..c85527e8536 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..c5f70f4c8f0 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,9 +23,9 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..0952e6472d0 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..d57f8680047 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..4b2d7105211 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..f39c6a118e3 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..a6968d2b87e 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..39ff782a3ea 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..86e5a4e7249 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -29,9 +29,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableShapeTest.java index bc24e8f12b2..387933e4ca8 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableShapeTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..88a5503ccf9 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..72978f65097 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..17f411d1ede 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..11d7eeac3b7 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..db6de4ebd34 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..44b97d47c2e 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..908c8ce7e21 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..f7293142020 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..579a7f62fa7 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ParentPetTest.java index 6bc9c402926..cf712c8e3b8 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ParentPetTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..a10e870d0fd 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PetTest.java @@ -25,9 +25,9 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PigTest.java index f0cfa53e1ac..a877a11b87f 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PigTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/PigTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java index 60553d39ea7..12b7e7a26b6 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralTest.java index 9b0850dbfcc..472f5cf4b1f 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..11ab8eaf4fe 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java index d34e9885594..5f5d499da94 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java index 3014f1cdb7f..f7baab916ce 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java index a3b57190151..93f71dcf9ea 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeTest.java index a0cb2a8d699..43d7a99da4a 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java index 93e06a1063e..d448e6d80b2 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..7db38f4f338 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..c5d7ce076d6 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..382a573036b 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 7ab59f334f2..8488ed25358 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java index a0abfe85411..afb79ca5d41 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleTest.java index 0d606efde23..d260c70f40f 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.EquilateralTriangle; import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..eccfbf5e126 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/WhaleTest.java index 25911285280..48f4f071512 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/WhaleTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ZebraTest.java index 0e460afcec2..3be21d660bb 100644 --- a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ZebraTest.java +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/.github/workflows/maven.yml b/samples/client/petstore/java/native-jakarta/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/native-jakarta/.github/workflows/maven.yml +++ b/samples/client/petstore/java/native-jakarta/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/native-jakarta/build.gradle b/samples/client/petstore/java/native-jakarta/build.gradle index 0c8090d61ed..a1106b11dc7 100644 --- a/samples/client/petstore/java/native-jakarta/build.gradle +++ b/samples/client/petstore/java/native-jakarta/build.gradle @@ -68,7 +68,7 @@ artifacts { ext { jackson_version = "2.14.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" + junit_version = "5.10.2" httpmime_version = "4.5.13" } @@ -81,7 +81,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/native-jakarta/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/native-jakarta/gradlew b/samples/client/petstore/java/native-jakarta/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/native-jakarta/gradlew +++ b/samples/client/petstore/java/native-jakarta/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/native-jakarta/gradlew.bat b/samples/client/petstore/java/native-jakarta/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/native-jakarta/gradlew.bat +++ b/samples/client/petstore/java/native-jakarta/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/native-jakarta/pom.xml b/samples/client/petstore/java/native-jakarta/pom.xml index d935755c093..a8529c5102e 100644 --- a/samples/client/petstore/java/native-jakarta/pom.xml +++ b/samples/client/petstore/java/native-jakarta/pom.xml @@ -57,7 +57,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.2.5 conf/log4j.properties @@ -242,8 +242,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -257,7 +257,7 @@ 0.2.6 2.1.1 4.5.14 - 4.13.2 + 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java index c4d73c313aa..d163f02d0f8 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.ApiException; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -30,7 +30,7 @@ import java.util.Set; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java index 6c08edd0bea..cf0ccfd975b 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +28,7 @@ import java.util.Set; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java index f43e80243ae..f0203e7200c 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -16,8 +16,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.Set; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java index 65476835d38..9726086ea5b 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 05da3719615..69c9bbf9a6b 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java index 53855bafe5c..95f8424222e 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/PetTest.java index 097587bc441..332a4135c6f 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/PetTest.java @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/TagTest.java index 447a4084398..74bf41f2a26 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/UserTest.java index 29086666939..f08cd84394a 100644 --- a/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/native-jakarta/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/.github/workflows/maven.yml b/samples/client/petstore/java/native/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/native/.github/workflows/maven.yml +++ b/samples/client/petstore/java/native/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index 9a13583ffe1..14a7bef07d6 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -68,7 +68,7 @@ artifacts { ext { jackson_version = "2.14.1" jakarta_annotation_version = "1.3.5" - junit_version = "4.13.2" + junit_version = "5.10.2" httpmime_version = "4.5.13" } @@ -81,7 +81,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native/docs/ChildCat.md b/samples/client/petstore/java/native/docs/ChildCat.md index 3f39832529b..258d87e5699 100644 --- a/samples/client/petstore/java/native/docs/ChildCat.md +++ b/samples/client/petstore/java/native/docs/ChildCat.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDCAT | "ChildCat" | +| CHILD_CAT | "ChildCat" | diff --git a/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/native/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/native/gradlew b/samples/client/petstore/java/native/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/native/gradlew +++ b/samples/client/petstore/java/native/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/native/gradlew.bat b/samples/client/petstore/java/native/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/native/gradlew.bat +++ b/samples/client/petstore/java/native/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index 1ef3c46ae70..6416fe9fa2e 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -57,7 +57,7 @@ maven-surefire-plugin - 3.0.0-M7 + 3.2.5 conf/log4j.properties @@ -242,8 +242,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -257,7 +257,7 @@ 0.2.6 1.3.5 4.5.14 - 4.13.2 + 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index b90f18a8c2e..04f8324d56f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -471,5 +471,98 @@ public class AdditionalPropertiesClass { return joiner.toString(); } + + public static class Builder { + + private AdditionalPropertiesClass instance; + + public Builder() { + this(new AdditionalPropertiesClass()); + } + + protected Builder(AdditionalPropertiesClass instance) { + this.instance = instance; + } + + public AdditionalPropertiesClass.Builder mapProperty(Map mapProperty) { + this.instance.mapProperty = mapProperty; + return this; + } + public AdditionalPropertiesClass.Builder mapOfMapProperty(Map> mapOfMapProperty) { + this.instance.mapOfMapProperty = mapOfMapProperty; + return this; + } + public AdditionalPropertiesClass.Builder anytype1(Object anytype1) { + this.instance.anytype1 = JsonNullable.of(anytype1); + return this; + } + public AdditionalPropertiesClass.Builder anytype1(JsonNullable anytype1) { + this.instance.anytype1 = anytype1; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.instance.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.instance.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + this.instance.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + public AdditionalPropertiesClass.Builder emptyMap(Object emptyMap) { + this.instance.emptyMap = emptyMap; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + this.instance.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + + /** + * returns a built AdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public AdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AdditionalPropertiesClass.Builder builder() { + return new AdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesClass.Builder toBuilder() { + return new AdditionalPropertiesClass.Builder() + .mapProperty(getMapProperty()) + .mapOfMapProperty(getMapOfMapProperty()) + .anytype1(getAnytype1()) + .mapWithUndeclaredPropertiesAnytype1(getMapWithUndeclaredPropertiesAnytype1()) + .mapWithUndeclaredPropertiesAnytype2(getMapWithUndeclaredPropertiesAnytype2()) + .mapWithUndeclaredPropertiesAnytype3(getMapWithUndeclaredPropertiesAnytype3()) + .emptyMap(getEmptyMap()) + .mapWithUndeclaredPropertiesString(getMapWithUndeclaredPropertiesString()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index e257e1fc440..6de79876ed0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -204,5 +204,64 @@ static { mappings.put("Animal", Animal.class); JSON.registerDiscriminator(Animal.class, "className", mappings); } + + public static class Builder { + + private Animal instance; + + public Builder() { + this(new Animal()); + } + + protected Builder(Animal instance) { + this.instance = instance; + } + + public Animal.Builder className(String className) { + this.instance.className = className; + return this; + } + public Animal.Builder color(String color) { + this.instance.color = color; + return this; + } + + + /** + * returns a built Animal instance. + * + * The builder is not reusable. + */ + public Animal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Animal.Builder builder() { + return new Animal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Animal.Builder toBuilder() { + return new Animal.Builder() + .className(getClassName()) + .color(getColor()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java index 2f337272300..f43d59f0976 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java @@ -182,5 +182,64 @@ public class Apple { return joiner.toString(); } + + public static class Builder { + + private Apple instance; + + public Builder() { + this(new Apple()); + } + + protected Builder(Apple instance) { + this.instance = instance; + } + + public Apple.Builder cultivar(String cultivar) { + this.instance.cultivar = cultivar; + return this; + } + public Apple.Builder origin(String origin) { + this.instance.origin = origin; + return this; + } + + + /** + * returns a built Apple instance. + * + * The builder is not reusable. + */ + public Apple build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Apple.Builder builder() { + return new Apple.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Apple.Builder toBuilder() { + return new Apple.Builder() + .cultivar(getCultivar()) + .origin(getOrigin()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java index 5b9d8c3027b..4098805f319 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java @@ -182,5 +182,64 @@ public class AppleReq { return joiner.toString(); } + + public static class Builder { + + private AppleReq instance; + + public Builder() { + this(new AppleReq()); + } + + protected Builder(AppleReq instance) { + this.instance = instance; + } + + public AppleReq.Builder cultivar(String cultivar) { + this.instance.cultivar = cultivar; + return this; + } + public AppleReq.Builder mealy(Boolean mealy) { + this.instance.mealy = mealy; + return this; + } + + + /** + * returns a built AppleReq instance. + * + * The builder is not reusable. + */ + public AppleReq build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AppleReq.Builder builder() { + return new AppleReq.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AppleReq.Builder toBuilder() { + return new AppleReq.Builder() + .cultivar(getCultivar()) + .mealy(getMealy()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index cfb0f1f49bc..e05f4a5dbcd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -163,5 +163,59 @@ public class ArrayOfArrayOfNumberOnly { return joiner.toString(); } + + public static class Builder { + + private ArrayOfArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfArrayOfNumberOnly()); + } + + protected Builder(ArrayOfArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) { + this.instance.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + /** + * returns a built ArrayOfArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfArrayOfNumberOnly.Builder builder() { + return new ArrayOfArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfArrayOfNumberOnly.Builder() + .arrayArrayNumber(getArrayArrayNumber()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 1e31e687b02..57d8419a8b2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -163,5 +163,59 @@ public class ArrayOfNumberOnly { return joiner.toString(); } + + public static class Builder { + + private ArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfNumberOnly()); + } + + protected Builder(ArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) { + this.instance.arrayNumber = arrayNumber; + return this; + } + + + /** + * returns a built ArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfNumberOnly.Builder builder() { + return new ArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfNumberOnly.Builder() + .arrayNumber(getArrayNumber()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index 41ab660344d..42ba1bf1270 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -259,5 +259,69 @@ public class ArrayTest { return joiner.toString(); } + + public static class Builder { + + private ArrayTest instance; + + public Builder() { + this(new ArrayTest()); + } + + protected Builder(ArrayTest instance) { + this.instance = instance; + } + + public ArrayTest.Builder arrayOfString(List arrayOfString) { + this.instance.arrayOfString = arrayOfString; + return this; + } + public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.instance.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) { + this.instance.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + /** + * returns a built ArrayTest instance. + * + * The builder is not reusable. + */ + public ArrayTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayTest.Builder builder() { + return new ArrayTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayTest.Builder toBuilder() { + return new ArrayTest.Builder() + .arrayOfString(getArrayOfString()) + .arrayArrayOfInteger(getArrayArrayOfInteger()) + .arrayArrayOfModel(getArrayArrayOfModel()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java index d68032a626c..e339552e2e1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java @@ -147,5 +147,59 @@ public class Banana { return joiner.toString(); } + + public static class Builder { + + private Banana instance; + + public Builder() { + this(new Banana()); + } + + protected Builder(Banana instance) { + this.instance = instance; + } + + public Banana.Builder lengthCm(BigDecimal lengthCm) { + this.instance.lengthCm = lengthCm; + return this; + } + + + /** + * returns a built Banana instance. + * + * The builder is not reusable. + */ + public Banana build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Banana.Builder builder() { + return new Banana.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Banana.Builder toBuilder() { + return new Banana.Builder() + .lengthCm(getLengthCm()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java index 6eb7387832d..d599889d08a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java @@ -183,5 +183,64 @@ public class BananaReq { return joiner.toString(); } + + public static class Builder { + + private BananaReq instance; + + public Builder() { + this(new BananaReq()); + } + + protected Builder(BananaReq instance) { + this.instance = instance; + } + + public BananaReq.Builder lengthCm(BigDecimal lengthCm) { + this.instance.lengthCm = lengthCm; + return this; + } + public BananaReq.Builder sweet(Boolean sweet) { + this.instance.sweet = sweet; + return this; + } + + + /** + * returns a built BananaReq instance. + * + * The builder is not reusable. + */ + public BananaReq build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BananaReq.Builder builder() { + return new BananaReq.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BananaReq.Builder toBuilder() { + return new BananaReq.Builder() + .lengthCm(getLengthCm()) + .sweet(getSweet()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java index acc562341b8..98c6c3c4047 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java @@ -146,5 +146,59 @@ public class BasquePig { return joiner.toString(); } + + public static class Builder { + + private BasquePig instance; + + public Builder() { + this(new BasquePig()); + } + + protected Builder(BasquePig instance) { + this.instance = instance; + } + + public BasquePig.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built BasquePig instance. + * + * The builder is not reusable. + */ + public BasquePig build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BasquePig.Builder builder() { + return new BasquePig.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BasquePig.Builder toBuilder() { + return new BasquePig.Builder() + .className(getClassName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index 8e2362dc986..6ae8c4a8b98 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -326,5 +326,84 @@ public class Capitalization { return joiner.toString(); } + + public static class Builder { + + private Capitalization instance; + + public Builder() { + this(new Capitalization()); + } + + protected Builder(Capitalization instance) { + this.instance = instance; + } + + public Capitalization.Builder smallCamel(String smallCamel) { + this.instance.smallCamel = smallCamel; + return this; + } + public Capitalization.Builder capitalCamel(String capitalCamel) { + this.instance.capitalCamel = capitalCamel; + return this; + } + public Capitalization.Builder smallSnake(String smallSnake) { + this.instance.smallSnake = smallSnake; + return this; + } + public Capitalization.Builder capitalSnake(String capitalSnake) { + this.instance.capitalSnake = capitalSnake; + return this; + } + public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) { + this.instance.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + public Capitalization.Builder ATT_NAME(String ATT_NAME) { + this.instance.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * returns a built Capitalization instance. + * + * The builder is not reusable. + */ + public Capitalization build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Capitalization.Builder builder() { + return new Capitalization.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Capitalization.Builder toBuilder() { + return new Capitalization.Builder() + .smallCamel(getSmallCamel()) + .capitalCamel(getCapitalCamel()) + .smallSnake(getSmallSnake()) + .capitalSnake(getCapitalSnake()) + .scAETHFlowPoints(getScAETHFlowPoints()) + .ATT_NAME(getATTNAME()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index a0b9590d7fd..ee64aec9b95 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -188,5 +188,73 @@ static { mappings.put("Cat", Cat.class); JSON.registerDiscriminator(Cat.class, "className", mappings); } + + public static class Builder extends Animal.Builder { + + private Cat instance; + + public Builder() { + this(new Cat()); + } + + protected Builder(Cat instance) { + super(instance); + this.instance = instance; + } + + public Cat.Builder declawed(Boolean declawed) { + this.instance.declawed = declawed; + return this; + } + + public Cat.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Cat.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Cat instance. + * + * The builder is not reusable. + */ + public Cat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Cat.Builder builder() { + return new Cat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Cat.Builder toBuilder() { + return new Cat.Builder() + .className(getClassName()) + .color(getColor()) + .declawed(getDeclawed()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 6d972a9359e..22398944dfe 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -182,5 +182,64 @@ public class Category { return joiner.toString(); } + + public static class Builder { + + private Category instance; + + public Builder() { + this(new Category()); + } + + protected Builder(Category instance) { + this.instance = instance; + } + + public Category.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Category.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Category instance. + * + * The builder is not reusable. + */ + public Category build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Category.Builder builder() { + return new Category.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Category.Builder toBuilder() { + return new Category.Builder() + .id(getId()) + .name(getName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java index 7502248158c..0b6deee6d94 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java @@ -215,5 +215,66 @@ static { mappings.put("ChildCat", ChildCat.class); JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); } + + public static class Builder extends ParentPet.Builder { + + private ChildCat instance; + + public Builder() { + this(new ChildCat()); + } + + protected Builder(ChildCat instance) { + super(instance); + this.instance = instance; + } + + public ChildCat.Builder name(String name) { + this.instance.name = name; + return this; + } + public ChildCat.Builder petType(String petType) { + this.instance.petType = petType; + return this; + } + + + /** + * returns a built ChildCat instance. + * + * The builder is not reusable. + */ + public ChildCat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChildCat.Builder builder() { + return new ChildCat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChildCat.Builder toBuilder() { + return new ChildCat.Builder() + .petType(getPetType()) + .name(getName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index 1497d1003d3..074e4a46da9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -146,5 +146,59 @@ public class ClassModel { return joiner.toString(); } + + public static class Builder { + + private ClassModel instance; + + public Builder() { + this(new ClassModel()); + } + + protected Builder(ClassModel instance) { + this.instance = instance; + } + + public ClassModel.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built ClassModel instance. + * + * The builder is not reusable. + */ + public ClassModel build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClassModel.Builder builder() { + return new ClassModel.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClassModel.Builder toBuilder() { + return new ClassModel.Builder() + .propertyClass(getPropertyClass()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index 63023b3a96c..4f5bba3543d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -146,5 +146,59 @@ public class Client { return joiner.toString(); } + + public static class Builder { + + private Client instance; + + public Builder() { + this(new Client()); + } + + protected Builder(Client instance) { + this.instance = instance; + } + + public Client.Builder client(String client) { + this.instance.client = client; + return this; + } + + + /** + * returns a built Client instance. + * + * The builder is not reusable. + */ + public Client build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Client.Builder builder() { + return new Client.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Client.Builder toBuilder() { + return new Client.Builder() + .client(getClient()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 294aa35a99b..9d64e700796 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -182,5 +182,64 @@ public class ComplexQuadrilateral { return joiner.toString(); } + + public static class Builder { + + private ComplexQuadrilateral instance; + + public Builder() { + this(new ComplexQuadrilateral()); + } + + protected Builder(ComplexQuadrilateral instance) { + this.instance = instance; + } + + public ComplexQuadrilateral.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public ComplexQuadrilateral.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built ComplexQuadrilateral instance. + * + * The builder is not reusable. + */ + public ComplexQuadrilateral build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ComplexQuadrilateral.Builder builder() { + return new ComplexQuadrilateral.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ComplexQuadrilateral.Builder toBuilder() { + return new ComplexQuadrilateral.Builder() + .shapeType(getShapeType()) + .quadrilateralType(getQuadrilateralType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java index 760699a2de9..f8ea1c98bec 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java @@ -146,5 +146,59 @@ public class DanishPig { return joiner.toString(); } + + public static class Builder { + + private DanishPig instance; + + public Builder() { + this(new DanishPig()); + } + + protected Builder(DanishPig instance) { + this.instance = instance; + } + + public DanishPig.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built DanishPig instance. + * + * The builder is not reusable. + */ + public DanishPig build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DanishPig.Builder builder() { + return new DanishPig.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DanishPig.Builder toBuilder() { + return new DanishPig.Builder() + .className(getClassName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 257807d8d33..d619a398cff 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -148,5 +148,59 @@ public class DeprecatedObject { return joiner.toString(); } + + public static class Builder { + + private DeprecatedObject instance; + + public Builder() { + this(new DeprecatedObject()); + } + + protected Builder(DeprecatedObject instance) { + this.instance = instance; + } + + public DeprecatedObject.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built DeprecatedObject instance. + * + * The builder is not reusable. + */ + public DeprecatedObject build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeprecatedObject.Builder builder() { + return new DeprecatedObject.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeprecatedObject.Builder toBuilder() { + return new DeprecatedObject.Builder() + .name(getName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index 0f6de49adbc..32b75a9ce57 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -187,5 +187,73 @@ static { mappings.put("Dog", Dog.class); JSON.registerDiscriminator(Dog.class, "className", mappings); } + + public static class Builder extends Animal.Builder { + + private Dog instance; + + public Builder() { + this(new Dog()); + } + + protected Builder(Dog instance) { + super(instance); + this.instance = instance; + } + + public Dog.Builder breed(String breed) { + this.instance.breed = breed; + return this; + } + + public Dog.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Dog.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Dog instance. + * + * The builder is not reusable. + */ + public Dog build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Dog.Builder builder() { + return new Dog.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Dog.Builder toBuilder() { + return new Dog.Builder() + .className(getClassName()) + .color(getColor()) + .breed(getBreed()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java index a2fbda358f5..ef512f4ce4a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java @@ -349,5 +349,78 @@ public class Drawing extends HashMap { return joiner.toString(); } + + public static class Builder { + + private Drawing instance; + + public Builder() { + this(new Drawing()); + } + + protected Builder(Drawing instance) { + this.instance = instance; + } + + public Drawing.Builder mainShape(Shape mainShape) { + this.instance.mainShape = mainShape; + return this; + } + public Drawing.Builder shapeOrNull(ShapeOrNull shapeOrNull) { + this.instance.shapeOrNull = shapeOrNull; + return this; + } + public Drawing.Builder nullableShape(NullableShape nullableShape) { + this.instance.nullableShape = JsonNullable.of(nullableShape); + return this; + } + public Drawing.Builder nullableShape(JsonNullable nullableShape) { + this.instance.nullableShape = nullableShape; + return this; + } + public Drawing.Builder shapes(List shapes) { + this.instance.shapes = shapes; + return this; + } + + + /** + * returns a built Drawing instance. + * + * The builder is not reusable. + */ + public Drawing build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Drawing.Builder builder() { + return new Drawing.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Drawing.Builder toBuilder() { + return new Drawing.Builder() + .mainShape(getMainShape()) + .shapeOrNull(getShapeOrNull()) + .nullableShape(getNullableShape()) + .shapes(getShapes()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index f75a8c8fc35..45de8a83ef3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -266,5 +266,64 @@ public class EnumArrays { return joiner.toString(); } + + public static class Builder { + + private EnumArrays instance; + + public Builder() { + this(new EnumArrays()); + } + + protected Builder(EnumArrays instance) { + this.instance = instance; + } + + public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) { + this.instance.justSymbol = justSymbol; + return this; + } + public EnumArrays.Builder arrayEnum(List arrayEnum) { + this.instance.arrayEnum = arrayEnum; + return this; + } + + + /** + * returns a built EnumArrays instance. + * + * The builder is not reusable. + */ + public EnumArrays build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumArrays.Builder builder() { + return new EnumArrays.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumArrays.Builder toBuilder() { + return new EnumArrays.Builder() + .justSymbol(getJustSymbol()) + .arrayEnum(getArrayEnum()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index c5a6694802c..5507b809889 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -640,5 +640,103 @@ public class EnumTest { return joiner.toString(); } + + public static class Builder { + + private EnumTest instance; + + public Builder() { + this(new EnumTest()); + } + + protected Builder(EnumTest instance) { + this.instance = instance; + } + + public EnumTest.Builder enumString(EnumStringEnum enumString) { + this.instance.enumString = enumString; + return this; + } + public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.instance.enumStringRequired = enumStringRequired; + return this; + } + public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) { + this.instance.enumInteger = enumInteger; + return this; + } + public EnumTest.Builder enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.instance.enumIntegerOnly = enumIntegerOnly; + return this; + } + public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) { + this.instance.enumNumber = enumNumber; + return this; + } + public EnumTest.Builder outerEnum(OuterEnum outerEnum) { + this.instance.outerEnum = JsonNullable.of(outerEnum); + return this; + } + public EnumTest.Builder outerEnum(JsonNullable outerEnum) { + this.instance.outerEnum = outerEnum; + return this; + } + public EnumTest.Builder outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.instance.outerEnumInteger = outerEnumInteger; + return this; + } + public EnumTest.Builder outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.instance.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + public EnumTest.Builder outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.instance.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * returns a built EnumTest instance. + * + * The builder is not reusable. + */ + public EnumTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumTest.Builder builder() { + return new EnumTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumTest.Builder toBuilder() { + return new EnumTest.Builder() + .enumString(getEnumString()) + .enumStringRequired(getEnumStringRequired()) + .enumInteger(getEnumInteger()) + .enumIntegerOnly(getEnumIntegerOnly()) + .enumNumber(getEnumNumber()) + .outerEnum(getOuterEnum()) + .outerEnumInteger(getOuterEnumInteger()) + .outerEnumDefaultValue(getOuterEnumDefaultValue()) + .outerEnumIntegerDefaultValue(getOuterEnumIntegerDefaultValue()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 77bc8ddb3f2..e04a35b0928 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -182,5 +182,64 @@ public class EquilateralTriangle { return joiner.toString(); } + + public static class Builder { + + private EquilateralTriangle instance; + + public Builder() { + this(new EquilateralTriangle()); + } + + protected Builder(EquilateralTriangle instance) { + this.instance = instance; + } + + public EquilateralTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public EquilateralTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built EquilateralTriangle instance. + * + * The builder is not reusable. + */ + public EquilateralTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EquilateralTriangle.Builder builder() { + return new EquilateralTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EquilateralTriangle.Builder toBuilder() { + return new EquilateralTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index d2deda7f15a..5139d0c667b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -197,5 +197,64 @@ public class FakeBigDecimalMap200Response { return joiner.toString(); } + + public static class Builder { + + private FakeBigDecimalMap200Response instance; + + public Builder() { + this(new FakeBigDecimalMap200Response()); + } + + protected Builder(FakeBigDecimalMap200Response instance) { + this.instance = instance; + } + + public FakeBigDecimalMap200Response.Builder someId(BigDecimal someId) { + this.instance.someId = someId; + return this; + } + public FakeBigDecimalMap200Response.Builder someMap(Map someMap) { + this.instance.someMap = someMap; + return this; + } + + + /** + * returns a built FakeBigDecimalMap200Response instance. + * + * The builder is not reusable. + */ + public FakeBigDecimalMap200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FakeBigDecimalMap200Response.Builder builder() { + return new FakeBigDecimalMap200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FakeBigDecimalMap200Response.Builder toBuilder() { + return new FakeBigDecimalMap200Response.Builder() + .someId(getSomeId()) + .someMap(getSomeMap()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 2b5f168fef9..b02a9ec96e9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -198,5 +198,64 @@ public class FileSchemaTestClass { return joiner.toString(); } + + public static class Builder { + + private FileSchemaTestClass instance; + + public Builder() { + this(new FileSchemaTestClass()); + } + + protected Builder(FileSchemaTestClass instance) { + this.instance = instance; + } + + public FileSchemaTestClass.Builder _file(ModelFile _file) { + this.instance._file = _file; + return this; + } + public FileSchemaTestClass.Builder files(List files) { + this.instance.files = files; + return this; + } + + + /** + * returns a built FileSchemaTestClass instance. + * + * The builder is not reusable. + */ + public FileSchemaTestClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileSchemaTestClass.Builder builder() { + return new FileSchemaTestClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSchemaTestClass.Builder toBuilder() { + return new FileSchemaTestClass.Builder() + ._file(getFile()) + .files(getFiles()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java index b9009147ed6..ebe1809a039 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java @@ -146,5 +146,59 @@ public class Foo { return joiner.toString(); } + + public static class Builder { + + private Foo instance; + + public Builder() { + this(new Foo()); + } + + protected Builder(Foo instance) { + this.instance = instance; + } + + public Foo.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + + + /** + * returns a built Foo instance. + * + * The builder is not reusable. + */ + public Foo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Foo.Builder builder() { + return new Foo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Foo.Builder toBuilder() { + return new Foo.Builder() + .bar(getBar()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 1c15d8a3c9d..a5725a6d928 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -147,5 +147,59 @@ public class FooGetDefaultResponse { return joiner.toString(); } + + public static class Builder { + + private FooGetDefaultResponse instance; + + public Builder() { + this(new FooGetDefaultResponse()); + } + + protected Builder(FooGetDefaultResponse instance) { + this.instance = instance; + } + + public FooGetDefaultResponse.Builder string(Foo string) { + this.instance.string = string; + return this; + } + + + /** + * returns a built FooGetDefaultResponse instance. + * + * The builder is not reusable. + */ + public FooGetDefaultResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FooGetDefaultResponse.Builder builder() { + return new FooGetDefaultResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FooGetDefaultResponse.Builder toBuilder() { + return new FooGetDefaultResponse.Builder() + .string(getString()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index d49ae74cadc..64637e1466a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -701,5 +701,134 @@ public class FormatTest { return joiner.toString(); } + + public static class Builder { + + private FormatTest instance; + + public Builder() { + this(new FormatTest()); + } + + protected Builder(FormatTest instance) { + this.instance = instance; + } + + public FormatTest.Builder integer(Integer integer) { + this.instance.integer = integer; + return this; + } + public FormatTest.Builder int32(Integer int32) { + this.instance.int32 = int32; + return this; + } + public FormatTest.Builder int64(Long int64) { + this.instance.int64 = int64; + return this; + } + public FormatTest.Builder number(BigDecimal number) { + this.instance.number = number; + return this; + } + public FormatTest.Builder _float(Float _float) { + this.instance._float = _float; + return this; + } + public FormatTest.Builder _double(Double _double) { + this.instance._double = _double; + return this; + } + public FormatTest.Builder decimal(BigDecimal decimal) { + this.instance.decimal = decimal; + return this; + } + public FormatTest.Builder string(String string) { + this.instance.string = string; + return this; + } + public FormatTest.Builder _byte(byte[] _byte) { + this.instance._byte = _byte; + return this; + } + public FormatTest.Builder binary(File binary) { + this.instance.binary = binary; + return this; + } + public FormatTest.Builder date(LocalDate date) { + this.instance.date = date; + return this; + } + public FormatTest.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public FormatTest.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public FormatTest.Builder password(String password) { + this.instance.password = password; + return this; + } + public FormatTest.Builder patternWithDigits(String patternWithDigits) { + this.instance.patternWithDigits = patternWithDigits; + return this; + } + public FormatTest.Builder patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.instance.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * returns a built FormatTest instance. + * + * The builder is not reusable. + */ + public FormatTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FormatTest.Builder builder() { + return new FormatTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FormatTest.Builder toBuilder() { + return new FormatTest.Builder() + .integer(getInteger()) + .int32(getInt32()) + .int64(getInt64()) + .number(getNumber()) + ._float(getFloat()) + ._double(getDouble()) + .decimal(getDecimal()) + .string(getString()) + ._byte(getByte()) + .binary(getBinary()) + .date(getDate()) + .dateTime(getDateTime()) + .uuid(getUuid()) + .password(getPassword()) + .patternWithDigits(getPatternWithDigits()) + .patternWithDigitsAndDelimiter(getPatternWithDigitsAndDelimiter()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 1dea70c5ea1..4b095b70f84 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -168,5 +168,59 @@ static { mappings.put("GrandparentAnimal", GrandparentAnimal.class); JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); } + + public static class Builder { + + private GrandparentAnimal instance; + + public Builder() { + this(new GrandparentAnimal()); + } + + protected Builder(GrandparentAnimal instance) { + this.instance = instance; + } + + public GrandparentAnimal.Builder petType(String petType) { + this.instance.petType = petType; + return this; + } + + + /** + * returns a built GrandparentAnimal instance. + * + * The builder is not reusable. + */ + public GrandparentAnimal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GrandparentAnimal.Builder builder() { + return new GrandparentAnimal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GrandparentAnimal.Builder toBuilder() { + return new GrandparentAnimal.Builder() + .petType(getPetType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 780daa858b9..9b982eee32f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -172,5 +172,64 @@ public class HasOnlyReadOnly { return joiner.toString(); } + + public static class Builder { + + private HasOnlyReadOnly instance; + + public Builder() { + this(new HasOnlyReadOnly()); + } + + protected Builder(HasOnlyReadOnly instance) { + this.instance = instance; + } + + public HasOnlyReadOnly.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public HasOnlyReadOnly.Builder foo(String foo) { + this.instance.foo = foo; + return this; + } + + + /** + * returns a built HasOnlyReadOnly instance. + * + * The builder is not reusable. + */ + public HasOnlyReadOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HasOnlyReadOnly.Builder builder() { + return new HasOnlyReadOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HasOnlyReadOnly.Builder toBuilder() { + return new HasOnlyReadOnly.Builder() + .bar(getBar()) + .foo(getFoo()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java index f9770a701cc..4da81560047 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -169,5 +169,63 @@ public class HealthCheckResult { return joiner.toString(); } + + public static class Builder { + + private HealthCheckResult instance; + + public Builder() { + this(new HealthCheckResult()); + } + + protected Builder(HealthCheckResult instance) { + this.instance = instance; + } + + public HealthCheckResult.Builder nullableMessage(String nullableMessage) { + this.instance.nullableMessage = JsonNullable.of(nullableMessage); + return this; + } + public HealthCheckResult.Builder nullableMessage(JsonNullable nullableMessage) { + this.instance.nullableMessage = nullableMessage; + return this; + } + + + /** + * returns a built HealthCheckResult instance. + * + * The builder is not reusable. + */ + public HealthCheckResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HealthCheckResult.Builder builder() { + return new HealthCheckResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HealthCheckResult.Builder toBuilder() { + return new HealthCheckResult.Builder() + .nullableMessage(getNullableMessage()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index f8e3f920635..386789d058d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -182,5 +182,64 @@ public class IsoscelesTriangle { return joiner.toString(); } + + public static class Builder { + + private IsoscelesTriangle instance; + + public Builder() { + this(new IsoscelesTriangle()); + } + + protected Builder(IsoscelesTriangle instance) { + this.instance = instance; + } + + public IsoscelesTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public IsoscelesTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built IsoscelesTriangle instance. + * + * The builder is not reusable. + */ + public IsoscelesTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IsoscelesTriangle.Builder builder() { + return new IsoscelesTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IsoscelesTriangle.Builder toBuilder() { + return new IsoscelesTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index 6b792ff9ce2..38f7d53530f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -339,5 +339,74 @@ public class MapTest { return joiner.toString(); } + + public static class Builder { + + private MapTest instance; + + public Builder() { + this(new MapTest()); + } + + protected Builder(MapTest instance) { + this.instance = instance; + } + + public MapTest.Builder mapMapOfString(Map> mapMapOfString) { + this.instance.mapMapOfString = mapMapOfString; + return this; + } + public MapTest.Builder mapOfEnumString(Map mapOfEnumString) { + this.instance.mapOfEnumString = mapOfEnumString; + return this; + } + public MapTest.Builder directMap(Map directMap) { + this.instance.directMap = directMap; + return this; + } + public MapTest.Builder indirectMap(Map indirectMap) { + this.instance.indirectMap = indirectMap; + return this; + } + + + /** + * returns a built MapTest instance. + * + * The builder is not reusable. + */ + public MapTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MapTest.Builder builder() { + return new MapTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MapTest.Builder toBuilder() { + return new MapTest.Builder() + .mapMapOfString(getMapMapOfString()) + .mapOfEnumString(getMapOfEnumString()) + .directMap(getDirectMap()) + .indirectMap(getIndirectMap()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6c6b970ae15..afc64863e50 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -236,5 +236,69 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return joiner.toString(); } + + public static class Builder { + + private MixedPropertiesAndAdditionalPropertiesClass instance; + + public Builder() { + this(new MixedPropertiesAndAdditionalPropertiesClass()); + } + + protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) { + this.instance = instance; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) { + this.instance.map = map; + return this; + } + + + /** + * returns a built MixedPropertiesAndAdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public MixedPropertiesAndAdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder() + .uuid(getUuid()) + .dateTime(getDateTime()) + .map(getMap()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index 09243076ef5..46c45395701 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -182,5 +182,64 @@ public class Model200Response { return joiner.toString(); } + + public static class Builder { + + private Model200Response instance; + + public Builder() { + this(new Model200Response()); + } + + protected Builder(Model200Response instance) { + this.instance = instance; + } + + public Model200Response.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Model200Response.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built Model200Response instance. + * + * The builder is not reusable. + */ + public Model200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Model200Response.Builder builder() { + return new Model200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Model200Response.Builder toBuilder() { + return new Model200Response.Builder() + .name(getName()) + .propertyClass(getPropertyClass()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 91cbcabac89..79a1db7a3a2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -218,5 +218,69 @@ public class ModelApiResponse { return joiner.toString(); } + + public static class Builder { + + private ModelApiResponse instance; + + public Builder() { + this(new ModelApiResponse()); + } + + protected Builder(ModelApiResponse instance) { + this.instance = instance; + } + + public ModelApiResponse.Builder code(Integer code) { + this.instance.code = code; + return this; + } + public ModelApiResponse.Builder type(String type) { + this.instance.type = type; + return this; + } + public ModelApiResponse.Builder message(String message) { + this.instance.message = message; + return this; + } + + + /** + * returns a built ModelApiResponse instance. + * + * The builder is not reusable. + */ + public ModelApiResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelApiResponse.Builder builder() { + return new ModelApiResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelApiResponse.Builder toBuilder() { + return new ModelApiResponse.Builder() + .code(getCode()) + .type(getType()) + .message(getMessage()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java index 0f857ffe15e..212d9ba68ff 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java @@ -146,5 +146,59 @@ public class ModelFile { return joiner.toString(); } + + public static class Builder { + + private ModelFile instance; + + public Builder() { + this(new ModelFile()); + } + + protected Builder(ModelFile instance) { + this.instance = instance; + } + + public ModelFile.Builder sourceURI(String sourceURI) { + this.instance.sourceURI = sourceURI; + return this; + } + + + /** + * returns a built ModelFile instance. + * + * The builder is not reusable. + */ + public ModelFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelFile.Builder builder() { + return new ModelFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelFile.Builder toBuilder() { + return new ModelFile.Builder() + .sourceURI(getSourceURI()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java index 586be99e907..49d00056c6a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java @@ -146,5 +146,59 @@ public class ModelList { return joiner.toString(); } + + public static class Builder { + + private ModelList instance; + + public Builder() { + this(new ModelList()); + } + + protected Builder(ModelList instance) { + this.instance = instance; + } + + public ModelList.Builder _123list(String _123list) { + this.instance._123list = _123list; + return this; + } + + + /** + * returns a built ModelList instance. + * + * The builder is not reusable. + */ + public ModelList build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelList.Builder builder() { + return new ModelList.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelList.Builder toBuilder() { + return new ModelList.Builder() + ._123list(get123list()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 719aaf4d663..fc5c6cb34a9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -146,5 +146,59 @@ public class ModelReturn { return joiner.toString(); } + + public static class Builder { + + private ModelReturn instance; + + public Builder() { + this(new ModelReturn()); + } + + protected Builder(ModelReturn instance) { + this.instance = instance; + } + + public ModelReturn.Builder _return(Integer _return) { + this.instance._return = _return; + return this; + } + + + /** + * returns a built ModelReturn instance. + * + * The builder is not reusable. + */ + public ModelReturn build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelReturn.Builder builder() { + return new ModelReturn.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelReturn.Builder toBuilder() { + return new ModelReturn.Builder() + ._return(getReturn()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index a4145fd96b0..8592a46a3aa 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -244,5 +244,74 @@ public class Name { return joiner.toString(); } + + public static class Builder { + + private Name instance; + + public Builder() { + this(new Name()); + } + + protected Builder(Name instance) { + this.instance = instance; + } + + public Name.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Name.Builder snakeCase(Integer snakeCase) { + this.instance.snakeCase = snakeCase; + return this; + } + public Name.Builder property(String property) { + this.instance.property = property; + return this; + } + public Name.Builder _123number(Integer _123number) { + this.instance._123number = _123number; + return this; + } + + + /** + * returns a built Name instance. + * + * The builder is not reusable. + */ + public Name build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Name.Builder builder() { + return new Name.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Name.Builder toBuilder() { + return new Name.Builder() + .name(getName()) + .snakeCase(getSnakeCase()) + .property(getProperty()) + ._123number(get123number()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java index 60063ab0985..65715112047 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java @@ -783,5 +783,154 @@ public class NullableClass extends HashMap { return joiner.toString(); } + + public static class Builder { + + private NullableClass instance; + + public Builder() { + this(new NullableClass()); + } + + protected Builder(NullableClass instance) { + this.instance = instance; + } + + public NullableClass.Builder integerProp(Integer integerProp) { + this.instance.integerProp = JsonNullable.of(integerProp); + return this; + } + public NullableClass.Builder integerProp(JsonNullable integerProp) { + this.instance.integerProp = integerProp; + return this; + } + public NullableClass.Builder numberProp(BigDecimal numberProp) { + this.instance.numberProp = JsonNullable.of(numberProp); + return this; + } + public NullableClass.Builder numberProp(JsonNullable numberProp) { + this.instance.numberProp = numberProp; + return this; + } + public NullableClass.Builder booleanProp(Boolean booleanProp) { + this.instance.booleanProp = JsonNullable.of(booleanProp); + return this; + } + public NullableClass.Builder booleanProp(JsonNullable booleanProp) { + this.instance.booleanProp = booleanProp; + return this; + } + public NullableClass.Builder stringProp(String stringProp) { + this.instance.stringProp = JsonNullable.of(stringProp); + return this; + } + public NullableClass.Builder stringProp(JsonNullable stringProp) { + this.instance.stringProp = stringProp; + return this; + } + public NullableClass.Builder dateProp(LocalDate dateProp) { + this.instance.dateProp = JsonNullable.of(dateProp); + return this; + } + public NullableClass.Builder dateProp(JsonNullable dateProp) { + this.instance.dateProp = dateProp; + return this; + } + public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) { + this.instance.datetimeProp = JsonNullable.of(datetimeProp); + return this; + } + public NullableClass.Builder datetimeProp(JsonNullable datetimeProp) { + this.instance.datetimeProp = datetimeProp; + return this; + } + public NullableClass.Builder arrayNullableProp(List arrayNullableProp) { + this.instance.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + return this; + } + public NullableClass.Builder arrayNullableProp(JsonNullable> arrayNullableProp) { + this.instance.arrayNullableProp = arrayNullableProp; + return this; + } + public NullableClass.Builder arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.instance.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + return this; + } + public NullableClass.Builder arrayAndItemsNullableProp(JsonNullable> arrayAndItemsNullableProp) { + this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + public NullableClass.Builder arrayItemsNullable(List arrayItemsNullable) { + this.instance.arrayItemsNullable = arrayItemsNullable; + return this; + } + public NullableClass.Builder objectNullableProp(Map objectNullableProp) { + this.instance.objectNullableProp = JsonNullable.>of(objectNullableProp); + return this; + } + public NullableClass.Builder objectNullableProp(JsonNullable> objectNullableProp) { + this.instance.objectNullableProp = objectNullableProp; + return this; + } + public NullableClass.Builder objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.instance.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + return this; + } + public NullableClass.Builder objectAndItemsNullableProp(JsonNullable> objectAndItemsNullableProp) { + this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + public NullableClass.Builder objectItemsNullable(Map objectItemsNullable) { + this.instance.objectItemsNullable = objectItemsNullable; + return this; + } + + + /** + * returns a built NullableClass instance. + * + * The builder is not reusable. + */ + public NullableClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NullableClass.Builder builder() { + return new NullableClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NullableClass.Builder toBuilder() { + return new NullableClass.Builder() + .integerProp(getIntegerProp()) + .numberProp(getNumberProp()) + .booleanProp(getBooleanProp()) + .stringProp(getStringProp()) + .dateProp(getDateProp()) + .datetimeProp(getDatetimeProp()) + .arrayNullableProp(getArrayNullableProp()) + .arrayAndItemsNullableProp(getArrayAndItemsNullableProp()) + .arrayItemsNullable(getArrayItemsNullable()) + .objectNullableProp(getObjectNullableProp()) + .objectAndItemsNullableProp(getObjectAndItemsNullableProp()) + .objectItemsNullable(getObjectItemsNullable()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index 2736cae3473..425846c2814 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -147,5 +147,59 @@ public class NumberOnly { return joiner.toString(); } + + public static class Builder { + + private NumberOnly instance; + + public Builder() { + this(new NumberOnly()); + } + + protected Builder(NumberOnly instance) { + this.instance = instance; + } + + public NumberOnly.Builder justNumber(BigDecimal justNumber) { + this.instance.justNumber = justNumber; + return this; + } + + + /** + * returns a built NumberOnly instance. + * + * The builder is not reusable. + */ + public NumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NumberOnly.Builder builder() { + return new NumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NumberOnly.Builder toBuilder() { + return new NumberOnly.Builder() + .justNumber(getJustNumber()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index c2006c37afb..dd138039de7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -276,5 +276,74 @@ public class ObjectWithDeprecatedFields { return joiner.toString(); } + + public static class Builder { + + private ObjectWithDeprecatedFields instance; + + public Builder() { + this(new ObjectWithDeprecatedFields()); + } + + protected Builder(ObjectWithDeprecatedFields instance) { + this.instance = instance; + } + + public ObjectWithDeprecatedFields.Builder uuid(String uuid) { + this.instance.uuid = uuid; + return this; + } + public ObjectWithDeprecatedFields.Builder id(BigDecimal id) { + this.instance.id = id; + return this; + } + public ObjectWithDeprecatedFields.Builder deprecatedRef(DeprecatedObject deprecatedRef) { + this.instance.deprecatedRef = deprecatedRef; + return this; + } + public ObjectWithDeprecatedFields.Builder bars(List bars) { + this.instance.bars = bars; + return this; + } + + + /** + * returns a built ObjectWithDeprecatedFields instance. + * + * The builder is not reusable. + */ + public ObjectWithDeprecatedFields build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ObjectWithDeprecatedFields.Builder builder() { + return new ObjectWithDeprecatedFields.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ObjectWithDeprecatedFields.Builder toBuilder() { + return new ObjectWithDeprecatedFields.Builder() + .uuid(getUuid()) + .id(getId()) + .deprecatedRef(getDeprecatedRef()) + .bars(getBars()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index c94a9b5d44b..f242366e513 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -364,5 +364,84 @@ public class Order { return joiner.toString(); } + + public static class Builder { + + private Order instance; + + public Builder() { + this(new Order()); + } + + protected Builder(Order instance) { + this.instance = instance; + } + + public Order.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Order.Builder petId(Long petId) { + this.instance.petId = petId; + return this; + } + public Order.Builder quantity(Integer quantity) { + this.instance.quantity = quantity; + return this; + } + public Order.Builder shipDate(OffsetDateTime shipDate) { + this.instance.shipDate = shipDate; + return this; + } + public Order.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + public Order.Builder complete(Boolean complete) { + this.instance.complete = complete; + return this; + } + + + /** + * returns a built Order instance. + * + * The builder is not reusable. + */ + public Order build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Order.Builder builder() { + return new Order.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Order.Builder toBuilder() { + return new Order.Builder() + .id(getId()) + .petId(getPetId()) + .quantity(getQuantity()) + .shipDate(getShipDate()) + .status(getStatus()) + .complete(getComplete()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index ae20f0bb8ff..e8b8df50c1e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -219,5 +219,69 @@ public class OuterComposite { return joiner.toString(); } + + public static class Builder { + + private OuterComposite instance; + + public Builder() { + this(new OuterComposite()); + } + + protected Builder(OuterComposite instance) { + this.instance = instance; + } + + public OuterComposite.Builder myNumber(BigDecimal myNumber) { + this.instance.myNumber = myNumber; + return this; + } + public OuterComposite.Builder myString(String myString) { + this.instance.myString = myString; + return this; + } + public OuterComposite.Builder myBoolean(Boolean myBoolean) { + this.instance.myBoolean = myBoolean; + return this; + } + + + /** + * returns a built OuterComposite instance. + * + * The builder is not reusable. + */ + public OuterComposite build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OuterComposite.Builder builder() { + return new OuterComposite.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OuterComposite.Builder toBuilder() { + return new OuterComposite.Builder() + .myNumber(getMyNumber()) + .myString(getMyString()) + .myBoolean(getMyBoolean()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java index afda1fcc6f0..a636c0d6a39 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java @@ -143,5 +143,62 @@ static { mappings.put("ParentPet", ParentPet.class); JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); } + + public static class Builder extends GrandparentAnimal.Builder { + + private ParentPet instance; + + public Builder() { + this(new ParentPet()); + } + + protected Builder(ParentPet instance) { + super(instance); + this.instance = instance; + } + + + public ParentPet.Builder petType(String petType) { // inherited: true + super.petType(petType); + return this; + } + + + /** + * returns a built ParentPet instance. + * + * The builder is not reusable. + */ + public ParentPet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ParentPet.Builder builder() { + return new ParentPet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentPet.Builder toBuilder() { + return new ParentPet.Builder() + .petType(getPetType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index beb52e3b073..4eb7099d073 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -392,5 +392,84 @@ public class Pet { return joiner.toString(); } + + public static class Builder { + + private Pet instance; + + public Builder() { + this(new Pet()); + } + + protected Builder(Pet instance) { + this.instance = instance; + } + + public Pet.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Pet.Builder category(Category category) { + this.instance.category = category; + return this; + } + public Pet.Builder name(String name) { + this.instance.name = name; + return this; + } + public Pet.Builder photoUrls(List photoUrls) { + this.instance.photoUrls = photoUrls; + return this; + } + public Pet.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + public Pet.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + + + /** + * returns a built Pet instance. + * + * The builder is not reusable. + */ + public Pet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Pet.Builder builder() { + return new Pet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pet.Builder toBuilder() { + return new Pet.Builder() + .id(getId()) + .category(getCategory()) + .name(getName()) + .photoUrls(getPhotoUrls()) + .tags(getTags()) + .status(getStatus()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index e75c80813f9..82e05ef5fee 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -146,5 +146,59 @@ public class QuadrilateralInterface { return joiner.toString(); } + + public static class Builder { + + private QuadrilateralInterface instance; + + public Builder() { + this(new QuadrilateralInterface()); + } + + protected Builder(QuadrilateralInterface instance) { + this.instance = instance; + } + + public QuadrilateralInterface.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built QuadrilateralInterface instance. + * + * The builder is not reusable. + */ + public QuadrilateralInterface build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuadrilateralInterface.Builder builder() { + return new QuadrilateralInterface.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuadrilateralInterface.Builder toBuilder() { + return new QuadrilateralInterface.Builder() + .quadrilateralType(getQuadrilateralType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 88c7063be00..6e30af28f51 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -180,5 +180,64 @@ public class ReadOnlyFirst { return joiner.toString(); } + + public static class Builder { + + private ReadOnlyFirst instance; + + public Builder() { + this(new ReadOnlyFirst()); + } + + protected Builder(ReadOnlyFirst instance) { + this.instance = instance; + } + + public ReadOnlyFirst.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public ReadOnlyFirst.Builder baz(String baz) { + this.instance.baz = baz; + return this; + } + + + /** + * returns a built ReadOnlyFirst instance. + * + * The builder is not reusable. + */ + public ReadOnlyFirst build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ReadOnlyFirst.Builder builder() { + return new ReadOnlyFirst.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadOnlyFirst.Builder toBuilder() { + return new ReadOnlyFirst.Builder() + .bar(getBar()) + .baz(getBaz()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 1006fe856ca..1659c5b61b4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -182,5 +182,64 @@ public class ScaleneTriangle { return joiner.toString(); } + + public static class Builder { + + private ScaleneTriangle instance; + + public Builder() { + this(new ScaleneTriangle()); + } + + protected Builder(ScaleneTriangle instance) { + this.instance = instance; + } + + public ScaleneTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public ScaleneTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built ScaleneTriangle instance. + * + * The builder is not reusable. + */ + public ScaleneTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScaleneTriangle.Builder builder() { + return new ScaleneTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScaleneTriangle.Builder toBuilder() { + return new ScaleneTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java index b6fa6c00047..2219837f61f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -146,5 +146,59 @@ public class ShapeInterface { return joiner.toString(); } + + public static class Builder { + + private ShapeInterface instance; + + public Builder() { + this(new ShapeInterface()); + } + + protected Builder(ShapeInterface instance) { + this.instance = instance; + } + + public ShapeInterface.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + + + /** + * returns a built ShapeInterface instance. + * + * The builder is not reusable. + */ + public ShapeInterface build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ShapeInterface.Builder builder() { + return new ShapeInterface.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ShapeInterface.Builder toBuilder() { + return new ShapeInterface.Builder() + .shapeType(getShapeType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index e8722bab705..09aa22a5470 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -182,5 +182,64 @@ public class SimpleQuadrilateral { return joiner.toString(); } + + public static class Builder { + + private SimpleQuadrilateral instance; + + public Builder() { + this(new SimpleQuadrilateral()); + } + + protected Builder(SimpleQuadrilateral instance) { + this.instance = instance; + } + + public SimpleQuadrilateral.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public SimpleQuadrilateral.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built SimpleQuadrilateral instance. + * + * The builder is not reusable. + */ + public SimpleQuadrilateral build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SimpleQuadrilateral.Builder builder() { + return new SimpleQuadrilateral.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SimpleQuadrilateral.Builder toBuilder() { + return new SimpleQuadrilateral.Builder() + .shapeType(getShapeType()) + .quadrilateralType(getQuadrilateralType()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index f106823e112..445f661d690 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -182,5 +182,64 @@ public class SpecialModelName { return joiner.toString(); } + + public static class Builder { + + private SpecialModelName instance; + + public Builder() { + this(new SpecialModelName()); + } + + protected Builder(SpecialModelName instance) { + this.instance = instance; + } + + public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) { + this.instance.$specialPropertyName = $specialPropertyName; + return this; + } + public SpecialModelName.Builder specialModelName(String specialModelName) { + this.instance.specialModelName = specialModelName; + return this; + } + + + /** + * returns a built SpecialModelName instance. + * + * The builder is not reusable. + */ + public SpecialModelName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SpecialModelName.Builder builder() { + return new SpecialModelName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialModelName.Builder toBuilder() { + return new SpecialModelName.Builder() + .$specialPropertyName(get$SpecialPropertyName()) + .specialModelName(getSpecialModelName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 66157ea8d85..ca946bf4bae 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -182,5 +182,64 @@ public class Tag { return joiner.toString(); } + + public static class Builder { + + private Tag instance; + + public Builder() { + this(new Tag()); + } + + protected Builder(Tag instance) { + this.instance = instance; + } + + public Tag.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Tag.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Tag instance. + * + * The builder is not reusable. + */ + public Tag build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Tag.Builder builder() { + return new Tag.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Tag.Builder toBuilder() { + return new Tag.Builder() + .id(getId()) + .name(getName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index a286fd840b2..f3a5cc7f97a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -199,5 +199,59 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapof(objectWithNoDeclaredPropsNullable); + return this; + } + public User.Builder objectWithNoDeclaredPropsNullable(JsonNullable objectWithNoDeclaredPropsNullable) { + this.instance.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + return this; + } + public User.Builder anyTypeProp(Object anyTypeProp) { + this.instance.anyTypeProp = JsonNullable.of(anyTypeProp); + return this; + } + public User.Builder anyTypeProp(JsonNullable anyTypeProp) { + this.instance.anyTypeProp = anyTypeProp; + return this; + } + public User.Builder anyTypePropNullable(Object anyTypePropNullable) { + this.instance.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + return this; + } + public User.Builder anyTypePropNullable(JsonNullable anyTypePropNullable) { + this.instance.anyTypePropNullable = anyTypePropNullable; + return this; + } + + + /** + * returns a built User instance. + * + * The builder is not reusable. + */ + public User build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static User.Builder builder() { + return new User.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public User.Builder toBuilder() { + return new User.Builder() + .id(getId()) + .username(getUsername()) + .firstName(getFirstName()) + .lastName(getLastName()) + .email(getEmail()) + .password(getPassword()) + .phone(getPhone()) + .userStatus(getUserStatus()) + .objectWithNoDeclaredProps(getObjectWithNoDeclaredProps()) + .objectWithNoDeclaredPropsNullable(getObjectWithNoDeclaredPropsNullable()) + .anyTypeProp(getAnyTypeProp()) + .anyTypePropNullable(getAnyTypePropNullable()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java index 1205003676c..4d65da6d9c7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java @@ -218,5 +218,69 @@ public class Whale { return joiner.toString(); } + + public static class Builder { + + private Whale instance; + + public Builder() { + this(new Whale()); + } + + protected Builder(Whale instance) { + this.instance = instance; + } + + public Whale.Builder hasBaleen(Boolean hasBaleen) { + this.instance.hasBaleen = hasBaleen; + return this; + } + public Whale.Builder hasTeeth(Boolean hasTeeth) { + this.instance.hasTeeth = hasTeeth; + return this; + } + public Whale.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built Whale instance. + * + * The builder is not reusable. + */ + public Whale build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Whale.Builder builder() { + return new Whale.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Whale.Builder toBuilder() { + return new Whale.Builder() + .hasBaleen(getHasBaleen()) + .hasTeeth(getHasTeeth()) + .className(getClassName()); + } + } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java index 84fc0fd0bc5..6d8e1c9f49a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java @@ -272,5 +272,64 @@ public class Zebra extends HashMap { return joiner.toString(); } + + public static class Builder { + + private Zebra instance; + + public Builder() { + this(new Zebra()); + } + + protected Builder(Zebra instance) { + this.instance = instance; + } + + public Zebra.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public Zebra.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built Zebra instance. + * + * The builder is not reusable. + */ + public Zebra build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Zebra.Builder builder() { + return new Zebra.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Zebra.Builder toBuilder() { + return new Zebra.Builder() + .type(getType()) + .className(getClassName()); + } + } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index b0d39879d43..b812818db87 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +28,7 @@ import java.util.Set; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java index ce4c8907520..11eb73abdc1 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +28,7 @@ import java.util.Set; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java index e91b2e41874..a8ea6ca4343 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -24,8 +24,8 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -37,7 +37,7 @@ import java.util.Set; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 005434c820f..170eed53edf 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +28,7 @@ import java.util.Set; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java index 304a7911b1c..d41f6f617ce 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,8 @@ import org.openapitools.client.ApiException; import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -30,7 +30,7 @@ import java.util.Set; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java index 6d3e1bc7eac..b035e91df34 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -15,8 +15,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -28,7 +28,7 @@ import java.util.Set; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java index 4ffe22ee19e..dba8a8d0018 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -16,8 +16,8 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +29,7 @@ import java.util.Set; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce42..6d12f2d7d10 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..8c231167d61 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java index 15d5c977c6b..24d4c7cad74 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java index d9ccc722303..a169ab60d39 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java index 2eb05360fa7..62100b06ec3 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java index a7befd2fc71..f89792f0d30 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..7d6ca2902ab 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..1db82cbdea3 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..4a3a3cc839a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java index 4600d943d5e..b605d146e40 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java index 0f2d70f73bb..70be9e32c94 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java index 0685bc78acd..43fa0a23f36 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..1f133e4142e 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e3..867c64d5651 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..84df0f1e24d 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java index 0a7641556e3..63cf65386e7 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentPet; import java.util.Set; import java.util.HashSet; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..0efd2b03752 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..9fee039a47a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java index 8c22f071a84..995ed5daeb4 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java index 8f7c39b3870..8568207d971 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..06d58640393 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..0f9f43fd3ca 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java index 61b5ed74c4f..c2a0659731b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -30,9 +30,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..bd426ae14b5 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..19518a5f665 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade7..8522172bdfc 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,9 +26,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java index 956462f1b11..d6450f92d36 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..1792f6169d9 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..53b20d7bdd3 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..85c3e9a29e7 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..b1825eb48eb 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da1004..2d1505241d8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,9 +23,9 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java index f6042b16d49..59d4bcfc12b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java index 9da443eea30..e9153d8010a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java index 8e70b77b8ba..2625ac7b07c 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java index 495240f4760..7ba9aa57e8e 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.ParentPet; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..9a76d3c9534 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9..d627568b70c 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,9 +22,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java index d1eb131972f..494aeb29719 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java index 17c804511d0..ff3ec21df4b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Pig; import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..c85527e8536 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..c5f70f4c8f0 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,9 +23,9 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..0952e6472d0 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..d57f8680047 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..4b2d7105211 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..f39c6a118e3 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..a6968d2b87e 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..39ff782a3ea 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..86e5a4e7249 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -29,9 +29,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java index bc24e8f12b2..387933e4ca8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..88a5503ccf9 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..72978f65097 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..17f411d1ede 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..11d7eeac3b7 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..db6de4ebd34 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..44b97d47c2e 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..908c8ce7e21 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..f7293142020 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..579a7f62fa7 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java index 6bc9c402926..cf712c8e3b8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ChildCat; import org.openapitools.client.model.GrandparentAnimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..a10e870d0fd 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java @@ -25,9 +25,9 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java index f0cfa53e1ac..a877a11b87f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java index 60553d39ea7..12b7e7a26b6 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java index 9b0850dbfcc..472f5cf4b1f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..11ab8eaf4fe 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java index d34e9885594..5f5d499da94 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java index 3014f1cdb7f..f7baab916ce 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java index a3b57190151..93f71dcf9ea 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java index a0cb2a8d699..43d7a99da4a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java index 93e06a1063e..d448e6d80b2 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..7db38f4f338 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..c5d7ce076d6 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..382a573036b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 7ab59f334f2..8488ed25358 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java index a0abfe85411..afb79ca5d41 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java index 0d606efde23..d260c70f40f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.EquilateralTriangle; import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..eccfbf5e126 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java index 25911285280..48f4f071512 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java index 0e460afcec2..3be21d660bb 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/samples/client/petstore/java/okhttp-gson-3.1/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-3.1/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-3.1/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-3.1/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-3.1/.openapi-generator/FILES index 1f507055a79..2cba9718100 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-3.1/.openapi-generator/FILES @@ -5,6 +5,7 @@ README.md api/openapi.yaml build.gradle build.sbt +docs/AllOfSimpleModel.md docs/Animal.md docs/AnyTypeTest.md docs/ArrayOfSameRef.md @@ -21,6 +22,7 @@ docs/OneOfStringOrInt.md docs/Order.md docs/Pet.md docs/PetApi.md +docs/SimpleModelWithArrayProperty.md docs/StoreApi.md docs/StringOrInt.md docs/Tag.md @@ -61,6 +63,7 @@ src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java src/main/java/org/openapitools/client/auth/RetryingOAuth.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AllOfSimpleModel.java src/main/java/org/openapitools/client/model/Animal.java src/main/java/org/openapitools/client/model/AnyTypeTest.java src/main/java/org/openapitools/client/model/ArrayOfSameRef.java @@ -75,6 +78,7 @@ src/main/java/org/openapitools/client/model/ModelApiResponse.java src/main/java/org/openapitools/client/model/OneOfStringOrInt.java src/main/java/org/openapitools/client/model/Order.java src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/SimpleModelWithArrayProperty.java src/main/java/org/openapitools/client/model/StringOrInt.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/okhttp-gson-3.1/README.md b/samples/client/petstore/java/okhttp-gson-3.1/README.md index dcede5d1bcb..2a378569612 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/README.md +++ b/samples/client/petstore/java/okhttp-gson-3.1/README.md @@ -144,6 +144,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [AllOfSimpleModel](docs/AllOfSimpleModel.md) - [Animal](docs/Animal.md) - [AnyTypeTest](docs/AnyTypeTest.md) - [ArrayOfSameRef](docs/ArrayOfSameRef.md) @@ -158,6 +159,7 @@ Class | Method | HTTP request | Description - [OneOfStringOrInt](docs/OneOfStringOrInt.md) - [Order](docs/Order.md) - [Pet](docs/Pet.md) + - [SimpleModelWithArrayProperty](docs/SimpleModelWithArrayProperty.md) - [StringOrInt](docs/StringOrInt.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml index 27061efd082..4f61199e49a 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml @@ -1063,6 +1063,17 @@ components: - Code 2 - Code 3 type: string + SimpleModelWithArrayProperty: + properties: + arrayOfStrings: + items: + type: string + type: array + required: + - arrayOfStrings + AllOfSimpleModel: + allOf: + - $ref: '#/components/schemas/SimpleModelWithArrayProperty' updatePetWithForm_request: properties: name: diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle index c50f27fa8ae..9c49711c900 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt index 1cfb07976ed..6d08084ea4a 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-3.1/docs/AllOfSimpleModel.md b/samples/client/petstore/java/okhttp-gson-3.1/docs/AllOfSimpleModel.md new file mode 100644 index 00000000000..de96aa498bd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/docs/AllOfSimpleModel.md @@ -0,0 +1,13 @@ + + +# AllOfSimpleModel + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfStrings** | **List<String>** | | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-3.1/docs/SimpleModelWithArrayProperty.md b/samples/client/petstore/java/okhttp-gson-3.1/docs/SimpleModelWithArrayProperty.md new file mode 100644 index 00000000000..17737af5ceb --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/docs/SimpleModelWithArrayProperty.md @@ -0,0 +1,13 @@ + + +# SimpleModelWithArrayProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfStrings** | **List<String>** | | | + + + diff --git a/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-3.1/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-3.1/gradlew b/samples/client/petstore/java/okhttp-gson-3.1/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/gradlew +++ b/samples/client/petstore/java/okhttp-gson-3.1/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-3.1/gradlew.bat b/samples/client/petstore/java/okhttp-gson-3.1/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-3.1/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml index c8415c8f73e..0871be01351 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml @@ -339,7 +339,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/JSON.java index d5949d40548..f5823fd7522 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/JSON.java @@ -129,6 +129,7 @@ public class JSON { gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AllOfSimpleModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.AnyTypeTest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ArrayOfSameRef.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Cat.CustomTypeAdapterFactory()); @@ -141,6 +142,7 @@ public class JSON { gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OneOfStringOrInt.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Order.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SimpleModelWithArrayProperty.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.StringOrInt.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Tag.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.User.CustomTypeAdapterFactory()); diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AllOfSimpleModel.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AllOfSimpleModel.java new file mode 100644 index 00000000000..23fab4dc21c --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AllOfSimpleModel.java @@ -0,0 +1,308 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * AllOfSimpleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AllOfSimpleModel { + public static final String SERIALIZED_NAME_ARRAY_OF_STRINGS = "arrayOfStrings"; + @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRINGS) + private List arrayOfStrings = new ArrayList<>(); + + public AllOfSimpleModel() { + } + + public AllOfSimpleModel arrayOfStrings(List arrayOfStrings) { + this.arrayOfStrings = arrayOfStrings; + return this; + } + + public AllOfSimpleModel addArrayOfStringsItem(String arrayOfStringsItem) { + if (this.arrayOfStrings == null) { + this.arrayOfStrings = new ArrayList<>(); + } + this.arrayOfStrings.add(arrayOfStringsItem); + return this; + } + + /** + * Get arrayOfStrings + * @return arrayOfStrings + **/ + @javax.annotation.Nonnull + public List getArrayOfStrings() { + return arrayOfStrings; + } + + public void setArrayOfStrings(List arrayOfStrings) { + this.arrayOfStrings = arrayOfStrings; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AllOfSimpleModel instance itself + */ + public AllOfSimpleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfSimpleModel allOfSimpleModel = (AllOfSimpleModel) o; + return Objects.equals(this.arrayOfStrings, allOfSimpleModel.arrayOfStrings)&& + Objects.equals(this.additionalProperties, allOfSimpleModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfStrings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfSimpleModel {\n"); + sb.append(" arrayOfStrings: ").append(toIndentedString(arrayOfStrings)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("arrayOfStrings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("arrayOfStrings"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AllOfSimpleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AllOfSimpleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AllOfSimpleModel is not found in the empty JSON string", AllOfSimpleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AllOfSimpleModel.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("arrayOfStrings") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("arrayOfStrings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrayOfStrings` to be an array in the JSON string but got `%s`", jsonObj.get("arrayOfStrings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AllOfSimpleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AllOfSimpleModel' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AllOfSimpleModel.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AllOfSimpleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AllOfSimpleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AllOfSimpleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AllOfSimpleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AllOfSimpleModel + * @throws IOException if the JSON string is invalid with respect to AllOfSimpleModel + */ + public static AllOfSimpleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AllOfSimpleModel.class); + } + + /** + * Convert an instance of AllOfSimpleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/OneOfStringOrInt.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/OneOfStringOrInt.java index c669abfc640..c0c05a4c1e5 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/OneOfStringOrInt.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/OneOfStringOrInt.java @@ -145,12 +145,7 @@ public class OneOfStringOrInt extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public OneOfStringOrInt(Integer o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public OneOfStringOrInt(String o) { + public OneOfStringOrInt(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/SimpleModelWithArrayProperty.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/SimpleModelWithArrayProperty.java new file mode 100644 index 00000000000..4e999eacc45 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/SimpleModelWithArrayProperty.java @@ -0,0 +1,308 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * SimpleModelWithArrayProperty + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class SimpleModelWithArrayProperty { + public static final String SERIALIZED_NAME_ARRAY_OF_STRINGS = "arrayOfStrings"; + @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRINGS) + private List arrayOfStrings = new ArrayList<>(); + + public SimpleModelWithArrayProperty() { + } + + public SimpleModelWithArrayProperty arrayOfStrings(List arrayOfStrings) { + this.arrayOfStrings = arrayOfStrings; + return this; + } + + public SimpleModelWithArrayProperty addArrayOfStringsItem(String arrayOfStringsItem) { + if (this.arrayOfStrings == null) { + this.arrayOfStrings = new ArrayList<>(); + } + this.arrayOfStrings.add(arrayOfStringsItem); + return this; + } + + /** + * Get arrayOfStrings + * @return arrayOfStrings + **/ + @javax.annotation.Nonnull + public List getArrayOfStrings() { + return arrayOfStrings; + } + + public void setArrayOfStrings(List arrayOfStrings) { + this.arrayOfStrings = arrayOfStrings; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SimpleModelWithArrayProperty instance itself + */ + public SimpleModelWithArrayProperty putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleModelWithArrayProperty simpleModelWithArrayProperty = (SimpleModelWithArrayProperty) o; + return Objects.equals(this.arrayOfStrings, simpleModelWithArrayProperty.arrayOfStrings)&& + Objects.equals(this.additionalProperties, simpleModelWithArrayProperty.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfStrings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleModelWithArrayProperty {\n"); + sb.append(" arrayOfStrings: ").append(toIndentedString(arrayOfStrings)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("arrayOfStrings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("arrayOfStrings"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimpleModelWithArrayProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SimpleModelWithArrayProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SimpleModelWithArrayProperty is not found in the empty JSON string", SimpleModelWithArrayProperty.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimpleModelWithArrayProperty.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the required json array is present + if (jsonObj.get("arrayOfStrings") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("arrayOfStrings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `arrayOfStrings` to be an array in the JSON string but got `%s`", jsonObj.get("arrayOfStrings").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimpleModelWithArrayProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimpleModelWithArrayProperty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SimpleModelWithArrayProperty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SimpleModelWithArrayProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SimpleModelWithArrayProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SimpleModelWithArrayProperty instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SimpleModelWithArrayProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleModelWithArrayProperty + * @throws IOException if the JSON string is invalid with respect to SimpleModelWithArrayProperty + */ + public static SimpleModelWithArrayProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimpleModelWithArrayProperty.class); + } + + /** + * Convert an instance of SimpleModelWithArrayProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/StringOrInt.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/StringOrInt.java index ba582c2539c..3d1fd8e3cc8 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/StringOrInt.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/StringOrInt.java @@ -140,12 +140,7 @@ public class StringOrInt extends AbstractOpenApiSchema { super("anyOf", Boolean.FALSE); } - public StringOrInt(Integer o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public StringOrInt(String o) { + public StringOrInt(Object o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/AllOfSimpleModelTest.java b/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/AllOfSimpleModelTest.java new file mode 100644 index 00000000000..3afe85fb5f6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/AllOfSimpleModelTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfSimpleModel + */ +public class AllOfSimpleModelTest { + private final AllOfSimpleModel model = new AllOfSimpleModel(); + + /** + * Model tests for AllOfSimpleModel + */ + @Test + public void testAllOfSimpleModel() { + // TODO: test AllOfSimpleModel + } + + /** + * Test the property 'arrayOfStrings' + */ + @Test + public void arrayOfStringsTest() { + // TODO: test arrayOfStrings + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/SimpleModelWithArrayPropertyTest.java b/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/SimpleModelWithArrayPropertyTest.java new file mode 100644 index 00000000000..7368878c9ab --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/test/java/org/openapitools/client/model/SimpleModelWithArrayPropertyTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SimpleModelWithArrayProperty + */ +public class SimpleModelWithArrayPropertyTest { + private final SimpleModelWithArrayProperty model = new SimpleModelWithArrayProperty(); + + /** + * Model tests for SimpleModelWithArrayProperty + */ + @Test + public void testSimpleModelWithArrayProperty() { + // TODO: test SimpleModelWithArrayProperty + } + + /** + * Test the property 'arrayOfStrings' + */ + @Test + public void arrayOfStringsTest() { + // TODO: test arrayOfStrings + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-awsv4signature/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle index 6cad260b145..bf28eaab47a 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle @@ -119,9 +119,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt index 0f9cf8f3f2a..83d5a9f45c0 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt @@ -23,7 +23,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew.bat b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml index d57acfa3104..8085232eb92 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml @@ -344,7 +344,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index 31873abe5dc..53abcdebd4b 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -119,9 +119,9 @@ dependencies { implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index b1ece5e8563..99d8419f18f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -23,7 +23,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index c1ff5944375..340c3277d16 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -344,7 +344,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-group-parameter/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle index 4b2531773dd..0b538e51b8c 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt index 67c416e48b9..986fec5f579 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew b/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew.bat b/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml index 9e97a62b9f3..ed94eca8ad8 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml @@ -339,7 +339,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-nullable-required/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle index 61981aa9d3b..c9e122aff31 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt index f5180bf8259..342822d7ac9 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew b/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew.bat b/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml index 7be91544ac2..eeb259d1343 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml @@ -339,7 +339,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 6bc0e6630cc..ea4e98857ea 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 2e3b8bade6f..6d8a20396b6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew.bat b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index ed5e1ea2990..ea1f1fdf159 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -346,7 +346,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-swagger1/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-swagger1/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle index 99b33483c50..67dd0df27bd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt index 81f278caba4..982b47d2980 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-swagger1/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/gradlew b/samples/client/petstore/java/okhttp-gson-swagger1/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/gradlew +++ b/samples/client/petstore/java/okhttp-gson-swagger1/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/gradlew.bat b/samples/client/petstore/java/okhttp-gson-swagger1/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-swagger1/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml index 1f9cbb8c272..1d394370ae9 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml @@ -345,7 +345,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson-swagger2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson-swagger2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle index 99b33483c50..67dd0df27bd 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt index 81f278caba4..982b47d2980 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson-swagger2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/gradlew b/samples/client/petstore/java/okhttp-gson-swagger2/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/gradlew +++ b/samples/client/petstore/java/okhttp-gson-swagger2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/gradlew.bat b/samples/client/petstore/java/okhttp-gson-swagger2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson-swagger2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml index be6d38308eb..d0e30fb7e0f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml @@ -345,7 +345,7 @@ 3.14.0 0.2.6 1.3.5 - 5.10.0 + 5.10.2 1.10.0 2.1.1 1.1.1 diff --git a/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml b/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml +++ b/samples/client/petstore/java/okhttp-gson/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES index 9dd3140d3e4..02515104fd6 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -42,12 +42,16 @@ docs/EnumClass.md docs/EnumStringDiscriminator.md docs/EnumTest.md docs/EquilateralTriangle.md +docs/FakeAnyOfWIthSameErasureGet200Response.md docs/FakeApi.md docs/FakeClassnameTags123Api.md +docs/FakeOneOfWIthSameErasureGet200Response.md docs/FileSchemaTestClass.md docs/Foo.md docs/FooGetDefaultResponse.md docs/FormatTest.md +docs/FreeFormObjectTestClass.md +docs/FreeFormObjectTestClassProperties.md docs/Fruit.md docs/FruitReq.md docs/GmFruit.md @@ -183,10 +187,14 @@ src/main/java/org/openapitools/client/model/EnumClass.java src/main/java/org/openapitools/client/model/EnumStringDiscriminator.java src/main/java/org/openapitools/client/model/EnumTest.java src/main/java/org/openapitools/client/model/EquilateralTriangle.java +src/main/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200Response.java +src/main/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200Response.java src/main/java/org/openapitools/client/model/FileSchemaTestClass.java src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/FreeFormObjectTestClass.java +src/main/java/org/openapitools/client/model/FreeFormObjectTestClassProperties.java src/main/java/org/openapitools/client/model/Fruit.java src/main/java/org/openapitools/client/model/FruitReq.java src/main/java/org/openapitools/client/model/GmFruit.java diff --git a/samples/client/petstore/java/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 033c2859d97..a2c78c0de6d 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -118,7 +118,10 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**getParameterArrayNumber**](docs/AnotherFakeApi.md#getParameterArrayNumber) | **GET** /fake/parameter-array-number | parameter array number default value *AnotherFakeApi* | [**getParameterStringNumber**](docs/AnotherFakeApi.md#getParameterStringNumber) | **GET** /fake/parameter-string-number | parameter string number *AnotherFakeApi* | [**nullRequestBody**](docs/AnotherFakeApi.md#nullRequestBody) | **GET** /fake/null-request-body | null request body +*DefaultApi* | [**fakeAnyOfWIthSameErasureGet**](docs/DefaultApi.md#fakeAnyOfWIthSameErasureGet) | **GET** /fake/anyOfWIthSameErasure | +*DefaultApi* | [**fakeOneOfWIthSameErasureGet**](docs/DefaultApi.md#fakeOneOfWIthSameErasureGet) | **GET** /fake/oneOfWIthSameErasure | *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeGetFreeFormObjectGet**](docs/FakeApi.md#fakeGetFreeFormObjectGet) | **GET** /fake/get-free-form-object | *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -201,10 +204,14 @@ Class | Method | HTTP request | Description - [EnumStringDiscriminator](docs/EnumStringDiscriminator.md) - [EnumTest](docs/EnumTest.md) - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [FakeAnyOfWIthSameErasureGet200Response](docs/FakeAnyOfWIthSameErasureGet200Response.md) + - [FakeOneOfWIthSameErasureGet200Response](docs/FakeOneOfWIthSameErasureGet200Response.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - [FormatTest](docs/FormatTest.md) + - [FreeFormObjectTestClass](docs/FreeFormObjectTestClass.md) + - [FreeFormObjectTestClassProperties](docs/FreeFormObjectTestClassProperties.md) - [Fruit](docs/Fruit.md) - [FruitReq](docs/FruitReq.md) - [GmFruit](docs/GmFruit.md) diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index 131f50a9165..979f2695d99 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -992,6 +992,30 @@ paths: x-content-type: application/json x-accepts: - application/json + /fake/oneOfWIthSameErasure: + get: + description: "Test route, this shouldn't cause a compiler error" + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_fake_oneOfWIthSameErasure_get_200_response' + description: successful response + x-accepts: + - application/json + /fake/anyOfWIthSameErasure: + get: + description: "Test route, this shouldn't cause a compiler error" + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/_fake_anyOfWIthSameErasure_get_200_response' + description: successful response + x-accepts: + - application/json /fake/stringMap-reference: post: description: "" @@ -1117,6 +1141,20 @@ paths: x-content-type: application/json x-accepts: - application/json + /fake/get-free-form-object: + get: + description: Get a free form object or Json string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObjectTestClass' + description: Success + tags: + - fake + x-accepts: + - application/json /fake/test-query-parameters: put: description: To test the collection format in query parameters @@ -2134,6 +2172,16 @@ components: $ref: '#/components/schemas/File' type: array type: object + FreeFormObjectTestClass: + example: + name: name + properties: FreeFormObjectTestClass_properties + properties: + name: + type: string + properties: + $ref: '#/components/schemas/FreeFormObjectTestClass_properties' + type: object File: description: Must be named `File` for test. example: @@ -2863,6 +2911,22 @@ components: - param - param2 type: object + _fake_oneOfWIthSameErasure_get_200_response: + oneOf: + - items: + type: string + type: array + - items: + type: integer + type: array + _fake_anyOfWIthSameErasure_get_200_response: + anyOf: + - items: + type: string + type: array + - items: + type: integer + type: array testInlineFreeformAdditionalProperties_request: additionalProperties: true properties: @@ -2881,6 +2945,11 @@ components: required: - requiredFile type: object + FreeFormObjectTestClass_properties: + oneOf: + - type: string + - additionalProperties: true + type: object ArrayOfInlineAllOf_array_allof_dog_property_inner: allOf: - properties: diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 99b33483c50..67dd0df27bd 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -118,9 +118,9 @@ dependencies { implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2' } javadoc { diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 81f278caba4..982b47d2980 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -22,7 +22,7 @@ lazy val root = (project in file(".")). "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md b/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md index 3a31549ed3e..2b2cb4f9098 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/DefaultApi.md @@ -4,9 +4,127 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**fakeAnyOfWIthSameErasureGet**](DefaultApi.md#fakeAnyOfWIthSameErasureGet) | **GET** /fake/anyOfWIthSameErasure | | +| [**fakeOneOfWIthSameErasureGet**](DefaultApi.md#fakeOneOfWIthSameErasureGet) | **GET** /fake/oneOfWIthSameErasure | | | [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + +# **fakeAnyOfWIthSameErasureGet** +> FakeAnyOfWIthSameErasureGet200Response fakeAnyOfWIthSameErasureGet() + + + +Test route, this shouldn't cause a compiler error + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FakeAnyOfWIthSameErasureGet200Response result = apiInstance.fakeAnyOfWIthSameErasureGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fakeAnyOfWIthSameErasureGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeAnyOfWIthSameErasureGet200Response**](FakeAnyOfWIthSameErasureGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful response | - | + + +# **fakeOneOfWIthSameErasureGet** +> FakeOneOfWIthSameErasureGet200Response fakeOneOfWIthSameErasureGet() + + + +Test route, this shouldn't cause a compiler error + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FakeOneOfWIthSameErasureGet200Response result = apiInstance.fakeOneOfWIthSameErasureGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fakeOneOfWIthSameErasureGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FakeOneOfWIthSameErasureGet200Response**](FakeOneOfWIthSameErasureGet200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful response | - | + # **fooGet** > FooGetDefaultResponse fooGet() diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeAnyOfWIthSameErasureGet200Response.md b/samples/client/petstore/java/okhttp-gson/docs/FakeAnyOfWIthSameErasureGet200Response.md new file mode 100644 index 00000000000..c224eb3d572 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeAnyOfWIthSameErasureGet200Response.md @@ -0,0 +1,12 @@ + + +# FakeAnyOfWIthSameErasureGet200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 97e59270c5a..18f99688c92 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**fakeGetFreeFormObjectGet**](FakeApi.md#fakeGetFreeFormObjectGet) | **GET** /fake/get-free-form-object | | | [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | @@ -26,6 +27,64 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + +# **fakeGetFreeFormObjectGet** +> FreeFormObjectTestClass fakeGetFreeFormObjectGet() + + + +Get a free form object or Json string + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FreeFormObjectTestClass result = apiInstance.fakeGetFreeFormObjectGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeGetFreeFormObjectGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**FreeFormObjectTestClass**](FreeFormObjectTestClass.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeOneOfWIthSameErasureGet200Response.md b/samples/client/petstore/java/okhttp-gson/docs/FakeOneOfWIthSameErasureGet200Response.md new file mode 100644 index 00000000000..0a3fbf6f8fc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeOneOfWIthSameErasureGet200Response.md @@ -0,0 +1,12 @@ + + +# FakeOneOfWIthSameErasureGet200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClass.md b/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClass.md new file mode 100644 index 00000000000..3bb6144bc90 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClass.md @@ -0,0 +1,14 @@ + + +# FreeFormObjectTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**properties** | [**FreeFormObjectTestClassProperties**](FreeFormObjectTestClassProperties.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClassProperties.md b/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClassProperties.md new file mode 100644 index 00000000000..8a7c9d2838a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/FreeFormObjectTestClassProperties.md @@ -0,0 +1,12 @@ + + +# FreeFormObjectTestClassProperties + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/okhttp-gson/gradlew b/samples/client/petstore/java/okhttp-gson/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/okhttp-gson/gradlew +++ b/samples/client/petstore/java/okhttp-gson/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/okhttp-gson/gradlew.bat b/samples/client/petstore/java/okhttp-gson/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/okhttp-gson/gradlew.bat +++ b/samples/client/petstore/java/okhttp-gson/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java index 60c3ef11d94..db57f2dbba8 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java @@ -269,10 +269,14 @@ public class JSON { gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EnumStringDiscriminator.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FakeAnyOfWIthSameErasureGet200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FakeOneOfWIthSameErasureGet200Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FooGetDefaultResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FreeFormObjectTestClass.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FreeFormObjectTestClassProperties.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.FruitReq.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.GmFruit.CustomTypeAdapterFactory()); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java index a2756defc23..6af7c9ef431 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -27,6 +27,8 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; +import org.openapitools.client.model.FakeAnyOfWIthSameErasureGet200Response; +import org.openapitools.client.model.FakeOneOfWIthSameErasureGet200Response; import org.openapitools.client.model.FooGetDefaultResponse; import java.lang.reflect.Type; @@ -72,6 +74,232 @@ public class DefaultApi { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for fakeAnyOfWIthSameErasureGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public okhttp3.Call fakeAnyOfWIthSameErasureGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/anyOfWIthSameErasure"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeAnyOfWIthSameErasureGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeAnyOfWIthSameErasureGetCall(_callback); + + } + + /** + * + * Test route, this shouldn't cause a compiler error + * @return FakeAnyOfWIthSameErasureGet200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public FakeAnyOfWIthSameErasureGet200Response fakeAnyOfWIthSameErasureGet() throws ApiException { + ApiResponse localVarResp = fakeAnyOfWIthSameErasureGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Test route, this shouldn't cause a compiler error + * @return ApiResponse<FakeAnyOfWIthSameErasureGet200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public ApiResponse fakeAnyOfWIthSameErasureGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeAnyOfWIthSameErasureGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test route, this shouldn't cause a compiler error + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public okhttp3.Call fakeAnyOfWIthSameErasureGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeAnyOfWIthSameErasureGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for fakeOneOfWIthSameErasureGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public okhttp3.Call fakeOneOfWIthSameErasureGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/oneOfWIthSameErasure"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeOneOfWIthSameErasureGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeOneOfWIthSameErasureGetCall(_callback); + + } + + /** + * + * Test route, this shouldn't cause a compiler error + * @return FakeOneOfWIthSameErasureGet200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public FakeOneOfWIthSameErasureGet200Response fakeOneOfWIthSameErasureGet() throws ApiException { + ApiResponse localVarResp = fakeOneOfWIthSameErasureGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Test route, this shouldn't cause a compiler error + * @return ApiResponse<FakeOneOfWIthSameErasureGet200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public ApiResponse fakeOneOfWIthSameErasureGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeOneOfWIthSameErasureGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Test route, this shouldn't cause a compiler error + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful response -
    + */ + public okhttp3.Call fakeOneOfWIthSameErasureGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeOneOfWIthSameErasureGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for fooGet * @param _callback Callback for upload/download progress diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index c2e2176d5f0..664a08c41d6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -31,6 +31,7 @@ import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.FreeFormObjectTestClass; import org.openapitools.client.model.HealthCheckResult; import java.time.LocalDate; import org.openapitools.client.model.ModelApiResponse; @@ -83,6 +84,119 @@ public class FakeApi { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for fakeGetFreeFormObjectGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call fakeGetFreeFormObjectGetCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake/get-free-form-object"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fakeGetFreeFormObjectGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return fakeGetFreeFormObjectGetCall(_callback); + + } + + /** + * + * Get a free form object or Json string + * @return FreeFormObjectTestClass + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public FreeFormObjectTestClass fakeGetFreeFormObjectGet() throws ApiException { + ApiResponse localVarResp = fakeGetFreeFormObjectGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * Get a free form object or Json string + * @return ApiResponse<FreeFormObjectTestClass> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse fakeGetFreeFormObjectGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = fakeGetFreeFormObjectGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * Get a free form object or Json string + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public okhttp3.Call fakeGetFreeFormObjectGetAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fakeGetFreeFormObjectGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for fakeOuterBooleanSerialize * @param body Input boolean as post body (optional) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributesC.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributesC.java index 7b18ff970b0..0115a460a64 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributesC.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfAttributesC.java @@ -155,12 +155,7 @@ public class AllOfModelArrayAnyOfAllOfAttributesC extends AbstractOpenApiSchema super("oneOf", Boolean.FALSE); } - public AllOfModelArrayAnyOfAllOfAttributesC(Order o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public AllOfModelArrayAnyOfAllOfAttributesC(Pet o) { + public AllOfModelArrayAnyOfAllOfAttributesC(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1Value.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1Value.java index 4838ae5680c..23e7d122ed4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1Value.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AllOfModelArrayAnyOfAllOfLinkListColumn1Value.java @@ -146,12 +146,7 @@ public class AllOfModelArrayAnyOfAllOfLinkListColumn1Value extends AbstractOpenA super("anyOf", Boolean.FALSE); } - public AllOfModelArrayAnyOfAllOfLinkListColumn1Value(Tag o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public AllOfModelArrayAnyOfAllOfLinkListColumn1Value(User o) { + public AllOfModelArrayAnyOfAllOfLinkListColumn1Value(Object o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayAnyOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayAnyOf.java index 4da22ab1c95..330c3ba280d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayAnyOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayAnyOf.java @@ -65,8 +65,8 @@ public class ArrayAnyOf extends AbstractOpenApiSchema { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); - final Type typeInstance = new TypeToken>(){}.getType(); - final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance)); + final Type typeInstanceListString = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListString)); return (TypeAdapter) new TypeAdapter() { @Override @@ -151,12 +151,7 @@ public class ArrayAnyOf extends AbstractOpenApiSchema { super("anyOf", Boolean.FALSE); } - public ArrayAnyOf(Integer o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public ArrayAnyOf(List o) { + public ArrayAnyOf(Object o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOneOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOneOf.java index 7e0ade3649c..86e701cdbf7 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOneOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOneOf.java @@ -65,8 +65,8 @@ public class ArrayOneOf extends AbstractOpenApiSchema { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); - final Type typeInstance = new TypeToken>(){}.getType(); - final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance)); + final Type typeInstanceListString = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListString)); return (TypeAdapter) new TypeAdapter() { @Override @@ -156,12 +156,7 @@ public class ArrayOneOf extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public ArrayOneOf(Integer o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public ArrayOneOf(List o) { + public ArrayOneOf(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200Response.java new file mode 100644 index 00000000000..efe05890859 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200Response.java @@ -0,0 +1,241 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeAnyOfWIthSameErasureGet200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FakeAnyOfWIthSameErasureGet200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FakeAnyOfWIthSameErasureGet200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FakeAnyOfWIthSameErasureGet200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListString = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListString)); + + final Type typeInstanceListInteger = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListInteger = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListInteger)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FakeAnyOfWIthSameErasureGet200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List` + if (value.getActualInstance() instanceof List) { + JsonPrimitive primitive = adapterListString.toJsonTree((List)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: List, List"); + } + + @Override + public FakeAnyOfWIthSameErasureGet200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListString; + FakeAnyOfWIthSameErasureGet200Response ret = new FakeAnyOfWIthSameErasureGet200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + throw new IOException(String.format("Failed deserialization for FakeAnyOfWIthSameErasureGet200Response: no class matches result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public FakeAnyOfWIthSameErasureGet200Response() { + super("anyOf", Boolean.FALSE); + } + + public FakeAnyOfWIthSameErasureGet200Response(Object o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List", List.class); + } + + @Override + public Map> getSchemas() { + return FakeAnyOfWIthSameErasureGet200Response.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * List, List + * + * It could be an instance of the 'anyOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List) { + List list = (List) instance; + if (list.get(0) instanceof String) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List, List"); + } + + /** + * Get the actual instance, which can be the following: + * List, List + * + * @return The actual instance (List, List) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getListString() throws ClassCastException { + return (List)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FakeAnyOfWIthSameErasureGet200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate anyOf schemas one by one + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with List + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + } + return; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + throw new IOException(String.format("The JSON string is invalid for FakeAnyOfWIthSameErasureGet200Response with anyOf schemas: List, List. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString())); + } + + /** + * Create an instance of FakeAnyOfWIthSameErasureGet200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of FakeAnyOfWIthSameErasureGet200Response + * @throws IOException if the JSON string is invalid with respect to FakeAnyOfWIthSameErasureGet200Response + */ + public static FakeAnyOfWIthSameErasureGet200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FakeAnyOfWIthSameErasureGet200Response.class); + } + + /** + * Convert an instance of FakeAnyOfWIthSameErasureGet200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200Response.java new file mode 100644 index 00000000000..12c139bf72a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200Response.java @@ -0,0 +1,250 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeOneOfWIthSameErasureGet200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FakeOneOfWIthSameErasureGet200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FakeOneOfWIthSameErasureGet200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FakeOneOfWIthSameErasureGet200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListString = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListString = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListString)); + + final Type typeInstanceListInteger = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListInteger = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListInteger)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FakeOneOfWIthSameErasureGet200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List` + if (value.getActualInstance() instanceof List) { + JsonPrimitive primitive = adapterListString.toJsonTree((List)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List, List"); + } + + @Override + public FakeOneOfWIthSameErasureGet200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListString; + match++; + log.log(Level.FINER, "Input data matches schema 'List'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List'", e); + } + + if (match == 1) { + FakeOneOfWIthSameErasureGet200Response ret = new FakeOneOfWIthSameErasureGet200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for FakeOneOfWIthSameErasureGet200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public FakeOneOfWIthSameErasureGet200Response() { + super("oneOf", Boolean.FALSE); + } + + public FakeOneOfWIthSameErasureGet200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List", List.class); + } + + @Override + public Map> getSchemas() { + return FakeOneOfWIthSameErasureGet200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List, List + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List) { + List list = (List) instance; + if (list.get(0) instanceof String) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List, List"); + } + + /** + * Get the actual instance, which can be the following: + * List, List + * + * @return The actual instance (List, List) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List`. If the actual instance is not `List`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List` + * @throws ClassCastException if the instance is not `List` + */ + public List getListString() throws ClassCastException { + return (List)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FakeOneOfWIthSameErasureGet200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with List + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for FakeOneOfWIthSameErasureGet200Response with oneOf schemas: List, List. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of FakeOneOfWIthSameErasureGet200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of FakeOneOfWIthSameErasureGet200Response + * @throws IOException if the JSON string is invalid with respect to FakeOneOfWIthSameErasureGet200Response + */ + public static FakeOneOfWIthSameErasureGet200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FakeOneOfWIthSameErasureGet200Response.class); + } + + /** + * Convert an instance of FakeOneOfWIthSameErasureGet200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClass.java new file mode 100644 index 00000000000..da0b9077cda --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClass.java @@ -0,0 +1,318 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.FreeFormObjectTestClassProperties; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * FreeFormObjectTestClass + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FreeFormObjectTestClass { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PROPERTIES = "properties"; + @SerializedName(SERIALIZED_NAME_PROPERTIES) + private FreeFormObjectTestClassProperties properties; + + public FreeFormObjectTestClass() { + } + + public FreeFormObjectTestClass name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public FreeFormObjectTestClass properties(FreeFormObjectTestClassProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get properties + * @return properties + **/ + @javax.annotation.Nullable + public FreeFormObjectTestClassProperties getProperties() { + return properties; + } + + public void setProperties(FreeFormObjectTestClassProperties properties) { + this.properties = properties; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FreeFormObjectTestClass instance itself + */ + public FreeFormObjectTestClass putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FreeFormObjectTestClass freeFormObjectTestClass = (FreeFormObjectTestClass) o; + return Objects.equals(this.name, freeFormObjectTestClass.name) && + Objects.equals(this.properties, freeFormObjectTestClass.properties)&& + Objects.equals(this.additionalProperties, freeFormObjectTestClass.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, properties, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FreeFormObjectTestClass {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("properties"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FreeFormObjectTestClass + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FreeFormObjectTestClass.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FreeFormObjectTestClass is not found in the empty JSON string", FreeFormObjectTestClass.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the optional field `properties` + if (jsonObj.get("properties") != null && !jsonObj.get("properties").isJsonNull()) { + FreeFormObjectTestClassProperties.validateJsonElement(jsonObj.get("properties")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FreeFormObjectTestClass.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FreeFormObjectTestClass' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FreeFormObjectTestClass.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FreeFormObjectTestClass value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FreeFormObjectTestClass read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FreeFormObjectTestClass instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FreeFormObjectTestClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of FreeFormObjectTestClass + * @throws IOException if the JSON string is invalid with respect to FreeFormObjectTestClass + */ + public static FreeFormObjectTestClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FreeFormObjectTestClass.class); + } + + /** + * Convert an instance of FreeFormObjectTestClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClassProperties.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClassProperties.java new file mode 100644 index 00000000000..4df1ba2f9ab --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FreeFormObjectTestClassProperties.java @@ -0,0 +1,277 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Map; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FreeFormObjectTestClassProperties extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FreeFormObjectTestClassProperties.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FreeFormObjectTestClassProperties.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FreeFormObjectTestClassProperties' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final Type typeInstanceMapStringObject = new TypeToken>(){}.getType(); + final TypeAdapter> adapterMapStringObject = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceMapStringObject)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FreeFormObjectTestClassProperties value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Map` + if (value.getActualInstance() instanceof Map) { + JsonObject object = adapterMapStringObject.toJsonTree((Map)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, object); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Map, String"); + } + + @Override + public FreeFormObjectTestClassProperties read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Map + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + actualAdapter = adapterMapStringObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Map'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Map failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Map'", e); + } + + if (match == 1) { + FreeFormObjectTestClassProperties ret = new FreeFormObjectTestClassProperties(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for FreeFormObjectTestClassProperties: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public FreeFormObjectTestClassProperties() { + super("oneOf", Boolean.FALSE); + } + + public FreeFormObjectTestClassProperties(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Map", Map.class); + } + + @Override + public Map> getSchemas() { + return FreeFormObjectTestClassProperties.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Map, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Map) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Map, String"); + } + + /** + * Get the actual instance, which can be the following: + * Map, String + * + * @return The actual instance (Map, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + /** + * Get the actual instance of `Map`. If the actual instance is not `Map`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Map` + * @throws ClassCastException if the instance is not `Map` + */ + public Map getMapStringObject() throws ClassCastException { + return (Map)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FreeFormObjectTestClassProperties + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Map + try { + if (!jsonElement.isJsonObject()) { + throw new IllegalArgumentException(String.format("Expected json element to be a object type in the JSON string but got `%s`", jsonElement.toString())); + } + + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Map failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for FreeFormObjectTestClassProperties with oneOf schemas: Map, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of FreeFormObjectTestClassProperties given an JSON string + * + * @param jsonString JSON string + * @return An instance of FreeFormObjectTestClassProperties + * @throws IOException if the JSON string is invalid with respect to FreeFormObjectTestClassProperties + */ + public static FreeFormObjectTestClassProperties fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FreeFormObjectTestClassProperties.class); + } + + /** + * Convert an instance of FreeFormObjectTestClassProperties to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java index 640ce65455a..07184098d4a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Fruit.java @@ -151,12 +151,7 @@ public class Fruit extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Fruit(Apple o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Fruit(Banana o) { + public Fruit(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java index 01dbe93d49d..314b038ee18 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/FruitReq.java @@ -151,12 +151,7 @@ public class FruitReq extends AbstractOpenApiSchema { super("oneOf", Boolean.TRUE); } - public FruitReq(AppleReq o) { - super("oneOf", Boolean.TRUE); - setActualInstance(o); - } - - public FruitReq(BananaReq o) { + public FruitReq(Object o) { super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java index 43eec0e6c39..99ca089d561 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/GmFruit.java @@ -146,12 +146,7 @@ public class GmFruit extends AbstractOpenApiSchema { super("anyOf", Boolean.FALSE); } - public GmFruit(Apple o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public GmFruit(Banana o) { + public GmFruit(Object o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java index fcf56350a0e..3e1ba61f525 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Mammal.java @@ -196,17 +196,7 @@ public class Mammal extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Mammal(Pig o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Mammal(Whale o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Mammal(Zebra o) { + public Mammal(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java index 67504b55c69..1cd4df893cf 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/NullableShape.java @@ -172,12 +172,7 @@ public class NullableShape extends AbstractOpenApiSchema { super("oneOf", Boolean.TRUE); } - public NullableShape(Quadrilateral o) { - super("oneOf", Boolean.TRUE); - setActualInstance(o); - } - - public NullableShape(Triangle o) { + public NullableShape(Object o) { super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java index 54f2df27d0b..9b2d7bac048 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pig.java @@ -172,12 +172,7 @@ public class Pig extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Pig(BasquePig o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Pig(DanishPig o) { + public Pig(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java index f3b57b6403e..93cc790c931 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -172,12 +172,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Quadrilateral(ComplexQuadrilateral o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Quadrilateral(SimpleQuadrilateral o) { + public Quadrilateral(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Scalar.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Scalar.java index c20e81e8abc..9735bb80986 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Scalar.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Scalar.java @@ -167,17 +167,7 @@ public class Scalar extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Scalar(BigDecimal o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Scalar(Boolean o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Scalar(String o) { + public Scalar(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScalarAnyOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScalarAnyOf.java index a97aa9b0046..6eb913e90ae 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScalarAnyOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ScalarAnyOf.java @@ -163,17 +163,7 @@ public class ScalarAnyOf extends AbstractOpenApiSchema { super("anyOf", Boolean.FALSE); } - public ScalarAnyOf(BigDecimal o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public ScalarAnyOf(Boolean o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - - public ScalarAnyOf(String o) { + public ScalarAnyOf(Object o) { super("anyOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java index 85ea6b6508e..b1da7379e9c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Shape.java @@ -172,12 +172,7 @@ public class Shape extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Shape(Quadrilateral o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Shape(Triangle o) { + public Shape(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 8d4ab7e3a47..9667a8790ef 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -172,12 +172,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { super("oneOf", Boolean.TRUE); } - public ShapeOrNull(Quadrilateral o) { - super("oneOf", Boolean.TRUE); - setActualInstance(o); - } - - public ShapeOrNull(Triangle o) { + public ShapeOrNull(Object o) { super("oneOf", Boolean.TRUE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java index 3eb0dca58f5..1cf48ee68ed 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Triangle.java @@ -196,17 +196,7 @@ public class Triangle extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Triangle(EquilateralTriangle o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Triangle(IsoscelesTriangle o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Triangle(ScaleneTriangle o) { + public Triangle(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Value.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Value.java index af79ee4642f..d10ff106aa1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Value.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Value.java @@ -66,8 +66,8 @@ public class Value extends AbstractOpenApiSchema { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterScalar = gson.getDelegateAdapter(this, TypeToken.get(Scalar.class)); - final Type typeInstance = new TypeToken>(){}.getType(); - final TypeAdapter> adapterListScalar = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstance)); + final Type typeInstanceListScalar = new TypeToken>(){}.getType(); + final TypeAdapter> adapterListScalar = (TypeAdapter>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListScalar)); return (TypeAdapter) new TypeAdapter() { @Override @@ -156,12 +156,7 @@ public class Value extends AbstractOpenApiSchema { super("oneOf", Boolean.FALSE); } - public Value(List o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - public Value(Scalar o) { + public Value(Object o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java index e4a9e844010..b8ca4aff421 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ClientTest.java @@ -11,8 +11,8 @@ import org.openapitools.client.auth.*; import java.math.BigDecimal; import org.openapitools.client.model.*; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class ClientTest { ApiClient apiClient; @@ -48,7 +48,7 @@ public class ClientTest { model2.setArrayArrayNumber(new ArrayList>()); model2.getArrayArrayNumber().add(arrayArrayNumber2); - Assert.assertTrue(model2.equals(model)); + Assertions.assertTrue(model2.equals(model)); } /** @@ -65,6 +65,6 @@ public class ClientTest { model2.setId(1029L); model2.setName("Dog"); - Assert.assertTrue(model.equals(model2)); + Assertions.assertTrue(model.equals(model2)); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java index 978195ccf6d..765e7b71c77 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java @@ -37,6 +37,28 @@ public class JSONTest { order = new Order(); } + @Test + public void testOneOfFreeFormObject() { + final Map map = new LinkedHashMap<>(); + map.put("someString", "abc"); + map.put("someBoolean", false); + + final String json1 = "{\"someString\":\"abc\",\"someBoolean\":false}"; + final FreeFormObjectTestClassProperties properties = new FreeFormObjectTestClassProperties(); + properties.setActualInstance(map); + + assertEquals(json1, json.serialize(properties)); + assertEquals(json.deserialize(json1, FreeFormObjectTestClassProperties.class), properties); + + + final String json2 = "\"abc\""; + final FreeFormObjectTestClassProperties properties2 = new FreeFormObjectTestClassProperties(); + properties2.setActualInstance("abc"); + + assertEquals(json2, json.serialize(properties2)); + assertEquals(json.deserialize(json2, FreeFormObjectTestClassProperties.class), properties2); + } + @Test public void testSqlDateTypeAdapter() { final String str = "\"2015-11-07\""; diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200ResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200ResponseTest.java new file mode 100644 index 00000000000..22408ad0686 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeAnyOfWIthSameErasureGet200ResponseTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeAnyOfWIthSameErasureGet200Response + */ +public class FakeAnyOfWIthSameErasureGet200ResponseTest { + private final FakeAnyOfWIthSameErasureGet200Response model = new FakeAnyOfWIthSameErasureGet200Response(); + + /** + * Model tests for FakeAnyOfWIthSameErasureGet200Response + */ + @Test + public void testFakeAnyOfWIthSameErasureGet200Response() { + // TODO: test FakeAnyOfWIthSameErasureGet200Response + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200ResponseTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200ResponseTest.java new file mode 100644 index 00000000000..4a0bd78cb38 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FakeOneOfWIthSameErasureGet200ResponseTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeOneOfWIthSameErasureGet200Response + */ +public class FakeOneOfWIthSameErasureGet200ResponseTest { + private final FakeOneOfWIthSameErasureGet200Response model = new FakeOneOfWIthSameErasureGet200Response(); + + /** + * Model tests for FakeOneOfWIthSameErasureGet200Response + */ + @Test + public void testFakeOneOfWIthSameErasureGet200Response() { + // TODO: test FakeOneOfWIthSameErasureGet200Response + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassPropertiesTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassPropertiesTest.java new file mode 100644 index 00000000000..32a85ee296b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassPropertiesTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Map; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FreeFormObjectTestClassProperties + */ +public class FreeFormObjectTestClassPropertiesTest { + private final FreeFormObjectTestClassProperties model = new FreeFormObjectTestClassProperties(); + + /** + * Model tests for FreeFormObjectTestClassProperties + */ + @Test + public void testFreeFormObjectTestClassProperties() { + // TODO: test FreeFormObjectTestClassProperties + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassTest.java new file mode 100644 index 00000000000..3d2f22b98de --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/FreeFormObjectTestClassTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.client.model.FreeFormObjectTestClassProperties; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FreeFormObjectTestClass + */ +public class FreeFormObjectTestClassTest { + private final FreeFormObjectTestClass model = new FreeFormObjectTestClass(); + + /** + * Model tests for FreeFormObjectTestClass + */ + @Test + public void testFreeFormObjectTestClass() { + // TODO: test FreeFormObjectTestClass + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'properties' + */ + @Test + public void propertiesTest() { + // TODO: test properties + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml b/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml +++ b/samples/client/petstore/java/rest-assured-jackson/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/rest-assured-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/rest-assured-jackson/gradlew b/samples/client/petstore/java/rest-assured-jackson/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/rest-assured-jackson/gradlew +++ b/samples/client/petstore/java/rest-assured-jackson/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/rest-assured-jackson/gradlew.bat b/samples/client/petstore/java/rest-assured-jackson/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/rest-assured-jackson/gradlew.bat +++ b/samples/client/petstore/java/rest-assured-jackson/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 4dfb005c993..2685ba6a5ac 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -28,8 +28,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeApi.java index 76fce0633b2..0d263b24a10 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,8 +35,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index d00177e6331..c284c447580 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -27,8 +27,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java index e703a9ec309..c5afaeb4387 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,8 +30,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/StoreApi.java index d34a720ff6a..3fac8d0f7b6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -27,8 +27,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java index 2ad8b6a1da7..af049b9ec04 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java @@ -28,8 +28,8 @@ import io.restassured.common.mapper.TypeRef; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 69345ee44de..d3d45dcf25f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -118,7 +118,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -154,7 +153,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -189,7 +187,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -224,7 +221,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -260,7 +256,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -296,7 +291,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -332,7 +326,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -368,7 +361,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -395,7 +387,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -422,7 +413,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index faa0b14fcf4..17302ab16f4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -53,7 +53,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -85,7 +85,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index c72e7bf57d4..41c6d31f3f6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -86,7 +86,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -122,7 +121,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 81d1e9cd394..bfdca6f8222 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -86,7 +86,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -113,7 +112,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -140,7 +138,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -167,7 +164,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -194,7 +190,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index cf0a83cdd1a..9884e516cc0 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -48,7 +48,7 @@ import org.hibernate.validator.constraints.*; public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index bcabb439928..0d105a750de 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -70,7 +70,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 0666cf3ec91..fc729752290 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -143,7 +143,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 74bfa286d1e..ae7db4b351d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -228,7 +228,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -256,7 +255,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -283,7 +281,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -310,7 +307,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 664309f9f43..c10d97d85fd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -75,7 +75,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List<@Valid ModelFile> files) { this.files = files; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index e2cef3b1f7b..5361ee93055 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -126,7 +126,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -155,7 +154,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -182,7 +180,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -213,7 +210,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -242,7 +238,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -271,7 +266,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -298,7 +292,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -326,7 +319,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -354,7 +346,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -383,7 +374,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -411,7 +401,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -439,7 +428,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -467,7 +455,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 53b781e64fd..e43dfd79cbf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -44,7 +44,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -70,7 +72,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index e9bed7b461e..24d13b4a54f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -124,7 +124,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -159,7 +158,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -194,7 +192,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 727e9038ef9..d7dc6adcb75 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,7 +80,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -108,7 +107,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index bc200c3519c..5a46fe0b823 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -71,7 +71,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index d3a23e40e66..053ac040a98 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -75,7 +75,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -102,7 +101,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index a16b89ed464..889310cc72f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -51,7 +51,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -89,7 +91,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -105,7 +106,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -132,7 +132,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index 7551e3b55b2..c9effca78ce 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -124,7 +124,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -151,7 +150,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -178,7 +176,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -206,7 +203,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -233,7 +229,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index 8d78c410b9f..bbd5870b117 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -76,7 +76,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -103,7 +102,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index 5300a34d498..16482fdcefa 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -131,7 +131,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -159,7 +158,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -187,7 +185,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -224,7 +221,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List<@Valid Tag> tags) { this.tags = tags; @@ -260,7 +256,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 312fd92dff0..86be39c084d 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -43,7 +43,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -67,7 +69,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index 3a36c0c5360..22d0f3f6d91 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -70,7 +70,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index a9cc09e3899..2d795aa98db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -87,7 +87,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -116,7 +115,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -144,7 +142,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -172,7 +169,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index baf03616b29..fb83edbd9cf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -91,7 +91,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -120,7 +119,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -148,7 +146,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -176,7 +173,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -204,7 +200,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 7a8d59018b2..e1f7dd23452 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -94,7 +94,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -121,7 +120,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -148,7 +146,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -175,7 +172,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -202,7 +198,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -229,7 +224,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -256,7 +250,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index beb0c9a9cf4..9275cb88534 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -182,7 +182,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -210,7 +209,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -237,7 +235,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -264,7 +261,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -299,7 +295,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -326,7 +321,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -354,7 +348,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -381,7 +374,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -408,7 +400,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -443,7 +434,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -478,7 +468,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -505,7 +494,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -533,7 +521,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -560,7 +547,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -587,7 +573,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -622,7 +607,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -657,7 +641,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -684,7 +667,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -712,7 +694,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -739,7 +720,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -766,7 +746,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -801,7 +780,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -836,7 +814,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -863,7 +840,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -891,7 +867,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -918,7 +893,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -945,7 +919,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -980,7 +953,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml b/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml +++ b/samples/client/petstore/java/rest-assured/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/rest-assured/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/rest-assured/gradlew b/samples/client/petstore/java/rest-assured/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/rest-assured/gradlew +++ b/samples/client/petstore/java/rest-assured/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/rest-assured/gradlew.bat b/samples/client/petstore/java/rest-assured/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/rest-assured/gradlew.bat +++ b/samples/client/petstore/java/rest-assured/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 52e88b2db2b..d07a015efdf 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -28,8 +28,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 842d9fa2bc8..500e45c7a32 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,8 +35,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 0447c8a88c6..261da66b8df 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -27,8 +27,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index 3cc3d5e8f1d..751402daef2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,8 +30,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java index 0c4c75f7503..c4fd821c176 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/StoreApi.java @@ -27,8 +27,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index eab6d35bef0..c7a47bc4e5c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -28,8 +28,8 @@ import io.restassured.builder.ResponseSpecBuilder; import io.restassured.http.Method; import io.restassured.response.Response; -import javax.validation.constraints.*; -import javax.validation.Valid; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import java.lang.reflect.Type; import java.util.function.Consumer; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index d0fac195ca3..e5bed7fb59f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -111,7 +111,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -143,7 +142,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -174,7 +172,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -205,7 +202,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -237,7 +233,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -269,7 +264,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -301,7 +295,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -333,7 +326,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -356,7 +348,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -379,7 +370,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 1e50da93646..be915944429 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -36,7 +36,7 @@ public class Animal { public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -64,7 +64,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 2f76de3b2b2..2d39da8c131 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -79,7 +79,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -111,7 +110,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index 0b079a2b8c8..03a33e9ab69 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -79,7 +79,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -102,7 +101,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -125,7 +123,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -148,7 +145,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -171,7 +167,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 6ac3df45de9..f903ed44d38 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -33,7 +33,7 @@ import org.hibernate.validator.constraints.*; public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 99bbb429d32..17b3117a956 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -63,7 +63,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 77f4611965d..b6267966b1d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -160,7 +160,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 985d0ddbe37..97e4f99594a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -268,7 +268,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -292,7 +291,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -315,7 +313,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -338,7 +335,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 15a068b509e..8f2e16a1f03 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -68,7 +68,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List<@Valid ModelFile> files) { this.files = files; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index a9af9efc25d..35891d1f260 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -118,7 +118,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -143,7 +142,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -166,7 +164,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -193,7 +190,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -218,7 +214,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -243,7 +238,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -266,7 +260,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -290,7 +283,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -314,7 +306,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -339,7 +330,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -363,7 +353,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -387,7 +376,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -411,7 +399,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 613a1931c9a..64675e81eda 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -40,7 +40,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -64,7 +66,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index be8af52f414..1486429aafc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -129,7 +129,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -160,7 +159,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -191,7 +189,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b52eacbb98..16ca093ba2f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -73,7 +73,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -97,7 +96,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index bee95c6574d..dbcc56c936f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -63,7 +63,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c3a82c720a2..e09cd67e147 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -67,7 +67,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -90,7 +89,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index d188cf1b2f0..0cd260c5e2a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -82,7 +84,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -96,7 +97,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -119,7 +119,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 3bfe5d94de1..f72f1acea07 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -129,7 +129,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -152,7 +151,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -175,7 +173,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -199,7 +196,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -222,7 +218,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 722dd000498..5fc15112d4a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -69,7 +69,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -92,7 +91,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index 56c12923bb7..d46cb1d3548 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -135,7 +135,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -159,7 +158,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -183,7 +181,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -215,7 +212,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List<@Valid Tag> tags) { this.tags = tags; @@ -247,7 +243,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d9f597ab0fd..14540f14970 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -62,7 +64,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index aa8e43dadd6..b54f7af51fe 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -63,7 +63,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 053c391d39b..da3744fbbee 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -80,7 +80,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -105,7 +104,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -129,7 +127,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -153,7 +150,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 84834254877..8981d1c9320 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -84,7 +84,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -109,7 +108,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -133,7 +131,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -157,7 +154,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -181,7 +177,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index 7a587795bee..ae8fef63d06 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -87,7 +87,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -110,7 +109,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -133,7 +131,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -156,7 +153,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -179,7 +175,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -202,7 +197,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -225,7 +219,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index 584c67cde2a..e5220f0e6fd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -175,7 +175,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -199,7 +198,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -222,7 +220,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -245,7 +242,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -276,7 +272,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -299,7 +294,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -323,7 +317,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -346,7 +339,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -369,7 +361,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -400,7 +391,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -431,7 +421,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -454,7 +443,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -478,7 +466,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -501,7 +488,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -524,7 +510,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -555,7 +540,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -586,7 +570,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -609,7 +592,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -633,7 +615,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -656,7 +637,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -679,7 +659,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -710,7 +689,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -741,7 +719,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -764,7 +741,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -788,7 +764,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -811,7 +786,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -834,7 +808,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -865,7 +838,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.github/workflows/maven.yml b/samples/client/petstore/java/restclient-nullable-arrays/.github/workflows/maven.yml new file mode 100644 index 00000000000..9b7c8ca8cae --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build Minimal Example + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.gitignore b/samples/client/petstore/java/restclient-nullable-arrays/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator-ignore b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/FILES b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/FILES new file mode 100644 index 00000000000..4f38a796a27 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/ByteArrayObject.md +docs/DefaultApi.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/model/ByteArrayObject.java diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java/restclient-nullable-arrays/.travis.yml b/samples/client/petstore/java/restclient-nullable-arrays/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/petstore/java/restclient-nullable-arrays/README.md b/samples/client/petstore/java/restclient-nullable-arrays/README.md new file mode 100644 index 00000000000..47585d64efb --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/README.md @@ -0,0 +1,138 @@ +# petstore-restclient-nullable-arrays + +Minimal Example + +- API version: v1 + +- Generator version: 8.0.0-SNAPSHOT + +byte Array error in equal method + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-restclient-nullable-arrays + v1 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'petstore-restclient-nullable-arrays' jar has been published to maven central. + mavenLocal() // Needed if the 'petstore-restclient-nullable-arrays' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:petstore-restclient-nullable-arrays:v1" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-restclient-nullable-arrays-v1.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.DefaultApi; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + List result = apiInstance.nullableArrayTestGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#nullableArrayTestGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**nullableArrayTestGet**](docs/DefaultApi.md#nullableArrayTestGet) | **GET** /nullable-array-test | + + +## Documentation for Models + + - [ByteArrayObject](docs/ByteArrayObject.md) + + + +## Documentation for Authorization + +Endpoints do not require authorization. + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/api/openapi.yaml b/samples/client/petstore/java/restclient-nullable-arrays/api/openapi.yaml new file mode 100644 index 00000000000..c727d3a7aab --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/api/openapi.yaml @@ -0,0 +1,54 @@ +openapi: 3.0.0 +info: + description: byte Array error in equal method + title: 'Minimal Example ' + version: v1 +servers: +- url: / +paths: + /nullable-array-test: + get: + description: "" + operationId: "" + parameters: [] + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ByteArrayObject' + type: array + description: "" + summary: "" + x-accepts: + - application/json +components: + schemas: + ByteArrayObject: + example: + nullableArray: nullableArray + nullableString: nullableString + normalArray: normalArray + stringField: stringField + intField: 0.8008281904610115 + properties: + nullableArray: + description: byte array. + format: byte + nullable: true + type: string + normalArray: + description: byte array. + format: byte + type: string + nullableString: + nullable: true + type: string + stringField: + type: string + intField: + format: int32 + type: number + type: object + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/build.gradle b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle new file mode 100644 index 00000000000..e3ae783def4 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/build.gradle @@ -0,0 +1,136 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = 'v1' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'petstore-restclient-nullable-arrays' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/build.sbt b/samples/client/petstore/java/restclient-nullable-arrays/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/petstore/java/restclient-nullable-arrays/docs/ByteArrayObject.md b/samples/client/petstore/java/restclient-nullable-arrays/docs/ByteArrayObject.md new file mode 100644 index 00000000000..3feb9e093e8 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/docs/ByteArrayObject.md @@ -0,0 +1,17 @@ + + +# ByteArrayObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableArray** | **byte[]** | byte array. | [optional] | +|**normalArray** | **byte[]** | byte array. | [optional] | +|**nullableString** | **String** | | [optional] | +|**stringField** | **String** | | [optional] | +|**intField** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/docs/DefaultApi.md b/samples/client/petstore/java/restclient-nullable-arrays/docs/DefaultApi.md new file mode 100644 index 00000000000..904a441a9f8 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/docs/DefaultApi.md @@ -0,0 +1,71 @@ +# DefaultApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**nullableArrayTestGet**](DefaultApi.md#nullableArrayTestGet) | **GET** /nullable-array-test | | + + + +## nullableArrayTestGet + +> List<ByteArrayObject> nullableArrayTestGet() + + + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + List result = apiInstance.nullableArrayTestGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#nullableArrayTestGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List<ByteArrayObject>**](ByteArrayObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh b/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh new file mode 100755 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/java/restclient-nullable-arrays/gradle.properties b/samples/client/petstore/java/restclient-nullable-arrays/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/restclient-nullable-arrays/gradlew b/samples/client/petstore/java/restclient-nullable-arrays/gradlew new file mode 100755 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/restclient-nullable-arrays/gradlew.bat b/samples/client/petstore/java/restclient-nullable-arrays/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/restclient-nullable-arrays/pom.xml b/samples/client/petstore/java/restclient-nullable-arrays/pom.xml new file mode 100644 index 00000000000..be447494260 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/pom.xml @@ -0,0 +1,291 @@ + + 4.0.0 + org.openapitools + petstore-restclient-nullable-arrays + jar + petstore-restclient-nullable-arrays + v1 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + http://unlicense.org + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 6.1.6 + 2.15.2 + 2.15.2 + 0.2.6 + 2.1.1 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/settings.gradle b/samples/client/petstore/java/restclient-nullable-arrays/settings.gradle new file mode 100644 index 00000000000..0a1d0ae2f66 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-restclient-nullable-arrays" \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/AndroidManifest.xml b/samples/client/petstore/java/restclient-nullable-arrays/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..b8b55b2cefb --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,707 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import jakarta.annotation.Nullable; + +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "http://localhost"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..74fbd1a1b28 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..147d4d82632 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..4c47f2b1971 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..60a0eed94d5 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..da69b14083f --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..514218f016d --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,111 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.ByteArrayObject; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(new ApiClient()); + } + + @Autowired + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + *

    200 - + * @return List<ByteArrayObject> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec nullableArrayTestGetRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/nullable-array-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

    200 - + * @return List<ByteArrayObject> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public List nullableArrayTestGet() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return nullableArrayTestGetRequestCreation().body(localVarReturnType); + } + + /** + * + * + *

    200 - + * @return ResponseEntity<List<ByteArrayObject>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> nullableArrayTestGetWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return nullableArrayTestGetRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * + *

    200 - + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nullableArrayTestGetWithResponseSpec() throws RestClientResponseException { + return nullableArrayTestGetRequestCreation(); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f2597a71272 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f0afdd6841c --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..75b318e2922 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java new file mode 100644 index 00000000000..c508cc63f59 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -0,0 +1,259 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ByteArrayObject + */ +@JsonPropertyOrder({ + ByteArrayObject.JSON_PROPERTY_NULLABLE_ARRAY, + ByteArrayObject.JSON_PROPERTY_NORMAL_ARRAY, + ByteArrayObject.JSON_PROPERTY_NULLABLE_STRING, + ByteArrayObject.JSON_PROPERTY_STRING_FIELD, + ByteArrayObject.JSON_PROPERTY_INT_FIELD +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ByteArrayObject { + public static final String JSON_PROPERTY_NULLABLE_ARRAY = "nullableArray"; + private JsonNullable nullableArray = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NORMAL_ARRAY = "normalArray"; + private byte[] normalArray; + + public static final String JSON_PROPERTY_NULLABLE_STRING = "nullableString"; + private JsonNullable nullableString = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRING_FIELD = "stringField"; + private String stringField; + + public static final String JSON_PROPERTY_INT_FIELD = "intField"; + private BigDecimal intField; + + public ByteArrayObject() { + } + + public ByteArrayObject nullableArray(byte[] nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + + return this; + } + + /** + * byte array. + * @return nullableArray + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public byte[] getNullableArray() { + return nullableArray.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableArray_JsonNullable() { + return nullableArray; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_ARRAY) + public void setNullableArray_JsonNullable(JsonNullable nullableArray) { + this.nullableArray = nullableArray; + } + + public void setNullableArray(byte[] nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + } + + public ByteArrayObject normalArray(byte[] normalArray) { + + this.normalArray = normalArray; + return this; + } + + /** + * byte array. + * @return normalArray + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NORMAL_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public byte[] getNormalArray() { + return normalArray; + } + + + @JsonProperty(JSON_PROPERTY_NORMAL_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNormalArray(byte[] normalArray) { + this.normalArray = normalArray; + } + + public ByteArrayObject nullableString(String nullableString) { + this.nullableString = JsonNullable.of(nullableString); + + return this; + } + + /** + * Get nullableString + * @return nullableString + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getNullableString() { + return nullableString.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableString_JsonNullable() { + return nullableString; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_STRING) + public void setNullableString_JsonNullable(JsonNullable nullableString) { + this.nullableString = nullableString; + } + + public void setNullableString(String nullableString) { + this.nullableString = JsonNullable.of(nullableString); + } + + public ByteArrayObject stringField(String stringField) { + + this.stringField = stringField; + return this; + } + + /** + * Get stringField + * @return stringField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStringField() { + return stringField; + } + + + @JsonProperty(JSON_PROPERTY_STRING_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStringField(String stringField) { + this.stringField = stringField; + } + + public ByteArrayObject intField(BigDecimal intField) { + + this.intField = intField; + return this; + } + + /** + * Get intField + * @return intField + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getIntField() { + return intField; + } + + + @JsonProperty(JSON_PROPERTY_INT_FIELD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntField(BigDecimal intField) { + this.intField = intField; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ByteArrayObject byteArrayObject = (ByteArrayObject) o; + return equalsNullable(this.nullableArray, byteArrayObject.nullableArray) && + Arrays.equals(this.normalArray, byteArrayObject.normalArray) && + equalsNullable(this.nullableString, byteArrayObject.nullableString) && + Objects.equals(this.stringField, byteArrayObject.stringField) && + Objects.equals(this.intField, byteArrayObject.intField); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), Arrays.hashCode(normalArray), hashCodeNullable(nullableString), stringField, intField); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ByteArrayObject {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" normalArray: ").append(toIndentedString(normalArray)).append("\n"); + sb.append(" nullableString: ").append(toIndentedString(nullableString)).append("\n"); + sb.append(" stringField: ").append(toIndentedString(stringField)).append("\n"); + sb.append(" intField: ").append(toIndentedString(intField)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..7552e150548 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,47 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.ByteArrayObject; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for DefaultApi + */ +@Ignore +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + + /** + * + * + * + */ + @Test + public void nullableArrayTestGetTest() { + List response = api.nullableArrayTestGet(); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java b/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java new file mode 100644 index 00000000000..a8c532e1df1 --- /dev/null +++ b/samples/client/petstore/java/restclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java @@ -0,0 +1,84 @@ +/* + * Minimal Example + * byte Array error in equal method + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ByteArrayObject + */ +class ByteArrayObjectTest { + private final ByteArrayObject model = new ByteArrayObject(); + + /** + * Model tests for ByteArrayObject + */ + @Test + void testByteArrayObject() { + // TODO: test ByteArrayObject + } + + /** + * Test the property 'nullableArray' + */ + @Test + void nullableArrayTest() { + // TODO: test nullableArray + } + + /** + * Test the property 'normalArray' + */ + @Test + void normalArrayTest() { + // TODO: test normalArray + } + + /** + * Test the property 'nullableString' + */ + @Test + void nullableStringTest() { + // TODO: test nullableString + } + + /** + * Test the property 'stringField' + */ + @Test + void stringFieldTest() { + // TODO: test stringField + } + + /** + * Test the property 'intField' + */ + @Test + void intFieldTest() { + // TODO: test intField + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/.github/workflows/maven.yml b/samples/client/petstore/java/restclient-swagger2/.github/workflows/maven.yml new file mode 100644 index 00000000000..460f78bfd1b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/restclient-swagger2/.gitignore b/samples/client/petstore/java/restclient-swagger2/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java/restclient-swagger2/.openapi-generator-ignore b/samples/client/petstore/java/restclient-swagger2/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java/restclient-swagger2/.openapi-generator/FILES b/samples/client/petstore/java/restclient-swagger2/.openapi-generator/FILES new file mode 100644 index 00000000000..fcdb2bc3222 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.openapi-generator/FILES @@ -0,0 +1,142 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/User.md +docs/UserApi.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildWithNullable.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/client/model/ParentWithNullable.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/restclient-swagger2/.openapi-generator/VERSION b/samples/client/petstore/java/restclient-swagger2/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java/restclient-swagger2/.travis.yml b/samples/client/petstore/java/restclient-swagger2/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/petstore/java/restclient-swagger2/README.md b/samples/client/petstore/java/restclient-swagger2/README.md new file mode 100644 index 00000000000..a9421f71622 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/README.md @@ -0,0 +1,278 @@ +# petstore-restclient + +OpenAPI Petstore + +- API version: 1.0.0 + +- Generator version: 8.0.0-SNAPSHOT + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-restclient + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'petstore-restclient' jar has been published to maven central. + mavenLocal() // Needed if the 'petstore-restclient' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:petstore-restclient:1.0.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-restclient-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md) + - [Animal](docs/Animal.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [ChildWithNullable](docs/ChildWithNullable.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [Dog](docs/Dog.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelFile](docs/ModelFile.md) + - [ModelList](docs/ModelList.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) + - [ParentWithNullable](docs/ParentWithNullable.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SingleRefType](docs/SingleRefType.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [User](docs/User.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### bearer_test + + +- **Type**: HTTP Bearer Token authentication (JWT) + + +### http_signature_test + + +- **Type**: HTTP signature authentication + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml b/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml new file mode 100644 index 00000000000..96dc260deb8 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/api/openapi.yaml @@ -0,0 +1,2362 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: + - application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-webclient-blocking: false + x-accepts: + - application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/java/restclient-swagger2/build.gradle b/samples/client/petstore/java/restclient-swagger2/build.gradle new file mode 100644 index 00000000000..130f284555a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/build.gradle @@ -0,0 +1,138 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'petstore-restclient' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "2.2.9" + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/build.sbt b/samples/client/petstore/java/restclient-swagger2/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/petstore/java/restclient-swagger2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/restclient-swagger2/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..fe69a56eebf --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/restclient-swagger2/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..4146d56a372 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Animal.md b/samples/client/petstore/java/restclient-swagger2/docs/Animal.md new file mode 100644 index 00000000000..d9b32f14c88 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/AnotherFakeApi.md b/samples/client/petstore/java/restclient-swagger2/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..73c966d2d54 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..0188db3eb13 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..a5753530aad --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ArrayTest.md b/samples/client/petstore/java/restclient-swagger2/docs/ArrayTest.md new file mode 100644 index 00000000000..36077c9df30 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Capitalization.md b/samples/client/petstore/java/restclient-swagger2/docs/Capitalization.md new file mode 100644 index 00000000000..82a812711de --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Cat.md b/samples/client/petstore/java/restclient-swagger2/docs/Cat.md new file mode 100644 index 00000000000..390dd519c8c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Category.md b/samples/client/petstore/java/restclient-swagger2/docs/Category.md new file mode 100644 index 00000000000..ab6d1ec334d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ChildWithNullable.md b/samples/client/petstore/java/restclient-swagger2/docs/ChildWithNullable.md new file mode 100644 index 00000000000..73c0dd6d473 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ClassModel.md b/samples/client/petstore/java/restclient-swagger2/docs/ClassModel.md new file mode 100644 index 00000000000..af46dea1f6c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Client.md b/samples/client/petstore/java/restclient-swagger2/docs/Client.md new file mode 100644 index 00000000000..ef07b4ab8b9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/DefaultApi.md b/samples/client/petstore/java/restclient-swagger2/docs/DefaultApi.md new file mode 100644 index 00000000000..2c56e1f90e5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/DeprecatedObject.md b/samples/client/petstore/java/restclient-swagger2/docs/DeprecatedObject.md new file mode 100644 index 00000000000..48de1d62442 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Dog.md b/samples/client/petstore/java/restclient-swagger2/docs/Dog.md new file mode 100644 index 00000000000..972c981c0d0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/EnumArrays.md b/samples/client/petstore/java/restclient-swagger2/docs/EnumArrays.md new file mode 100644 index 00000000000..b2222d5beb2 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/EnumClass.md b/samples/client/petstore/java/restclient-swagger2/docs/EnumClass.md new file mode 100644 index 00000000000..b314590a759 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/EnumTest.md b/samples/client/petstore/java/restclient-swagger2/docs/EnumTest.md new file mode 100644 index 00000000000..380a2aef0bc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FakeApi.md b/samples/client/petstore/java/restclient-swagger2/docs/FakeApi.md new file mode 100644 index 00000000000..37a949ea050 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FakeApi.md @@ -0,0 +1,1541 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + apiInstance.testAdditionalPropertiesReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + apiInstance.testBodyWithBinary(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + apiInstance.testNullable(childWithNullable); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/restclient-swagger2/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 00000000000..475be1d2d73 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/restclient-swagger2/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..e4ff70ed909 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FileSchemaTestClass.md b/samples/client/petstore/java/restclient-swagger2/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..85d1a063669 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Foo.md b/samples/client/petstore/java/restclient-swagger2/docs/Foo.md new file mode 100644 index 00000000000..6b3f0556528 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/restclient-swagger2/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..ff3d7a3a56c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/FormatTest.md b/samples/client/petstore/java/restclient-swagger2/docs/FormatTest.md new file mode 100644 index 00000000000..01b8c777ae0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/restclient-swagger2/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..29da5205dbb --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/HealthCheckResult.md b/samples/client/petstore/java/restclient-swagger2/docs/HealthCheckResult.md new file mode 100644 index 00000000000..4885e6f1cad --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/MapTest.md b/samples/client/petstore/java/restclient-swagger2/docs/MapTest.md new file mode 100644 index 00000000000..54380188e1d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/restclient-swagger2/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a5ddf0faa6a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Model200Response.md b/samples/client/petstore/java/restclient-swagger2/docs/Model200Response.md new file mode 100644 index 00000000000..109411580c6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ModelApiResponse.md b/samples/client/petstore/java/restclient-swagger2/docs/ModelApiResponse.md new file mode 100644 index 00000000000..e374c2dd2de --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ModelFile.md b/samples/client/petstore/java/restclient-swagger2/docs/ModelFile.md new file mode 100644 index 00000000000..adcde984f52 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ModelList.md b/samples/client/petstore/java/restclient-swagger2/docs/ModelList.md new file mode 100644 index 00000000000..f93ab7dde8d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ModelReturn.md b/samples/client/petstore/java/restclient-swagger2/docs/ModelReturn.md new file mode 100644 index 00000000000..0bd356861eb --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Name.md b/samples/client/petstore/java/restclient-swagger2/docs/Name.md new file mode 100644 index 00000000000..c901d943530 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/NullableClass.md b/samples/client/petstore/java/restclient-swagger2/docs/NullableClass.md new file mode 100644 index 00000000000..fa98c5c6d98 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/NumberOnly.md b/samples/client/petstore/java/restclient-swagger2/docs/NumberOnly.md new file mode 100644 index 00000000000..b8ed1a4cfae --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/restclient-swagger2/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..f1cf571f4c0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Order.md b/samples/client/petstore/java/restclient-swagger2/docs/Order.md new file mode 100644 index 00000000000..27af32855c5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterComposite.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterComposite.md new file mode 100644 index 00000000000..98b56e0763f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterEnum.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnum.md new file mode 100644 index 00000000000..1f9b723eb8e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..cbc7f4ba54d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumInteger.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..f71dea30ad0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..99e6389f427 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java/restclient-swagger2/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..0fafaaa2715 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ParentWithNullable.md b/samples/client/petstore/java/restclient-swagger2/docs/ParentWithNullable.md new file mode 100644 index 00000000000..e4d32298563 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Pet.md b/samples/client/petstore/java/restclient-swagger2/docs/Pet.md new file mode 100644 index 00000000000..54af77a9f5a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **Set<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/PetApi.md b/samples/client/petstore/java/restclient-swagger2/docs/PetApi.md new file mode 100644 index 00000000000..e2515d9bb9b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/PetApi.md @@ -0,0 +1,678 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Set tags = Arrays.asList(); // Set | Tags to filter by + try { + Set result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/restclient-swagger2/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..ad6af7ee155 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/SingleRefType.md b/samples/client/petstore/java/restclient-swagger2/docs/SingleRefType.md new file mode 100644 index 00000000000..cc269bb871f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/SpecialModelName.md b/samples/client/petstore/java/restclient-swagger2/docs/SpecialModelName.md new file mode 100644 index 00000000000..4b6a06e3622 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/StoreApi.md b/samples/client/petstore/java/restclient-swagger2/docs/StoreApi.md new file mode 100644 index 00000000000..ce91137cc6f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/StoreApi.md @@ -0,0 +1,282 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/Tag.md b/samples/client/petstore/java/restclient-swagger2/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/restclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/User.md b/samples/client/petstore/java/restclient-swagger2/docs/User.md new file mode 100644 index 00000000000..08813e4b10b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/User.md @@ -0,0 +1,20 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java/restclient-swagger2/docs/UserApi.md b/samples/client/petstore/java/restclient-swagger2/docs/UserApi.md new file mode 100644 index 00000000000..305fd6e66df --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/docs/UserApi.md @@ -0,0 +1,543 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/restclient-swagger2/git_push.sh b/samples/client/petstore/java/restclient-swagger2/git_push.sh new file mode 100755 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/java/restclient-swagger2/gradle.properties b/samples/client/petstore/java/restclient-swagger2/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/restclient-swagger2/gradlew b/samples/client/petstore/java/restclient-swagger2/gradlew new file mode 100755 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/restclient-swagger2/gradlew.bat b/samples/client/petstore/java/restclient-swagger2/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/restclient-swagger2/pom.xml b/samples/client/petstore/java/restclient-swagger2/pom.xml new file mode 100644 index 00000000000..b054e583727 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/pom.xml @@ -0,0 +1,297 @@ + + 4.0.0 + org.openapitools + petstore-restclient + jar + petstore-restclient + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 2.2.15 + 6.1.6 + 2.15.2 + 2.15.2 + 0.2.6 + 2.1.1 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/petstore/java/restclient-swagger2/settings.gradle b/samples/client/petstore/java/restclient-swagger2/settings.gradle new file mode 100644 index 00000000000..fad96959c01 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-restclient" \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/AndroidManifest.xml b/samples/client/petstore/java/restclient-swagger2/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..4b2f31199d4 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,727 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import jakarta.annotation.Nullable; + +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.OAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "http://petstore.swagger.io:80/v2"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + authentications.put("petstore_auth", new OAuth()); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..c2cf2dd89e9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..2c5dc6747d6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..4c47f2b1971 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..60a0eed94d5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..9f6ac0cf9fa --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..71be118d959 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,121 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(new ApiClient()); + } + + @Autowired + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec call123testSpecialTagsRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling call123testSpecialTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client call123testSpecialTags(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return call123testSpecialTagsRequestCreation(client).body(localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity call123testSpecialTagsWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return call123testSpecialTagsRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec call123testSpecialTagsWithResponseSpec(Client client) throws RestClientResponseException { + return call123testSpecialTagsRequestCreation(client); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..05a81cee2bd --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,111 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(new ApiClient()); + } + + @Autowired + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + *

    0 - response + * @return FooGetDefaultResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fooGetRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/foo", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return FooGetDefaultResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public FooGetDefaultResponse fooGet() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fooGetRequestCreation().body(localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return ResponseEntity<FooGetDefaultResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fooGetWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fooGetRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fooGetWithResponseSpec() throws RestClientResponseException { + return fooGetRequestCreation(); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 00000000000..843691058f4 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,1850 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(new ApiClient()); + } + + @Autowired + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return FakeBigDecimalMap200Response + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeBigDecimalMapRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/BigDecimalMap", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return FakeBigDecimalMap200Response + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public FakeBigDecimalMap200Response fakeBigDecimalMap() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeBigDecimalMapRequestCreation().body(localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return ResponseEntity<FakeBigDecimalMap200Response> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeBigDecimalMapWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeBigDecimalMapRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeBigDecimalMapWithResponseSpec() throws RestClientResponseException { + return fakeBigDecimalMapRequestCreation(); + } + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return HealthCheckResult + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeHealthGetRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/health", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return HealthCheckResult + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public HealthCheckResult fakeHealthGet() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHealthGetRequestCreation().body(localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return ResponseEntity<HealthCheckResult> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeHealthGetWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHealthGetRequestCreation().toEntity(localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHealthGetWithResponseSpec() throws RestClientResponseException { + return fakeHealthGetRequestCreation(); + } + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeHttpSignatureTestRequestCreation(Pet pet, String query1, String header1) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling fakeHttpSignatureTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); + + + if (header1 != null) + headerParams.add("header_1", apiClient.parameterToString(header1)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/http-signature-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void fakeHttpSignatureTest(Pet pet, String query1, String header1) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + fakeHttpSignatureTestRequestCreation(pet, query1, header1).body(localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHttpSignatureTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHttpSignatureTestWithResponseSpec(Pet pet, String query1, String header1) throws RestClientResponseException { + return fakeHttpSignatureTestRequestCreation(pet, query1, header1); + } + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return Boolean + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterBooleanSerializeRequestCreation(Boolean body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return Boolean + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterBooleanSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return ResponseEntity<Boolean> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterBooleanSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterBooleanSerializeWithResponseSpec(Boolean body) throws RestClientResponseException { + return fakeOuterBooleanSerializeRequestCreation(body); + } + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return OuterComposite + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterCompositeSerializeRequestCreation(OuterComposite outerComposite) throws RestClientResponseException { + Object postBody = outerComposite; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return OuterComposite + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterCompositeSerializeRequestCreation(outerComposite).body(localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseEntity<OuterComposite> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterCompositeSerializeRequestCreation(outerComposite).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterCompositeSerializeWithResponseSpec(OuterComposite outerComposite) throws RestClientResponseException { + return fakeOuterCompositeSerializeRequestCreation(outerComposite); + } + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return BigDecimal + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterNumberSerializeRequestCreation(BigDecimal body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return BigDecimal + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterNumberSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return ResponseEntity<BigDecimal> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterNumberSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterNumberSerializeWithResponseSpec(BigDecimal body) throws RestClientResponseException { + return fakeOuterNumberSerializeRequestCreation(body); + } + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterStringSerializeRequestCreation(String body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String fakeOuterStringSerialize(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterStringSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterStringSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterStringSerializeWithResponseSpec(String body) throws RestClientResponseException { + return fakeOuterStringSerializeRequestCreation(body); + } + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return OuterObjectWithEnumProperty + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakePropertyEnumIntegerSerializeRequestCreation(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + Object postBody = outerObjectWithEnumProperty; + // verify the required parameter 'outerObjectWithEnumProperty' is set + if (outerObjectWithEnumProperty == null) { + throw new RestClientResponseException("Missing the required parameter 'outerObjectWithEnumProperty' when calling fakePropertyEnumIntegerSerialize", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/property/enum-int", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return OuterObjectWithEnumProperty + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).body(localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseEntity<OuterObjectWithEnumProperty> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakePropertyEnumIntegerSerializeWithHttpInfo(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty); + } + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testAdditionalPropertiesReferenceRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/additionalProperties-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testAdditionalPropertiesReference(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testAdditionalPropertiesReferenceRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testAdditionalPropertiesReferenceWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAdditionalPropertiesReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testAdditionalPropertiesReferenceWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testAdditionalPropertiesReferenceRequestCreation(requestBody); + } + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithBinaryRequestCreation(File body) throws RestClientResponseException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new RestClientResponseException("Missing the required parameter 'body' when calling testBodyWithBinary", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "image/png" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-binary", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithBinary(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithBinaryRequestCreation(body).body(localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithBinaryWithHttpInfo(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithBinaryRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithBinaryWithResponseSpec(File body) throws RestClientResponseException { + return testBodyWithBinaryRequestCreation(body); + } + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithFileSchemaRequestCreation(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + Object postBody = fileSchemaTestClass; + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new RestClientResponseException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).body(localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).toEntity(localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithFileSchemaWithResponseSpec(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass); + } + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithQueryParamsRequestCreation(String query, User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'query' is set + if (query == null) { + throw new RestClientResponseException("Missing the required parameter 'query' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithQueryParams(String query, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithQueryParamsRequestCreation(query, user).body(localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithQueryParamsRequestCreation(query, user).toEntity(localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithQueryParamsWithResponseSpec(String query, User user) throws RestClientResponseException { + return testBodyWithQueryParamsRequestCreation(query, user); + } + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testClientModelRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling testClientModel", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client testClientModel(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClientModelRequestCreation(client).body(localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testClientModelWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClientModelRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClientModelWithResponseSpec(Client client) throws RestClientResponseException { + return testClientModelRequestCreation(client); + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEndpointParametersRequestCreation(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'number' is set + if (number == null) { + throw new RestClientResponseException("Missing the required parameter 'number' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter '_double' is set + if (_double == null) { + throw new RestClientResponseException("Missing the required parameter '_double' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new RestClientResponseException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new RestClientResponseException("Missing the required parameter '_byte' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (integer != null) + formParams.add("integer", integer); + if (int32 != null) + formParams.add("int32", int32); + if (int64 != null) + formParams.add("int64", int64); + if (number != null) + formParams.add("number", number); + if (_float != null) + formParams.add("float", _float); + if (_double != null) + formParams.add("double", _double); + if (string != null) + formParams.add("string", string); + if (patternWithoutDelimiter != null) + formParams.add("pattern_without_delimiter", patternWithoutDelimiter); + if (_byte != null) + formParams.add("byte", _byte); + if (binary != null) + formParams.add("binary", new FileSystemResource(binary)); + if (date != null) + formParams.add("date", date); + if (dateTime != null) + formParams.add("dateTime", dateTime); + if (password != null) + formParams.add("password", password); + if (paramCallback != null) + formParams.add("callback", paramCallback); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_basic_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).body(localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).toEntity(localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEndpointParametersWithResponseSpec(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEnumParametersRequestCreation(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "enum_query_model_array", enumQueryModelArray)); + + + if (enumHeaderStringArray != null) + headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); + if (enumHeaderString != null) + headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); + if (enumFormStringArray != null) + formParams.addAll("enum_form_string_array", enumFormStringArray); + if (enumFormString != null) + formParams.add("enum_form_string", enumFormString); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).body(localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).toEntity(localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEnumParametersWithResponseSpec(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testGroupParametersRequestCreation(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); + + + if (requiredBooleanGroup != null) + headerParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) + headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "bearer_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).body(localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).toEntity(localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testGroupParametersWithResponseSpec(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineAdditionalPropertiesRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testInlineAdditionalProperties(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testInlineAdditionalPropertiesRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testInlineAdditionalPropertiesRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testInlineAdditionalPropertiesRequestCreation(requestBody); + } + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineFreeformAdditionalPropertiesRequestCreation(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + Object postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new RestClientResponseException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).body(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).toEntity(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineFreeformAdditionalPropertiesWithResponseSpec(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest); + } + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testJsonFormDataRequestCreation(String param, String param2) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'param' is set + if (param == null) { + throw new RestClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new RestClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (param != null) + formParams.add("param", param); + if (param2 != null) + formParams.add("param2", param2); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testJsonFormData(String param, String param2) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testJsonFormDataRequestCreation(param, param2).body(localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testJsonFormDataWithHttpInfo(String param, String param2) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testJsonFormDataRequestCreation(param, param2).toEntity(localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testJsonFormDataWithResponseSpec(String param, String param2) throws RestClientResponseException { + return testJsonFormDataRequestCreation(param, param2); + } + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testNullableRequestCreation(ChildWithNullable childWithNullable) throws RestClientResponseException { + Object postBody = childWithNullable; + // verify the required parameter 'childWithNullable' is set + if (childWithNullable == null) { + throw new RestClientResponseException("Missing the required parameter 'childWithNullable' when calling testNullable", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/nullable", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testNullable(ChildWithNullable childWithNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testNullableRequestCreation(childWithNullable).body(localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testNullableWithHttpInfo(ChildWithNullable childWithNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testNullableRequestCreation(childWithNullable).toEntity(localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testNullableWithResponseSpec(ChildWithNullable childWithNullable) throws RestClientResponseException { + return testNullableRequestCreation(childWithNullable); + } + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new RestClientResponseException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new RestClientResponseException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new RestClientResponseException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new RestClientResponseException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new RestClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) { + throw new RestClientResponseException("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("pipes".toUpperCase(Locale.ROOT)), "pipe", pipe)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "language", language)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "allowEmpty", allowEmpty)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).body(localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).toEntity(localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); + } + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testStringMapReferenceRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testStringMapReference", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/stringMap-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testStringMapReference(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testStringMapReferenceRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testStringMapReferenceWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testStringMapReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testStringMapReferenceWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testStringMapReferenceRequestCreation(requestBody); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..832d9885ded --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,121 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeClassnameTags123Api { + private ApiClient apiClient; + + public FakeClassnameTags123Api() { + this(new ApiClient()); + } + + @Autowired + public FakeClassnameTags123Api(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testClassnameRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling testClassname", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key_query" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client testClassname(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClassnameRequestCreation(client).body(localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testClassnameWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClassnameRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClassnameWithResponseSpec(Client client) throws RestClientResponseException { + return testClassnameRequestCreation(client); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..a493a432a94 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,794 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class PetApi { + private ApiClient apiClient; + + public PetApi() { + this(new ApiClient()); + } + + @Autowired + public PetApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addPetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling addPet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void addPet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + addPetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity addPetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return addPetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addPetWithResponseSpec(Pet pet) throws RestClientResponseException { + return addPetRequestCreation(pet); + } + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deletePetRequestCreation(Long petId, String apiKey) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling deletePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + + if (apiKey != null) + headerParams.add("api_key", apiClient.parameterToString(apiKey)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deletePet(Long petId, String apiKey) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deletePetRequestCreation(petId, apiKey).body(localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deletePetRequestCreation(petId, apiKey).toEntity(localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws RestClientResponseException { + return deletePetRequestCreation(petId, apiKey); + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return List<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec findPetsByStatusRequestCreation(List status) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'status' is set + if (status == null) { + throw new RestClientResponseException("Missing the required parameter 'status' when calling findPetsByStatus", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return List<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public List findPetsByStatus(List status) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByStatusRequestCreation(status).body(localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseEntity<List<Pet>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByStatusRequestCreation(status).toEntity(localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByStatusWithResponseSpec(List status) throws RestClientResponseException { + return findPetsByStatusRequestCreation(status); + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return Set<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + * @deprecated + */ + @Deprecated + private ResponseSpec findPetsByTagsRequestCreation(Set tags) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'tags' is set + if (tags == null) { + throw new RestClientResponseException("Missing the required parameter 'tags' when calling findPetsByTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return Set<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Set findPetsByTags(Set tags) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByTagsRequestCreation(tags).body(localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseEntity<Set<Pet>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByTagsRequestCreation(tags).toEntity(localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByTagsWithResponseSpec(Set tags) throws RestClientResponseException { + return findPetsByTagsRequestCreation(tags); + } + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getPetByIdRequestCreation(Long petId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling getPetById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Pet getPetById(Long petId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getPetByIdRequestCreation(petId).body(localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return ResponseEntity<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getPetByIdRequestCreation(petId).toEntity(localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getPetByIdWithResponseSpec(Long petId) throws RestClientResponseException { + return getPetByIdRequestCreation(petId); + } + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updatePetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling updatePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updatePet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updatePetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updatePetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updatePetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithResponseSpec(Pet pet) throws RestClientResponseException { + return updatePetRequestCreation(pet); + } + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updatePetWithFormRequestCreation(Long petId, String name, String status) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling updatePetWithForm", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (name != null) + formParams.add("name", name); + if (status != null) + formParams.add("status", status); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updatePetWithForm(Long petId, String name, String status) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updatePetWithFormRequestCreation(petId, name, status).body(localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updatePetWithFormRequestCreation(petId, name, status).toEntity(localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithFormWithResponseSpec(Long petId, String name, String status) throws RestClientResponseException { + return updatePetWithFormRequestCreation(petId, name, status); + } + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadFileRequestCreation(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling uploadFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (additionalMetadata != null) + formParams.add("additionalMetadata", additionalMetadata); + if (_file != null) + formParams.add("file", new FileSystemResource(_file)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileRequestCreation(petId, additionalMetadata, _file).body(localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseEntity<ModelApiResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileRequestCreation(petId, additionalMetadata, _file).toEntity(localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithResponseSpec(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + return uploadFileRequestCreation(petId, additionalMetadata, _file); + } + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadFileWithRequiredFileRequestCreation(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (additionalMetadata != null) + formParams.add("additionalMetadata", additionalMetadata); + if (requiredFile != null) + formParams.add("requiredFile", new FileSystemResource(requiredFile)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).body(localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseEntity<ModelApiResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).toEntity(localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithRequiredFileWithResponseSpec(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..7213813aea4 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,344 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Order; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StoreApi { + private ApiClient apiClient; + + public StoreApi() { + this(new ApiClient()); + } + + @Autowired + public StoreApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteOrderRequestCreation(String orderId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new RestClientResponseException("Missing the required parameter 'orderId' when calling deleteOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("order_id", orderId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deleteOrder(String orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deleteOrderRequestCreation(orderId).body(localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deleteOrderRequestCreation(orderId).toEntity(localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteOrderWithResponseSpec(String orderId) throws RestClientResponseException { + return deleteOrderRequestCreation(orderId); + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return Map<String, Integer> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getInventoryRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return Map<String, Integer> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Map getInventory() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return getInventoryRequestCreation().body(localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return ResponseEntity<Map<String, Integer>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> getInventoryWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return getInventoryRequestCreation().toEntity(localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getInventoryWithResponseSpec() throws RestClientResponseException { + return getInventoryRequestCreation(); + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getOrderByIdRequestCreation(Long orderId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new RestClientResponseException("Missing the required parameter 'orderId' when calling getOrderById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("order_id", orderId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Order getOrderById(Long orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getOrderByIdRequestCreation(orderId).body(localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseEntity<Order> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getOrderByIdRequestCreation(orderId).toEntity(localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getOrderByIdWithResponseSpec(Long orderId) throws RestClientResponseException { + return getOrderByIdRequestCreation(orderId); + } + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec placeOrderRequestCreation(Order order) throws RestClientResponseException { + Object postBody = order; + // verify the required parameter 'order' is set + if (order == null) { + throw new RestClientResponseException("Missing the required parameter 'order' when calling placeOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Order placeOrder(Order order) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return placeOrderRequestCreation(order).body(localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseEntity<Order> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity placeOrderWithHttpInfo(Order order) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return placeOrderRequestCreation(order).toEntity(localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec placeOrderWithResponseSpec(Order order) throws RestClientResponseException { + return placeOrderRequestCreation(order); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..1bec78f9a04 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,639 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class UserApi { + private ApiClient apiClient; + + public UserApi() { + this(new ApiClient()); + } + + @Autowired + public UserApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUserRequestCreation(User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUser(User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUserRequestCreation(user).body(localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUserWithHttpInfo(User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUserRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserWithResponseSpec(User user) throws RestClientResponseException { + return createUserRequestCreation(user); + } + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUsersWithArrayInputRequestCreation(List user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUsersWithArrayInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUsersWithArrayInput(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUsersWithArrayInputRequestCreation(user).body(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUsersWithArrayInputWithHttpInfo(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUsersWithArrayInputRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithArrayInputWithResponseSpec(List user) throws RestClientResponseException { + return createUsersWithArrayInputRequestCreation(user); + } + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUsersWithListInputRequestCreation(List user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUsersWithListInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUsersWithListInput(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUsersWithListInputRequestCreation(user).body(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUsersWithListInputWithHttpInfo(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUsersWithListInputRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithListInputWithResponseSpec(List user) throws RestClientResponseException { + return createUsersWithListInputRequestCreation(user); + } + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserRequestCreation(String username) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deleteUser(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deleteUserRequestCreation(username).body(localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deleteUserWithHttpInfo(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deleteUserRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserWithResponseSpec(String username) throws RestClientResponseException { + return deleteUserRequestCreation(username); + } + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserByNameRequestCreation(String username) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling getUserByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public User getUserByName(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getUserByNameRequestCreation(username).body(localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseEntity<User> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getUserByNameWithHttpInfo(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getUserByNameRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserByNameWithResponseSpec(String username) throws RestClientResponseException { + return getUserByNameRequestCreation(username); + } + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec loginUserRequestCreation(String username, String password) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'password' is set + if (password == null) { + throw new RestClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String loginUser(String username, String password) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return loginUserRequestCreation(username, password).body(localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity loginUserWithHttpInfo(String username, String password) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return loginUserRequestCreation(username, password).toEntity(localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec loginUserWithResponseSpec(String username, String password) throws RestClientResponseException { + return loginUserRequestCreation(username, password); + } + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec logoutUserRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void logoutUser() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + logoutUserRequestCreation().body(localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity logoutUserWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return logoutUserRequestCreation().toEntity(localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec logoutUserWithResponseSpec() throws RestClientResponseException { + return logoutUserRequestCreation(); + } + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateUserRequestCreation(String username, User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updateUser(String username, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updateUserRequestCreation(username, user).body(localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updateUserWithHttpInfo(String username, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updateUserRequestCreation(username, user).toEntity(localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserWithResponseSpec(String username, User user) throws RestClientResponseException { + return updateUserRequestCreation(username, user); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f2597a71272 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f0afdd6841c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..75b318e2922 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 00000000000..9ab517eee4f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,24 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 00000000000..909e57b2462 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,5 @@ +package org.openapitools.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..707e011033d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,155 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdditionalPropertiesClass + */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AdditionalPropertiesClass { + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + private Map mapProperty; + + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + private Map> mapOfMapProperty; + + public AdditionalPropertiesClass() { + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapProperty() { + return mapProperty; + } + + + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..98c9bfc98b0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.SingleRefType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AllOfWithSingleRef + */ +@JsonPropertyOrder({ + AllOfWithSingleRef.JSON_PROPERTY_USERNAME, + AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AllOfWithSingleRef { + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType"; + private SingleRefType singleRefType; + + public AllOfWithSingleRef() { + } + + public AllOfWithSingleRef username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + + this.singleRefType = singleRefType; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SingleRefType getSingleRefType() { + return singleRefType; + } + + + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 00000000000..0ca94fbbbca --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Animal + */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), +}) + +public class Animal { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + protected String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + protected String color = "red"; + + public Animal() { + } + + public Animal className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..3f21e1b4062 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,117 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayOfArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber; + + public ArrayOfArrayOfNumberOnly() { + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..859bc32fea3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,117 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber; + + public ArrayOfNumberOnly() { + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayNumber() { + return arrayNumber; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 00000000000..753d83e8621 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,197 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayTest + */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayTest { + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel; + + public ArrayTest() { + } + + public ArrayTest arrayOfString(List arrayOfString) { + + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayOfString() { + return arrayOfString; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 00000000000..56e0c842741 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Capitalization + */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Capitalization { + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; + + public Capitalization() { + } + + public Capitalization smallCamel(String smallCamel) { + + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallCamel() { + return smallCamel; + } + + + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalCamel() { + return capitalCamel; + } + + + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallSnake() { + return smallSnake; + } + + + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalSnake() { + return capitalSnake; + } + + + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getATTNAME() { + return ATT_NAME; + } + + + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..45cfc4670bd --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,130 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Cat + */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Cat extends Animal { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + public Cat() { + + } + + public Cat declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..bf88896f8ce --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; + + public Category() { + } + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 00000000000..2ed41453b7f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,142 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ChildWithNullable + */ +@JsonPropertyOrder({ + ChildWithNullable.JSON_PROPERTY_OTHER_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class ChildWithNullable extends ParentWithNullable { + public static final String JSON_PROPERTY_OTHER_PROPERTY = "otherProperty"; + private String otherProperty; + + public ChildWithNullable() { + + } + + public ChildWithNullable otherProperty(String otherProperty) { + + this.otherProperty = otherProperty; + return this; + } + + /** + * Get otherProperty + * @return otherProperty + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOtherProperty() { + return otherProperty; + } + + + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + @Override + public ChildWithNullable type(TypeEnum type) { + this.setType(type); + return this; + } + + @Override + public ChildWithNullable nullableProperty(String nullableProperty) { + this.setNullableProperty(nullableProperty); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 00000000000..b535168d5cc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model with \"_class\" property + */ +@Schema(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ClassModel { + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; + + public ClassModel() { + } + + public ClassModel propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 00000000000..020aa95f186 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Client + */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Client { + public static final String JSON_PROPERTY_CLIENT = "client"; + private String client; + + public Client() { + } + + public Client client(String client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClient() { + return client; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 00000000000..9a144e3922a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DeprecatedObject + * @deprecated + */ +@Deprecated +@JsonPropertyOrder({ + DeprecatedObject.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DeprecatedObject { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeprecatedObject() { + } + + public DeprecatedObject name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..54043d7904a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,130 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Dog + */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Dog extends Animal { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + public Dog() { + + } + + public Dog breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 00000000000..4531378c2a4 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,218 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EnumArrays + */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum; + + public EnumArrays() { + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayEnum() { + return arrayEnum; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 00000000000..1190cf5abe3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 00000000000..faff3e49fb2 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,501 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EnumTest + */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) +@JsonTypeName("Enum_Test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private JsonNullable outerEnum = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + public EnumTest() { + } + + public EnumTest enumString(EnumStringEnum enumString) { + + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumStringEnum getEnumString() { + return enumString; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public OuterEnum getOuterEnum() { + return outerEnum.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getOuterEnum_JsonNullable() { + return outerEnum; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { + this.outerEnum = outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + equalsNullable(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..c3886444e5f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FakeBigDecimalMap200Response + */ +@JsonPropertyOrder({ + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID, + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP +}) +@JsonTypeName("fakeBigDecimalMap_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeBigDecimalMap200Response { + public static final String JSON_PROPERTY_SOME_ID = "someId"; + private BigDecimal someId; + + public static final String JSON_PROPERTY_SOME_MAP = "someMap"; + private Map someMap; + + public FakeBigDecimalMap200Response() { + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + + this.someId = someId; + return this; + } + + /** + * Get someId + * @return someId + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getSomeId() { + return someId; + } + + + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + /** + * Get someMap + * @return someMap + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getSomeMap() { + return someMap; + } + + + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..96dde0fe3cd --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FileSchemaTestClass + */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FileSchemaTestClass { + public static final String JSON_PROPERTY_FILE = "file"; + private ModelFile _file; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files; + + public FileSchemaTestClass() { + } + + public FileSchemaTestClass _file(ModelFile _file) { + + this._file = _file; + return this; + } + + /** + * Get _file + * @return _file + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ModelFile getFile() { + return _file; + } + + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass files(List files) { + + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 00000000000..f0068951b3e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Foo + */ +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Foo { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar = "bar"; + + public Foo() { + } + + public Foo bar(String bar) { + + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBar(String bar) { + this.bar = bar; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..3ca24aa5474 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FooGetDefaultResponse + */ +@JsonPropertyOrder({ + FooGetDefaultResponse.JSON_PROPERTY_STRING +}) +@JsonTypeName("_foo_get_default_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooGetDefaultResponse { + public static final String JSON_PROPERTY_STRING = "string"; + private Foo string; + + public FooGetDefaultResponse() { + } + + public FooGetDefaultResponse string(Foo string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Foo getString() { + return string; + } + + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(Foo string) { + this.string = string; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 00000000000..551ee31ced9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,601 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FormatTest + */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_DECIMAL, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) +@JsonTypeName("format_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FormatTest { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_DECIMAL = "decimal"; + private BigDecimal decimal; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + private String patternWithDigits; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + private String patternWithDigitsAndDelimiter; + + public FormatTest() { + } + + public FormatTest integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInteger() { + return integer; + } + + + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInt32() { + return int32; + } + + + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInt64() { + return int64; + } + + + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest decimal(BigDecimal decimal) { + + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getDecimal() { + return decimal; + } + + + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest string(String string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getString() { + return string; + } + + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public byte[] getByte() { + return _byte; + } + + + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getBinary() { + return binary; + } + + + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigits() { + return patternWithDigits; + } + + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..000b933594d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,128 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HasOnlyReadOnly + */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) +@JsonTypeName("hasOnlyReadOnly") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HasOnlyReadOnly { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; + + public HasOnlyReadOnly() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + /** + * Get foo + * @return foo + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFoo() { + return foo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 00000000000..bc9e05ff326 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +@Schema(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HealthCheckResult { + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + private JsonNullable nullableMessage = JsonNullable.undefined(); + + public HealthCheckResult() { + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public String getNullableMessage() { + return nullableMessage.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableMessage_JsonNullable() { + return nullableMessage; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableMessage)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 00000000000..41f0e2175b8 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,270 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MapTest + */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MapTest { + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap; + + public MapTest() { + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getDirectMap() { + return directMap; + } + + + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getIndirectMap() { + return indirectMap; + } + + + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..58b58e94d4b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,182 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + private Map map; + + public MixedPropertiesAndAdditionalPropertiesClass() { + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMap() { + return map; + } + + + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 00000000000..692a1d63dbc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name starting with number + */ +@Schema(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) +@JsonTypeName("200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Model200Response { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; + + public Model200Response() { + } + + public Model200Response name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..8da9af8b1db --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("ApiResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 00000000000..80aab3c8c52 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@Schema(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 00000000000..f2fbb573977 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 00000000000..9d2aacff3d9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing reserved words + */ +@Schema(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) +@JsonTypeName("Return") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelReturn { + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; + + public ModelReturn() { + } + + public ModelReturn _return(Integer _return) { + + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReturn() { + return _return; + } + + + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 00000000000..ab0e2b8294b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,192 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name same as property name + */ +@Schema(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Name { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; + + public Name() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } + + public Name name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSnakeCase() { + return snakeCase; + } + + + + public Name property(String property) { + + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProperty() { + return property; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * @return _123number + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer get123number() { + return _123number; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 00000000000..eeb28c8b03c --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,627 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NullableClass + */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NullableClass extends HashMap { + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + private JsonNullable integerProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + private JsonNullable numberProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + private JsonNullable booleanProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + private JsonNullable stringProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + private JsonNullable dateProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + private JsonNullable datetimeProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + private List arrayItemsNullable; + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + private JsonNullable> objectNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + private Map objectItemsNullable; + + public NullableClass() { + + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + + return this; + } + + /** + * Get integerProp + * @return integerProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public Integer getIntegerProp() { + return integerProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getIntegerProp_JsonNullable() { + return integerProp; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + public void setIntegerProp_JsonNullable(JsonNullable integerProp) { + this.integerProp = integerProp; + } + + public void setIntegerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public BigDecimal getNumberProp() { + return numberProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNumberProp_JsonNullable() { + return numberProp; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + public void setNumberProp_JsonNullable(JsonNullable numberProp) { + this.numberProp = numberProp; + } + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public Boolean getBooleanProp() { + return booleanProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBooleanProp_JsonNullable() { + return booleanProp; + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public String getStringProp() { + return stringProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getStringProp_JsonNullable() { + return stringProp; + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + public void setStringProp_JsonNullable(JsonNullable stringProp) { + this.stringProp = stringProp; + } + + public void setStringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public LocalDate getDateProp() { + return dateProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDateProp_JsonNullable() { + return dateProp; + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + public void setDateProp_JsonNullable(JsonNullable dateProp) { + this.dateProp = dateProp; + } + + public void setDateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public OffsetDateTime getDatetimeProp() { + return datetimeProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDatetimeProp_JsonNullable() { + return datetimeProp; + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayNullableProp.get().add(arrayNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public List getArrayNullableProp() { + return arrayNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayNullableProp_JsonNullable() { + return arrayNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { + return arrayAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + public void setArrayAndItemsNullableProp_JsonNullable(JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectNullableProp.get().put(key, objectNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public Map getObjectNullableProp() { + return objectNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectNullableProp_JsonNullable() { + return objectNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + public void setObjectNullableProp_JsonNullable(JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { + return objectAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + public void setObjectAndItemsNullableProp_JsonNullable(JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return equalsNullable(this.integerProp, nullableClass.integerProp) && + equalsNullable(this.numberProp, nullableClass.numberProp) && + equalsNullable(this.booleanProp, nullableClass.booleanProp) && + equalsNullable(this.stringProp, nullableClass.stringProp) && + equalsNullable(this.dateProp, nullableClass.dateProp) && + equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && + equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && + equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && + equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 00000000000..398ea6a9e2f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberOnly + */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NumberOnly { + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; + + public NumberOnly() { + } + + public NumberOnly justNumber(BigDecimal justNumber) { + + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getJustNumber() { + return justNumber; + } + + + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..daf2ff0e03e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,220 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ObjectWithDeprecatedFields + */ +@JsonPropertyOrder({ + ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, + ObjectWithDeprecatedFields.JSON_PROPERTY_ID, + ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, + ObjectWithDeprecatedFields.JSON_PROPERTY_BARS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ObjectWithDeprecatedFields { + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public static final String JSON_PROPERTY_ID = "id"; + private BigDecimal id; + + public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + private DeprecatedObject deprecatedRef; + + public static final String JSON_PROPERTY_BARS = "bars"; + private List bars; + + public ObjectWithDeprecatedFields() { + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields bars(List bars) { + + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBars() { + return bars; + } + + + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBars(List bars) { + this.bars = bars; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..faf3c9ca784 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,303 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + public Order() { + } + + public Order id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPetId() { + return petId; + } + + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getShipDate() { + return shipDate; + } + + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getComplete() { + return complete; + } + + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 00000000000..bbca9fca005 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,170 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OuterComposite + */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterComposite { + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; + + public OuterComposite() { + } + + public OuterComposite myNumber(BigDecimal myNumber) { + + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getMyNumber() { + return myNumber; + } + + + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMyString() { + return myString; + } + + + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMyBoolean() { + return myBoolean; + } + + + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 00000000000..4cd955b63dc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..73077cc8c31 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 00000000000..e6c2e38c2e7 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..ef61373b187 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..3c61ad409a3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.OuterEnumInteger; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OuterObjectWithEnumProperty + */ +@JsonPropertyOrder({ + OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterObjectWithEnumProperty { + public static final String JSON_PROPERTY_VALUE = "value"; + private OuterEnumInteger value; + + public OuterObjectWithEnumProperty() { + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OuterEnumInteger getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 00000000000..6599943d4fc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,205 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ParentWithNullable + */ +@JsonPropertyOrder({ + ParentWithNullable.JSON_PROPERTY_TYPE, + ParentWithNullable.JSON_PROPERTY_NULLABLE_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + +public class ParentWithNullable { + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + protected TypeEnum type; + + public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; + protected JsonNullable nullableProperty = JsonNullable.undefined(); + + public ParentWithNullable() { + } + + public ParentWithNullable type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonIgnore + + public String getNullableProperty() { + return nullableProperty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableProperty_JsonNullable() { + return nullableProperty; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + public void setNullableProperty_JsonNullable(JsonNullable nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + equalsNullable(this.nullableProperty, parentWithNullable.nullableProperty); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, hashCodeNullable(nullableProperty)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..7c4ad272388 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,327 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private Set photoUrls; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet() { + } + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Category getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @Schema(example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @jakarta.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Set getPhotoUrls() { + return photoUrls; + } + + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..89b8b82f23e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ReadOnlyFirst + */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ReadOnlyFirst { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; + + public ReadOnlyFirst() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + public ReadOnlyFirst baz(String baz) { + + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBaz() { + return baz; + } + + + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 00000000000..f9922454755 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 00000000000..9e04d7f37ef --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialModelName + */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) +@JsonTypeName("_special_model.name_") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class SpecialModelName { + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; + + public SpecialModelName() { + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..eefcacc0922 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Tag() { + } + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..c3221bdc208 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..3fc07f32501 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,329 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class User { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; + + public User() { + } + + public User id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhone() { + return phone; + } + + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @jakarta.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUserStatus() { + return userStatus; + } + + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..f17f97c4def --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + */ + @Test + public void call123testSpecialTagsTest() { + Client client = null; + Client response = api.call123testSpecialTags(client); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..be7d082abc6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for DefaultApi + */ +@Ignore +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + + /** + * + * + * + */ + @Test + public void fooGetTest() { + FooGetDefaultResponse response = api.fooGet(); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 00000000000..fd55e7b08a6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,369 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for FakeApi + */ +@Ignore +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + FakeBigDecimalMap200Response response = api.fakeBigDecimalMap(); + + // TODO: test validations + } + + /** + * Health check endpoint + * + * + */ + @Test + public void fakeHealthGetTest() { + HealthCheckResult response = api.fakeHealthGet(); + + // TODO: test validations + } + + /** + * test http signature authentication + * + * + */ + @Test + public void fakeHttpSignatureTestTest() { + Pet pet = null; + String query1 = null; + String header1 = null; + api.fakeHttpSignatureTest(pet, query1, header1); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of enum (int) properties with examples + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + Map requestBody = null; + api.testAdditionalPropertiesReference(requestBody); + + // TODO: test validations + } + + /** + * + * + * For this test, the body has to be a binary file. + */ + @Test + public void testBodyWithBinaryTest() { + File body = null; + api.testBodyWithBinary(body); + + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request must reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + Client response = api.testClientModel(client); + + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + @Test + public void testEndpointParametersTest() { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; + String password = null; + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumQueryModelArray = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @Test + public void testGroupParametersTest() { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + Map requestBody = null; + api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + + // TODO: test validations + } + + /** + * test nullable parent property + * + * + */ + @Test + public void testNullableTest() { + ChildWithNullable childWithNullable = null; + api.testNullable(childWithNullable); + + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + String allowEmpty = null; + Map language = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + */ + @Test + public void testStringMapReferenceTest() { + Map requestBody = null; + api.testStringMapReference(requestBody); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 00000000000..9b9e18fb233 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for FakeClassnameTags123Api + */ +@Ignore +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + + /** + * To test class name in snake case + * + * To test class name in snake case + */ + @Test + public void testClassnameTest() { + Client client = null; + Client response = api.testClassname(client); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..005740d942a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for PetApi + */ +@Ignore +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + */ + @Test + public void addPetTest() { + Pet pet = null; + api.addPet(pet); + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + */ + @Test + public void deletePetTest() { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ + @Test + public void findPetsByStatusTest() { + List status = null; + List response = api.findPetsByStatus(status); + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ + @Test + public void findPetsByTagsTest() { + Set tags = null; + Set response = api.findPetsByTags(tags); + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + */ + @Test + public void getPetByIdTest() { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + */ + @Test + public void updatePetTest() { + Pet pet = null; + api.updatePet(pet); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + */ + @Test + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + + // TODO: test validations + } + + /** + * uploads an image + * + * + */ + @Test + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File _file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + */ + @Test + public void uploadFileWithRequiredFileTest() { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..682b18f0b1d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for StoreApi + */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @Test + public void deleteOrderTest() { + String orderId = null; + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ + @Test + public void getInventoryTest() { + Map response = api.getInventory(); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + */ + @Test + public void getOrderByIdTest() { + Long orderId = null; + Order response = api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + Order response = api.placeOrder(order); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..a0323a12351 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for UserApi + */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + */ + @Test + public void createUserTest() { + User user = null; + api.createUser(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + */ + @Test + public void createUsersWithArrayInputTest() { + List user = null; + api.createUsersWithArrayInput(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + */ + @Test + public void createUsersWithListInputTest() { + List user = null; + api.createUsersWithListInput(user); + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + */ + @Test + public void deleteUserTest() { + String username = null; + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * + */ + @Test + public void getUserByNameTest() { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + */ + @Test + public void logoutUserTest() { + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..455a8256f3f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..428a96e0eed --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.SingleRefType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 00000000000..0fad2077847 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..e20b95c6506 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..25fbf3ae860 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 00000000000..be18c54a3bc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 00000000000..ba313f884d9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..d2835b6d602 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..a9d373574b6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 00000000000..ae20302481a --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 00000000000..646ffebd075 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 00000000000..554e01b734f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..0637c6f0e49 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..df2338d60e1 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 00000000000..b045a666caa --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 00000000000..48aa1a737fc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 00000000000..af81056eaa5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 00000000000..a489af133c0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..04fbf298304 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..42bbed2c2a9 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.Foo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 00000000000..2cfb0aa1e9e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 00000000000..2e5a0bb50ff --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,173 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..add61425d5d --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..d4b620c7b75 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 00000000000..47f7510c268 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..558e4a8bfe3 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 00000000000..e1cfc70e0c5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..cc8f5ea57b0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 00000000000..d08e44935c5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 00000000000..1f746099efc --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 00000000000..38a470b8529 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 00000000000..80b16a806fb --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,72 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 00000000000..764e7edfc07 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,148 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 00000000000..86a2386c609 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..4140c54e4a6 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..0c0d62b6bf7 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 00000000000..0262b1aeb04 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..d818b23c7d5 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..1d7b3338bca --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..cacda46a76f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 00000000000..0333ee657a0 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..f4ddea07c34 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.client.model.OuterEnumInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 00000000000..bd0822bc974 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..326497ac2f7 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..12b8bab7ff8 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..476e4ca161b --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..93c8bc45202 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..b9fef55d70e --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..d219c81ed5f --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..bb6e3fd4732 --- /dev/null +++ b/samples/client/petstore/java/restclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/restclient/.github/workflows/maven.yml b/samples/client/petstore/java/restclient/.github/workflows/maven.yml new file mode 100644 index 00000000000..460f78bfd1b --- /dev/null +++ b/samples/client/petstore/java/restclient/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/restclient/.gitignore b/samples/client/petstore/java/restclient/.gitignore new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/samples/client/petstore/java/restclient/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java/restclient/.openapi-generator-ignore b/samples/client/petstore/java/restclient/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java/restclient/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java/restclient/.openapi-generator/FILES b/samples/client/petstore/java/restclient/.openapi-generator/FILES new file mode 100644 index 00000000000..fcdb2bc3222 --- /dev/null +++ b/samples/client/petstore/java/restclient/.openapi-generator/FILES @@ -0,0 +1,142 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/User.md +docs/UserApi.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildWithNullable.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/client/model/ParentWithNullable.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/restclient/.openapi-generator/VERSION b/samples/client/petstore/java/restclient/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/client/petstore/java/restclient/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/java/restclient/.travis.yml b/samples/client/petstore/java/restclient/.travis.yml new file mode 100644 index 00000000000..1b6741c083c --- /dev/null +++ b/samples/client/petstore/java/restclient/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/petstore/java/restclient/README.md b/samples/client/petstore/java/restclient/README.md new file mode 100644 index 00000000000..a9421f71622 --- /dev/null +++ b/samples/client/petstore/java/restclient/README.md @@ -0,0 +1,278 @@ +# petstore-restclient + +OpenAPI Petstore + +- API version: 1.0.0 + +- Generator version: 8.0.0-SNAPSHOT + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-restclient + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy + repositories { + mavenCentral() // Needed if the 'petstore-restclient' jar has been published to maven central. + mavenLocal() // Needed if the 'petstore-restclient' jar has been published to the local maven repo. + } + + dependencies { + implementation "org.openapitools:petstore-restclient:1.0.0" + } +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-restclient-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testNullable**](docs/FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md) + - [Animal](docs/Animal.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [ChildWithNullable](docs/ChildWithNullable.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [Dog](docs/Dog.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelFile](docs/ModelFile.md) + - [ModelList](docs/ModelList.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md) + - [ParentWithNullable](docs/ParentWithNullable.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SingleRefType](docs/SingleRefType.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [User](docs/User.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### bearer_test + + +- **Type**: HTTP Bearer Token authentication (JWT) + + +### http_signature_test + + +- **Type**: HTTP signature authentication + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/restclient/api/openapi.yaml b/samples/client/petstore/java/restclient/api/openapi.yaml new file mode 100644 index 00000000000..96dc260deb8 --- /dev/null +++ b/samples/client/petstore/java/restclient/api/openapi.yaml @@ -0,0 +1,2362 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: + - application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-webclient-blocking: false + x-accepts: + - application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/java/restclient/build.gradle b/samples/client/petstore/java/restclient/build.gradle new file mode 100644 index 00000000000..94a0b59788e --- /dev/null +++ b/samples/client/petstore/java/restclient/build.gradle @@ -0,0 +1,136 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +repositories { + mavenCentral() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 23 + buildToolsVersion '23.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 22 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + archiveClassifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven-publish' + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + + publishing { + publications { + maven(MavenPublication) { + artifactId = 'petstore-restclient' + from components.java + } + } + } + + task execute(type:JavaExec) { + mainClass = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + jackson_version = "2.14.2" + jackson_databind_version = "2.15.1" + jackson_databind_nullable_version = "0.2.6" + spring_web_version = "6.1.6" + jakarta_annotation_version = "2.1.1" + jodatime_version = "2.9.9" + junit_version = "5.10.2" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework:spring-web:$spring_web_version" + implementation "org.springframework:spring-context:$spring_web_version" + implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" + implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + // Enable JUnit 5 (Gradle 4.6+). + useJUnitPlatform() + + // Always run tests, even when nothing changed. + dependsOn 'cleanTest' + + // Show test results. + testLogging { + events "passed", "skipped", "failed" + } + +} diff --git a/samples/client/petstore/java/restclient/build.sbt b/samples/client/petstore/java/restclient/build.sbt new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/samples/client/petstore/java/restclient/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/petstore/java/restclient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/restclient/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..fe69a56eebf --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/AllOfWithSingleRef.md b/samples/client/petstore/java/restclient/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..4146d56a372 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Animal.md b/samples/client/petstore/java/restclient/docs/Animal.md new file mode 100644 index 00000000000..d9b32f14c88 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/AnotherFakeApi.md b/samples/client/petstore/java/restclient/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..73c966d2d54 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/restclient/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..0188db3eb13 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/restclient/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..a5753530aad --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ArrayTest.md b/samples/client/petstore/java/restclient/docs/ArrayTest.md new file mode 100644 index 00000000000..36077c9df30 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Capitalization.md b/samples/client/petstore/java/restclient/docs/Capitalization.md new file mode 100644 index 00000000000..82a812711de --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Cat.md b/samples/client/petstore/java/restclient/docs/Cat.md new file mode 100644 index 00000000000..390dd519c8c --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Category.md b/samples/client/petstore/java/restclient/docs/Category.md new file mode 100644 index 00000000000..ab6d1ec334d --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java/restclient/docs/ChildWithNullable.md b/samples/client/petstore/java/restclient/docs/ChildWithNullable.md new file mode 100644 index 00000000000..73c0dd6d473 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ClassModel.md b/samples/client/petstore/java/restclient/docs/ClassModel.md new file mode 100644 index 00000000000..af46dea1f6c --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Client.md b/samples/client/petstore/java/restclient/docs/Client.md new file mode 100644 index 00000000000..ef07b4ab8b9 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/DefaultApi.md b/samples/client/petstore/java/restclient/docs/DefaultApi.md new file mode 100644 index 00000000000..2c56e1f90e5 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/restclient/docs/DeprecatedObject.md b/samples/client/petstore/java/restclient/docs/DeprecatedObject.md new file mode 100644 index 00000000000..48de1d62442 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Dog.md b/samples/client/petstore/java/restclient/docs/Dog.md new file mode 100644 index 00000000000..972c981c0d0 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/EnumArrays.md b/samples/client/petstore/java/restclient/docs/EnumArrays.md new file mode 100644 index 00000000000..b2222d5beb2 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/restclient/docs/EnumClass.md b/samples/client/petstore/java/restclient/docs/EnumClass.md new file mode 100644 index 00000000000..b314590a759 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/restclient/docs/EnumTest.md b/samples/client/petstore/java/restclient/docs/EnumTest.md new file mode 100644 index 00000000000..380a2aef0bc --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/restclient/docs/FakeApi.md b/samples/client/petstore/java/restclient/docs/FakeApi.md new file mode 100644 index 00000000000..37a949ea050 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FakeApi.md @@ -0,0 +1,1541 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testAdditionalPropertiesReference + +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + apiInstance.testAdditionalPropertiesReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + apiInstance.testBodyWithBinary(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testNullable + +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + apiInstance.testNullable(childWithNullable); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/restclient/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 00000000000..475be1d2d73 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/restclient/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..e4ff70ed909 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient/docs/FileSchemaTestClass.md b/samples/client/petstore/java/restclient/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..85d1a063669 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Foo.md b/samples/client/petstore/java/restclient/docs/Foo.md new file mode 100644 index 00000000000..6b3f0556528 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/restclient/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..ff3d7a3a56c --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/FormatTest.md b/samples/client/petstore/java/restclient/docs/FormatTest.md new file mode 100644 index 00000000000..01b8c777ae0 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/restclient/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..29da5205dbb --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/restclient/docs/HealthCheckResult.md b/samples/client/petstore/java/restclient/docs/HealthCheckResult.md new file mode 100644 index 00000000000..4885e6f1cad --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/MapTest.md b/samples/client/petstore/java/restclient/docs/MapTest.md new file mode 100644 index 00000000000..54380188e1d --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/restclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/restclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a5ddf0faa6a --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Model200Response.md b/samples/client/petstore/java/restclient/docs/Model200Response.md new file mode 100644 index 00000000000..109411580c6 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ModelApiResponse.md b/samples/client/petstore/java/restclient/docs/ModelApiResponse.md new file mode 100644 index 00000000000..e374c2dd2de --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ModelFile.md b/samples/client/petstore/java/restclient/docs/ModelFile.md new file mode 100644 index 00000000000..adcde984f52 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ModelList.md b/samples/client/petstore/java/restclient/docs/ModelList.md new file mode 100644 index 00000000000..f93ab7dde8d --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ModelReturn.md b/samples/client/petstore/java/restclient/docs/ModelReturn.md new file mode 100644 index 00000000000..0bd356861eb --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Name.md b/samples/client/petstore/java/restclient/docs/Name.md new file mode 100644 index 00000000000..c901d943530 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/restclient/docs/NullableClass.md b/samples/client/petstore/java/restclient/docs/NullableClass.md new file mode 100644 index 00000000000..fa98c5c6d98 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/NumberOnly.md b/samples/client/petstore/java/restclient/docs/NumberOnly.md new file mode 100644 index 00000000000..b8ed1a4cfae --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/restclient/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..f1cf571f4c0 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/Order.md b/samples/client/petstore/java/restclient/docs/Order.md new file mode 100644 index 00000000000..27af32855c5 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterComposite.md b/samples/client/petstore/java/restclient/docs/OuterComposite.md new file mode 100644 index 00000000000..98b56e0763f --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterEnum.md b/samples/client/petstore/java/restclient/docs/OuterEnum.md new file mode 100644 index 00000000000..1f9b723eb8e --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/restclient/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..cbc7f4ba54d --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterEnumInteger.md b/samples/client/petstore/java/restclient/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..f71dea30ad0 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/restclient/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..99e6389f427 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/restclient/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java/restclient/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..0fafaaa2715 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java/restclient/docs/ParentWithNullable.md b/samples/client/petstore/java/restclient/docs/ParentWithNullable.md new file mode 100644 index 00000000000..e4d32298563 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java/restclient/docs/Pet.md b/samples/client/petstore/java/restclient/docs/Pet.md new file mode 100644 index 00000000000..54af77a9f5a --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **Set<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java/restclient/docs/PetApi.md b/samples/client/petstore/java/restclient/docs/PetApi.md new file mode 100644 index 00000000000..e2515d9bb9b --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/PetApi.md @@ -0,0 +1,678 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Set tags = Arrays.asList(); // Set | Tags to filter by + try { + Set result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/restclient/docs/ReadOnlyFirst.md b/samples/client/petstore/java/restclient/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..ad6af7ee155 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/SingleRefType.md b/samples/client/petstore/java/restclient/docs/SingleRefType.md new file mode 100644 index 00000000000..cc269bb871f --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java/restclient/docs/SpecialModelName.md b/samples/client/petstore/java/restclient/docs/SpecialModelName.md new file mode 100644 index 00000000000..4b6a06e3622 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/StoreApi.md b/samples/client/petstore/java/restclient/docs/StoreApi.md new file mode 100644 index 00000000000..ce91137cc6f --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/StoreApi.md @@ -0,0 +1,282 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/restclient/docs/Tag.md b/samples/client/petstore/java/restclient/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/restclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 00000000000..dc066e6c7da --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/User.md b/samples/client/petstore/java/restclient/docs/User.md new file mode 100644 index 00000000000..08813e4b10b --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/User.md @@ -0,0 +1,20 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java/restclient/docs/UserApi.md b/samples/client/petstore/java/restclient/docs/UserApi.md new file mode 100644 index 00000000000..305fd6e66df --- /dev/null +++ b/samples/client/petstore/java/restclient/docs/UserApi.md @@ -0,0 +1,543 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/restclient/git_push.sh b/samples/client/petstore/java/restclient/git_push.sh new file mode 100755 index 00000000000..f53a75d4fab --- /dev/null +++ b/samples/client/petstore/java/restclient/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/java/restclient/gradle.properties b/samples/client/petstore/java/restclient/gradle.properties new file mode 100644 index 00000000000..a3408578278 --- /dev/null +++ b/samples/client/petstore/java/restclient/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..e6441136f3d Binary files /dev/null and b/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..b82aa23a4f0 --- /dev/null +++ b/samples/client/petstore/java/restclient/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/restclient/gradlew b/samples/client/petstore/java/restclient/gradlew new file mode 100755 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/client/petstore/java/restclient/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/restclient/gradlew.bat b/samples/client/petstore/java/restclient/gradlew.bat new file mode 100644 index 00000000000..25da30dbdee --- /dev/null +++ b/samples/client/petstore/java/restclient/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/restclient/pom.xml b/samples/client/petstore/java/restclient/pom.xml new file mode 100644 index 00000000000..e4d8e78336a --- /dev/null +++ b/samples/client/petstore/java/restclient/pom.xml @@ -0,0 +1,291 @@ + + 4.0.0 + org.openapitools + petstore-restclient + jar + petstore-restclient + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.0 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + true + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.5.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.springframework + spring-web + ${spring-web-version} + + + org.springframework + spring-context + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-version} + test + + + org.junit.platform + junit-platform-runner + ${junit-platform-runner.version} + test + + + + UTF-8 + 6.1.6 + 2.15.2 + 2.15.2 + 0.2.6 + 2.1.1 + 5.10.2 + 1.10.0 + + diff --git a/samples/client/petstore/java/restclient/settings.gradle b/samples/client/petstore/java/restclient/settings.gradle new file mode 100644 index 00000000000..fad96959c01 --- /dev/null +++ b/samples/client/petstore/java/restclient/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-restclient" \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/main/AndroidManifest.xml b/samples/client/petstore/java/restclient/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..54fbcb3da1e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..4b2f31199d4 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,727 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.util.function.Consumer; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.InvalidMediaTypeException; +import org.springframework.http.MediaType; + import org.springframework.http.converter.HttpMessageConverter; + import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.util.CollectionUtils; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestClientException; +import org.springframework.web.util.UriComponentsBuilder; +import org.springframework.web.client.RestClient; +import org.springframework.web.client.RestClient.ResponseSpec; +import java.util.Optional; + +import java.text.DateFormat; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TimeZone; + +import jakarta.annotation.Nullable; + +import java.time.OffsetDateTime; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.auth.OAuth; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiClient extends JavaTimeFormatter { + public enum CollectionFormat { + CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null); + + private final String separator; + CollectionFormat(String separator) { + this.separator = separator; + } + + private String collectionToString(Collection collection) { + return StringUtils.collectionToDelimitedString(collection, separator); + } + } + + private final HttpHeaders defaultHeaders = new HttpHeaders(); + private final MultiValueMap defaultCookies = new LinkedMultiValueMap<>(); + + private String basePath = "http://petstore.swagger.io:80/v2"; + + private final RestClient restClient; + private final DateFormat dateFormat; + private final ObjectMapper objectMapper; + + private Map authentications; + + + public ApiClient() { + this.dateFormat = createDefaultDateFormat(); + this.objectMapper = createDefaultObjectMapper(this.dateFormat); + this.restClient = buildRestClient(this.objectMapper); + this.init(); + } + + public ApiClient(RestClient restClient) { + this(Optional.ofNullable(restClient).orElseGet(ApiClient::buildRestClient), createDefaultDateFormat()); + } + + public ApiClient(ObjectMapper mapper, DateFormat format) { + this(buildRestClient(mapper.copy()), format); + } + + public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { + this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); + } + + private ApiClient(RestClient restClient, DateFormat format) { + this.restClient = restClient; + this.dateFormat = format; + this.objectMapper = createDefaultObjectMapper(format); + this.init(); + } + + public static DateFormat createDefaultDateFormat() { + DateFormat dateFormat = new RFC3339DateFormat(); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return dateFormat; + } + + public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) { + if (null == dateFormat) { + dateFormat = createDefaultDateFormat(); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.setDateFormat(dateFormat); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + return mapper; + } + + protected void init() { + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + authentications.put("petstore_auth", new OAuth()); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder(ObjectMapper mapper) { + Consumer>> messageConverters = converters -> { + converters.add(new MappingJackson2HttpMessageConverter(mapper)); + }; + + return RestClient.builder().messageConverters(messageConverters); + } + + /** + * Build the RestClientBuilder used to make RestClient. + * @return RestClient + */ + public static RestClient.Builder buildRestClientBuilder() { + return buildRestClientBuilder(createDefaultObjectMapper(null)); + } + + /** + * Build the RestClient used to make HTTP requests. + * @param mapper ObjectMapper used for serialize/deserialize + * @return RestClient + */ + public static RestClient buildRestClient(ObjectMapper mapper) { + return buildRestClientBuilder(mapper).build(); + } + + /** + * Build the RestClient used to make HTTP requests. + * @return RestClient + */ + public static RestClient buildRestClient() { + return buildRestClientBuilder(createDefaultObjectMapper(null)).build(); + } + + /** + * Get the current base path + * @return String the base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set the base path, which should include the host + * @param basePath the base path + * @return ApiClient this client + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map the currently configured authentication types + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username the username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password the password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix the API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken the access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent the user agent string + * @return ApiClient this client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param name The header's name + * @param value The header's value + * @return ApiClient this client + */ + public ApiClient addDefaultHeader(String name, String value) { + if (defaultHeaders.containsKey(name)) { + defaultHeaders.remove(name); + } + defaultHeaders.add(name, value); + return this; + } + + /** + * Add a default cookie. + * + * @param name The cookie's name + * @param value The cookie's value + * @return ApiClient this client + */ + public ApiClient addDefaultCookie(String name, String value) { + if (defaultCookies.containsKey(name)) { + defaultCookies.remove(name); + } + defaultCookies.add(name, value); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return DateFormat format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Parse the given string into Date object. + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Get the ObjectMapper used to make HTTP requests. + * @return ObjectMapper objectMapper + */ + public ObjectMapper getObjectMapper() { + return objectMapper; + } + + /** + * Get the RestClient used to make HTTP requests. + * @return RestClient restClient + */ + public RestClient getRestClient() { + return restClient; + } + + /** + * Format the given parameter object into string. + * @param param the object to convert + * @return String the parameter represented as a String + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate( (Date) param); + } else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection) param) { + if(b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Converts a parameter to a {@link MultiValueMap} for use in REST requests + * @param collectionFormat The format to convert to + * @param name The name of the parameter + * @param value The parameter's value + * @return a Map containing the String value(s) of the input parameter + */ + public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) { + final MultiValueMap params = new LinkedMultiValueMap<>(); + + if (name == null || name.isEmpty() || value == null) { + return params; + } + + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + if (value instanceof Map) { + @SuppressWarnings("unchecked") + final Map valuesMap = (Map) value; + for (final Entry entry : valuesMap.entrySet()) { + params.add(entry.getKey(), parameterToString(entry.getValue())); + } + return params; + } + + Collection valueCollection = null; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(name, parameterToString(value)); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + if (collectionFormat.equals(CollectionFormat.MULTI)) { + for (Object item : valueCollection) { + params.add(name, parameterToString(item)); + } + return params; + } + + List values = new ArrayList<>(); + for(Object o : valueCollection) { + values.add(parameterToString(o)); + } + params.add(name, collectionFormat.collectionToString(values)); + + return params; + } + + /** + * Check if the given {@code String} is a JSON MIME. + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(String mediaType) { + // "* / *" is default to JSON + if ("*/*".equals(mediaType)) { + return true; + } + + try { + return isJsonMime(MediaType.parseMediaType(mediaType)); + } catch (InvalidMediaTypeException e) { + } + return false; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents JSON, false otherwise + */ + public boolean isJsonMime(MediaType mediaType) { + return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$")); + } + + /** + * Check if the given {@code String} is a Problem JSON MIME (RFC-7807). + * @param mediaType the input MediaType + * @return boolean true if the MediaType represents Problem JSON, false otherwise + */ + public boolean isProblemJsonMime(String mediaType) { + return "application/problem+json".equalsIgnoreCase(mediaType); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return List The list of MediaTypes to use for the Accept header + */ + public List selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + MediaType mediaType = MediaType.parseMediaType(accept); + if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) { + return Collections.singletonList(mediaType); + } + } + return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts)); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return MediaType The Content-Type header to use. If the given array is empty, null will be returned. + */ + public MediaType selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + for (String contentType : contentTypes) { + MediaType mediaType = MediaType.parseMediaType(contentType); + if (isJsonMime(mediaType)) { + return mediaType; + } + } + return MediaType.parseMediaType(contentTypes[0]); + } + + /** + * Select the body to use for the request + * + * @param obj the body object + * @param formParams the form parameters + * @param contentType the content type of the request + * @return Object the selected body + */ + protected Object selectBody(Object obj, MultiValueMap formParams, MediaType contentType) { + boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType); + return isForm ? formParams : obj; + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param the return type to use + * @param path The sub-path of the HTTP URL + * @param method The request method + * @param pathParams The path parameters + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @return The response body in chosen type + */ + public ResponseSpec invokeAPI(String path, HttpMethod method, Map pathParams, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap cookieParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException { + final RestClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames); + return requestBuilder.retrieve(); + } + + /** + * Include queryParams in uriParams taking into account the paramName + * @param queryParams The query parameters + * @param uriParams The path parameters + * return templatized query string + */ + private String generateQueryUri(MultiValueMap queryParams, Map uriParams) { + StringBuilder queryBuilder = new StringBuilder(); + queryParams.forEach((name, values) -> { + if (CollectionUtils.isEmpty(values)) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + } else { + int valueItemCounter = 0; + for (Object value : values) { + if (queryBuilder.length() != 0) { + queryBuilder.append('&'); + } + queryBuilder.append(name); + if (value != null) { + String templatizedKey = name + valueItemCounter++; + uriParams.put(templatizedKey, value.toString()); + queryBuilder.append('=').append("{").append(templatizedKey).append("}"); + } + } + } + }); + return queryBuilder.toString(); + } + + private RestClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map pathParams, + MultiValueMap queryParams, Object body, HttpHeaders headerParams, + MultiValueMap cookieParams, MultiValueMap formParams, List accept, + MediaType contentType, String[] authNames) { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path); + + String finalUri = builder.build(false).toUriString(); + Map uriParams = new HashMap<>(); + uriParams.putAll(pathParams); + + if (queryParams != null && !queryParams.isEmpty()) { + //Include queryParams in uriParams taking into account the paramName + String queryUri = generateQueryUri(queryParams, uriParams); + //Append to finalUri the templatized query string like "?param1={param1Value}&....... + finalUri += "?" + queryUri; + } + + final RestClient.RequestBodySpec requestBuilder = restClient.method(method).uri(finalUri, uriParams); + + if (accept != null) { + requestBuilder.accept(accept.toArray(new MediaType[accept.size()])); + } + if(contentType != null) { + requestBuilder.contentType(contentType); + } + + addHeadersToRequest(headerParams, requestBuilder); + addHeadersToRequest(defaultHeaders, requestBuilder); + addCookiesToRequest(cookieParams, requestBuilder); + addCookiesToRequest(defaultCookies, requestBuilder); + + var selectedBody = selectBody(body, formParams, contentType); + if (selectedBody != null) { + requestBuilder.body(selectedBody); + } + + return requestBuilder; + } + + /** + * Add headers to the request that is being built + * @param headers The headers to add + * @param requestBuilder The current request + */ + protected void addHeadersToRequest(HttpHeaders headers, RestClient.RequestBodySpec requestBuilder) { + for (Entry> entry : headers.entrySet()) { + List values = entry.getValue(); + for(String value : values) { + if (value != null) { + requestBuilder.header(entry.getKey(), value); + } + } + } + } + + /** + * Add cookies to the request that is being built + * + * @param cookies The cookies to add + * @param requestBuilder The current request + */ + protected void addCookiesToRequest(MultiValueMap cookies, RestClient.RequestBodySpec requestBuilder) { + if (!cookies.isEmpty()) { + requestBuilder.header("Cookie", buildCookieHeader(cookies)); + } + } + + /** + * Build cookie header. Keeps a single value per cookie (as per + * RFC6265 section 5.3). + * + * @param cookies map all cookies + * @return header string for cookies. + */ + private String buildCookieHeader(MultiValueMap cookies) { + final StringBuilder cookieValue = new StringBuilder(); + String delimiter = ""; + for (final Map.Entry> entry : cookies.entrySet()) { + final String value = entry.getValue().get(entry.getValue().size() - 1); + cookieValue.append(String.format("%s%s=%s", delimiter, entry.getKey(), value)); + delimiter = "; "; + } + return cookieValue.toString(); + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams The query parameters + * @param headerParams The header parameters + * @param cookieParams the cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RestClientException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param values The values of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection values) { + // create the value based on the collection format + if (CollectionFormat.MULTI.equals(collectionFormat)) { + // not valid for path params + return parameterToString(values); + } + + // collectionFormat is assumed to be "csv" by default + if(collectionFormat == null) { + collectionFormat = CollectionFormat.CSV; + } + + return collectionFormat.collectionToString(values); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..c2cf2dd89e9 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..2c5dc6747d6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 00000000000..4c47f2b1971 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,59 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 00000000000..60a0eed94d5 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,24 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 00000000000..9f6ac0cf9fa --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Collection; +import java.util.Iterator; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

    + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..71be118d959 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,121 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(new ApiClient()); + } + + @Autowired + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec call123testSpecialTagsRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling call123testSpecialTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client call123testSpecialTags(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return call123testSpecialTagsRequestCreation(client).body(localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity call123testSpecialTagsWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return call123testSpecialTagsRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec call123testSpecialTagsWithResponseSpec(Client client) throws RestClientResponseException { + return call123testSpecialTagsRequestCreation(client); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..05a81cee2bd --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,111 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(new ApiClient()); + } + + @Autowired + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * + *

    0 - response + * @return FooGetDefaultResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fooGetRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/foo", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return FooGetDefaultResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public FooGetDefaultResponse fooGet() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fooGetRequestCreation().body(localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return ResponseEntity<FooGetDefaultResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fooGetWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fooGetRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * + *

    0 - response + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fooGetWithResponseSpec() throws RestClientResponseException { + return fooGetRequestCreation(); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 00000000000..843691058f4 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,1850 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(new ApiClient()); + } + + @Autowired + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return FakeBigDecimalMap200Response + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeBigDecimalMapRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/BigDecimalMap", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return FakeBigDecimalMap200Response + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public FakeBigDecimalMap200Response fakeBigDecimalMap() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeBigDecimalMapRequestCreation().body(localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return ResponseEntity<FakeBigDecimalMap200Response> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeBigDecimalMapWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeBigDecimalMapRequestCreation().toEntity(localVarReturnType); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + *

    200 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeBigDecimalMapWithResponseSpec() throws RestClientResponseException { + return fakeBigDecimalMapRequestCreation(); + } + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return HealthCheckResult + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeHealthGetRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/health", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return HealthCheckResult + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public HealthCheckResult fakeHealthGet() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHealthGetRequestCreation().body(localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return ResponseEntity<HealthCheckResult> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeHealthGetWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHealthGetRequestCreation().toEntity(localVarReturnType); + } + + /** + * Health check endpoint + * + *

    200 - The instance started successfully + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHealthGetWithResponseSpec() throws RestClientResponseException { + return fakeHealthGetRequestCreation(); + } + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeHttpSignatureTestRequestCreation(Pet pet, String query1, String header1) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling fakeHttpSignatureTest", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query_1", query1)); + + + if (header1 != null) + headerParams.add("header_1", apiClient.parameterToString(header1)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_signature_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/http-signature-test", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void fakeHttpSignatureTest(Pet pet, String query1, String header1) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + fakeHttpSignatureTestRequestCreation(pet, query1, header1).body(localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeHttpSignatureTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); + } + + /** + * test http signature authentication + * + *

    200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHttpSignatureTestWithResponseSpec(Pet pet, String query1, String header1) throws RestClientResponseException { + return fakeHttpSignatureTestRequestCreation(pet, query1, header1); + } + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return Boolean + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterBooleanSerializeRequestCreation(Boolean body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return Boolean + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterBooleanSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return ResponseEntity<Boolean> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterBooleanSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer boolean types + *

    200 - Output boolean + * @param body Input boolean as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterBooleanSerializeWithResponseSpec(Boolean body) throws RestClientResponseException { + return fakeOuterBooleanSerializeRequestCreation(body); + } + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return OuterComposite + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterCompositeSerializeRequestCreation(OuterComposite outerComposite) throws RestClientResponseException { + Object postBody = outerComposite; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return OuterComposite + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterCompositeSerializeRequestCreation(outerComposite).body(localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseEntity<OuterComposite> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterCompositeSerializeRequestCreation(outerComposite).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of object with outer number type + *

    200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterCompositeSerializeWithResponseSpec(OuterComposite outerComposite) throws RestClientResponseException { + return fakeOuterCompositeSerializeRequestCreation(outerComposite); + } + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return BigDecimal + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterNumberSerializeRequestCreation(BigDecimal body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return BigDecimal + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterNumberSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return ResponseEntity<BigDecimal> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterNumberSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer number types + *

    200 - Output number + * @param body Input number as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterNumberSerializeWithResponseSpec(BigDecimal body) throws RestClientResponseException { + return fakeOuterNumberSerializeRequestCreation(body); + } + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakeOuterStringSerializeRequestCreation(String body) throws RestClientResponseException { + Object postBody = body; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String fakeOuterStringSerialize(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterStringSerializeRequestCreation(body).body(localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakeOuterStringSerializeRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of outer string types + *

    200 - Output string + * @param body Input string as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterStringSerializeWithResponseSpec(String body) throws RestClientResponseException { + return fakeOuterStringSerializeRequestCreation(body); + } + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return OuterObjectWithEnumProperty + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec fakePropertyEnumIntegerSerializeRequestCreation(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + Object postBody = outerObjectWithEnumProperty; + // verify the required parameter 'outerObjectWithEnumProperty' is set + if (outerObjectWithEnumProperty == null) { + throw new RestClientResponseException("Missing the required parameter 'outerObjectWithEnumProperty' when calling fakePropertyEnumIntegerSerialize", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "*/*" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/property/enum-int", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return OuterObjectWithEnumProperty + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).body(localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseEntity<OuterObjectWithEnumProperty> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity fakePropertyEnumIntegerSerializeWithHttpInfo(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).toEntity(localVarReturnType); + } + + /** + * + * Test serialization of enum (int) properties with examples + *

    200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws RestClientResponseException { + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty); + } + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testAdditionalPropertiesReferenceRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/additionalProperties-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testAdditionalPropertiesReference(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testAdditionalPropertiesReferenceRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testAdditionalPropertiesReferenceWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testAdditionalPropertiesReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testAdditionalPropertiesReferenceWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testAdditionalPropertiesReferenceRequestCreation(requestBody); + } + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithBinaryRequestCreation(File body) throws RestClientResponseException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new RestClientResponseException("Missing the required parameter 'body' when calling testBodyWithBinary", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "image/png" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-binary", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithBinary(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithBinaryRequestCreation(body).body(localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithBinaryWithHttpInfo(File body) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithBinaryRequestCreation(body).toEntity(localVarReturnType); + } + + /** + * + * For this test, the body has to be a binary file. + *

    200 - Success + * @param body image to upload + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithBinaryWithResponseSpec(File body) throws RestClientResponseException { + return testBodyWithBinaryRequestCreation(body); + } + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithFileSchemaRequestCreation(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + Object postBody = fileSchemaTestClass; + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new RestClientResponseException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).body(localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).toEntity(localVarReturnType); + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

    200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithFileSchemaWithResponseSpec(FileSchemaTestClass fileSchemaTestClass) throws RestClientResponseException { + return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass); + } + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testBodyWithQueryParamsRequestCreation(String query, User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'query' is set + if (query == null) { + throw new RestClientResponseException("Missing the required parameter 'query' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testBodyWithQueryParams(String query, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testBodyWithQueryParamsRequestCreation(query, user).body(localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testBodyWithQueryParamsWithHttpInfo(String query, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testBodyWithQueryParamsRequestCreation(query, user).toEntity(localVarReturnType); + } + + /** + * + * + *

    200 - Success + * @param query The query parameter + * @param user The user parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithQueryParamsWithResponseSpec(String query, User user) throws RestClientResponseException { + return testBodyWithQueryParamsRequestCreation(query, user); + } + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testClientModelRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling testClientModel", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client testClientModel(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClientModelRequestCreation(client).body(localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testClientModelWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClientModelRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test \"client\" model + * To test \"client\" model + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClientModelWithResponseSpec(Client client) throws RestClientResponseException { + return testClientModelRequestCreation(client); + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEndpointParametersRequestCreation(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'number' is set + if (number == null) { + throw new RestClientResponseException("Missing the required parameter 'number' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter '_double' is set + if (_double == null) { + throw new RestClientResponseException("Missing the required parameter '_double' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new RestClientResponseException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new RestClientResponseException("Missing the required parameter '_byte' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (integer != null) + formParams.add("integer", integer); + if (int32 != null) + formParams.add("int32", int32); + if (int64 != null) + formParams.add("int64", int64); + if (number != null) + formParams.add("number", number); + if (_float != null) + formParams.add("float", _float); + if (_double != null) + formParams.add("double", _double); + if (string != null) + formParams.add("string", string); + if (patternWithoutDelimiter != null) + formParams.add("pattern_without_delimiter", patternWithoutDelimiter); + if (_byte != null) + formParams.add("byte", _byte); + if (binary != null) + formParams.add("binary", new FileSystemResource(binary)); + if (date != null) + formParams.add("date", date); + if (dateTime != null) + formParams.add("dateTime", dateTime); + if (password != null) + formParams.add("password", password); + if (paramCallback != null) + formParams.add("callback", paramCallback); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_basic_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).body(localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).toEntity(localVarReturnType); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

    400 - Invalid username supplied + *

    404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEndpointParametersWithResponseSpec(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientResponseException { + return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testEnumParametersRequestCreation(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "enum_query_string_array", enumQueryStringArray)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "enum_query_model_array", enumQueryModelArray)); + + + if (enumHeaderStringArray != null) + headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); + if (enumHeaderString != null) + headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); + if (enumFormStringArray != null) + formParams.addAll("enum_form_string_array", enumFormStringArray); + if (enumFormString != null) + formParams.add("enum_form_string", enumFormString); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).body(localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).toEntity(localVarReturnType); + } + + /** + * To test enum parameters + * To test enum parameters + *

    400 - Invalid request + *

    404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEnumParametersWithResponseSpec(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws RestClientResponseException { + return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testGroupParametersRequestCreation(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_string_group", requiredStringGroup)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "required_int64_group", requiredInt64Group)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "string_group", stringGroup)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "int64_group", int64Group)); + + + if (requiredBooleanGroup != null) + headerParams.add("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) + headerParams.add("boolean_group", apiClient.parameterToString(booleanGroup)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "bearer_test" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).body(localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).toEntity(localVarReturnType); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

    400 - Something wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testGroupParametersWithResponseSpec(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientResponseException { + return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineAdditionalPropertiesRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testInlineAdditionalProperties(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testInlineAdditionalPropertiesRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testInlineAdditionalPropertiesRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test inline additionalProperties + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testInlineAdditionalPropertiesRequestCreation(requestBody); + } + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testInlineFreeformAdditionalPropertiesRequestCreation(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + Object postBody = testInlineFreeformAdditionalPropertiesRequest; + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new RestClientResponseException("Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/inline-freeform-additionalProperties", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).body(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testInlineFreeformAdditionalPropertiesWithHttpInfo(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest).toEntity(localVarReturnType); + } + + /** + * test inline free-form additionalProperties + * + *

    200 - successful operation + * @param testInlineFreeformAdditionalPropertiesRequest request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineFreeformAdditionalPropertiesWithResponseSpec(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws RestClientResponseException { + return testInlineFreeformAdditionalPropertiesRequestCreation(testInlineFreeformAdditionalPropertiesRequest); + } + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testJsonFormDataRequestCreation(String param, String param2) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'param' is set + if (param == null) { + throw new RestClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new RestClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (param != null) + formParams.add("param", param); + if (param2 != null) + formParams.add("param2", param2); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testJsonFormData(String param, String param2) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testJsonFormDataRequestCreation(param, param2).body(localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testJsonFormDataWithHttpInfo(String param, String param2) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testJsonFormDataRequestCreation(param, param2).toEntity(localVarReturnType); + } + + /** + * test json serialization of form data + * + *

    200 - successful operation + * @param param field1 + * @param param2 field2 + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testJsonFormDataWithResponseSpec(String param, String param2) throws RestClientResponseException { + return testJsonFormDataRequestCreation(param, param2); + } + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testNullableRequestCreation(ChildWithNullable childWithNullable) throws RestClientResponseException { + Object postBody = childWithNullable; + // verify the required parameter 'childWithNullable' is set + if (childWithNullable == null) { + throw new RestClientResponseException("Missing the required parameter 'childWithNullable' when calling testNullable", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/nullable", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testNullable(ChildWithNullable childWithNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testNullableRequestCreation(childWithNullable).body(localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testNullableWithHttpInfo(ChildWithNullable childWithNullable) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testNullableRequestCreation(childWithNullable).toEntity(localVarReturnType); + } + + /** + * test nullable parent property + * + *

    200 - successful operation + * @param childWithNullable request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testNullableWithResponseSpec(ChildWithNullable childWithNullable) throws RestClientResponseException { + return testNullableRequestCreation(childWithNullable); + } + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new RestClientResponseException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new RestClientResponseException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new RestClientResponseException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new RestClientResponseException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new RestClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) { + throw new RestClientResponseException("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("pipes".toUpperCase(Locale.ROOT)), "pipe", pipe)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "language", language)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "allowEmpty", allowEmpty)); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/test-query-parameters", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).body(localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).toEntity(localVarReturnType); + } + + /** + * + * To test the collection format in query parameters + *

    200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws RestClientResponseException { + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); + } + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testStringMapReferenceRequestCreation(Map requestBody) throws RestClientResponseException { + Object postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new RestClientResponseException("Missing the required parameter 'requestBody' when calling testStringMapReference", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/stringMap-reference", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void testStringMapReference(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + testStringMapReferenceRequestCreation(requestBody).body(localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testStringMapReferenceWithHttpInfo(Map requestBody) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testStringMapReferenceRequestCreation(requestBody).toEntity(localVarReturnType); + } + + /** + * test referenced string map + * + *

    200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testStringMapReferenceWithResponseSpec(Map requestBody) throws RestClientResponseException { + return testStringMapReferenceRequestCreation(requestBody); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..832d9885ded --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,121 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeClassnameTags123Api { + private ApiClient apiClient; + + public FakeClassnameTags123Api() { + this(new ApiClient()); + } + + @Autowired + public FakeClassnameTags123Api(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec testClassnameRequestCreation(Client client) throws RestClientResponseException { + Object postBody = client; + // verify the required parameter 'client' is set + if (client == null) { + throw new RestClientResponseException("Missing the required parameter 'client' when calling testClassname", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key_query" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return Client + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Client testClassname(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClassnameRequestCreation(client).body(localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity testClassnameWithHttpInfo(Client client) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return testClassnameRequestCreation(client).toEntity(localVarReturnType); + } + + /** + * To test class name in snake case + * To test class name in snake case + *

    200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClassnameWithResponseSpec(Client client) throws RestClientResponseException { + return testClassnameRequestCreation(client); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..a493a432a94 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,794 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class PetApi { + private ApiClient apiClient; + + public PetApi() { + this(new ApiClient()); + } + + @Autowired + public PetApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec addPetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling addPet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void addPet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + addPetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity addPetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return addPetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Add a new pet to the store + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addPetWithResponseSpec(Pet pet) throws RestClientResponseException { + return addPetRequestCreation(pet); + } + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deletePetRequestCreation(Long petId, String apiKey) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling deletePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + + if (apiKey != null) + headerParams.add("api_key", apiClient.parameterToString(apiKey)); + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deletePet(Long petId, String apiKey) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deletePetRequestCreation(petId, apiKey).body(localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deletePetRequestCreation(petId, apiKey).toEntity(localVarReturnType); + } + + /** + * Deletes a pet + * + *

    200 - Successful operation + *

    400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws RestClientResponseException { + return deletePetRequestCreation(petId, apiKey); + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return List<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec findPetsByStatusRequestCreation(List status) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'status' is set + if (status == null) { + throw new RestClientResponseException("Missing the required parameter 'status' when calling findPetsByStatus", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return List<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public List findPetsByStatus(List status) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByStatusRequestCreation(status).body(localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseEntity<List<Pet>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByStatusRequestCreation(status).toEntity(localVarReturnType); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

    200 - successful operation + *

    400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByStatusWithResponseSpec(List status) throws RestClientResponseException { + return findPetsByStatusRequestCreation(status); + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return Set<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + * @deprecated + */ + @Deprecated + private ResponseSpec findPetsByTagsRequestCreation(Set tags) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'tags' is set + if (tags == null) { + throw new RestClientResponseException("Missing the required parameter 'tags' when calling findPetsByTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return Set<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Set findPetsByTags(Set tags) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByTagsRequestCreation(tags).body(localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseEntity<Set<Pet>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return findPetsByTagsRequestCreation(tags).toEntity(localVarReturnType); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

    200 - successful operation + *

    400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByTagsWithResponseSpec(Set tags) throws RestClientResponseException { + return findPetsByTagsRequestCreation(tags); + } + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getPetByIdRequestCreation(Long petId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling getPetById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return Pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Pet getPetById(Long petId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getPetByIdRequestCreation(petId).body(localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return ResponseEntity<Pet> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getPetByIdRequestCreation(petId).toEntity(localVarReturnType); + } + + /** + * Find pet by ID + * Returns a single pet + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + * @param petId ID of pet to return + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getPetByIdWithResponseSpec(Long petId) throws RestClientResponseException { + return getPetByIdRequestCreation(petId); + } + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updatePetRequestCreation(Pet pet) throws RestClientResponseException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new RestClientResponseException("Missing the required parameter 'pet' when calling updatePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updatePet(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updatePetRequestCreation(pet).body(localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updatePetWithHttpInfo(Pet pet) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updatePetRequestCreation(pet).toEntity(localVarReturnType); + } + + /** + * Update an existing pet + * + *

    200 - Successful operation + *

    400 - Invalid ID supplied + *

    404 - Pet not found + *

    405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithResponseSpec(Pet pet) throws RestClientResponseException { + return updatePetRequestCreation(pet); + } + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updatePetWithFormRequestCreation(Long petId, String name, String status) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling updatePetWithForm", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (name != null) + formParams.add("name", name); + if (status != null) + formParams.add("status", status); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updatePetWithForm(Long petId, String name, String status) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updatePetWithFormRequestCreation(petId, name, status).body(localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updatePetWithFormRequestCreation(petId, name, status).toEntity(localVarReturnType); + } + + /** + * Updates a pet in the store with form data + * + *

    200 - Successful operation + *

    405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithFormWithResponseSpec(Long petId, String name, String status) throws RestClientResponseException { + return updatePetWithFormRequestCreation(petId, name, status); + } + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadFileRequestCreation(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling uploadFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (additionalMetadata != null) + formParams.add("additionalMetadata", additionalMetadata); + if (_file != null) + formParams.add("file", new FileSystemResource(_file)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileRequestCreation(petId, additionalMetadata, _file).body(localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseEntity<ModelApiResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileRequestCreation(petId, additionalMetadata, _file).toEntity(localVarReturnType); + } + + /** + * uploads an image + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithResponseSpec(Long petId, String additionalMetadata, File _file) throws RestClientResponseException { + return uploadFileRequestCreation(petId, additionalMetadata, _file); + } + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec uploadFileWithRequiredFileRequestCreation(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'petId' is set + if (petId == null) { + throw new RestClientResponseException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new RestClientResponseException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("petId", petId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + if (additionalMetadata != null) + formParams.add("additionalMetadata", additionalMetadata); + if (requiredFile != null) + formParams.add("requiredFile", new FileSystemResource(requiredFile)); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ModelApiResponse + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).body(localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseEntity<ModelApiResponse> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).toEntity(localVarReturnType); + } + + /** + * uploads an image (required) + * + *

    200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithRequiredFileWithResponseSpec(Long petId, File requiredFile, String additionalMetadata) throws RestClientResponseException { + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..7213813aea4 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,344 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Order; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StoreApi { + private ApiClient apiClient; + + public StoreApi() { + this(new ApiClient()); + } + + @Autowired + public StoreApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteOrderRequestCreation(String orderId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new RestClientResponseException("Missing the required parameter 'orderId' when calling deleteOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("order_id", orderId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deleteOrder(String orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deleteOrderRequestCreation(orderId).body(localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deleteOrderWithHttpInfo(String orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deleteOrderRequestCreation(orderId).toEntity(localVarReturnType); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteOrderWithResponseSpec(String orderId) throws RestClientResponseException { + return deleteOrderRequestCreation(orderId); + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return Map<String, Integer> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getInventoryRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return Map<String, Integer> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Map getInventory() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return getInventoryRequestCreation().body(localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return ResponseEntity<Map<String, Integer>> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity> getInventoryWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference<>() {}; + return getInventoryRequestCreation().toEntity(localVarReturnType); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

    200 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getInventoryWithResponseSpec() throws RestClientResponseException { + return getInventoryRequestCreation(); + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getOrderByIdRequestCreation(Long orderId) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new RestClientResponseException("Missing the required parameter 'orderId' when calling getOrderById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("order_id", orderId); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Order getOrderById(Long orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getOrderByIdRequestCreation(orderId).body(localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseEntity<Order> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getOrderByIdWithHttpInfo(Long orderId) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getOrderByIdRequestCreation(orderId).toEntity(localVarReturnType); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

    200 - successful operation + *

    400 - Invalid ID supplied + *

    404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getOrderByIdWithResponseSpec(Long orderId) throws RestClientResponseException { + return getOrderByIdRequestCreation(orderId); + } + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec placeOrderRequestCreation(Order order) throws RestClientResponseException { + Object postBody = order; + // verify the required parameter 'order' is set + if (order == null) { + throw new RestClientResponseException("Missing the required parameter 'order' when calling placeOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/store/order", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return Order + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public Order placeOrder(Order order) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return placeOrderRequestCreation(order).body(localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseEntity<Order> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity placeOrderWithHttpInfo(Order order) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return placeOrderRequestCreation(order).toEntity(localVarReturnType); + } + + /** + * Place an order for a pet + * + *

    200 - successful operation + *

    400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec placeOrderWithResponseSpec(Order order) throws RestClientResponseException { + return placeOrderRequestCreation(order); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..1bec78f9a04 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,639 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiClient; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.client.RestClient.ResponseSpec; +import org.springframework.web.client.RestClientResponseException; +import org.springframework.core.io.FileSystemResource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class UserApi { + private ApiClient apiClient; + + public UserApi() { + this(new ApiClient()); + } + + @Autowired + public UserApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUserRequestCreation(User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUser(User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUserRequestCreation(user).body(localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUserWithHttpInfo(User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUserRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Create user + * This can only be done by the logged in user. + *

    0 - successful operation + * @param user Created user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserWithResponseSpec(User user) throws RestClientResponseException { + return createUserRequestCreation(user); + } + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUsersWithArrayInputRequestCreation(List user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUsersWithArrayInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUsersWithArrayInput(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUsersWithArrayInputRequestCreation(user).body(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUsersWithArrayInputWithHttpInfo(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUsersWithArrayInputRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithArrayInputWithResponseSpec(List user) throws RestClientResponseException { + return createUsersWithArrayInputRequestCreation(user); + } + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec createUsersWithListInputRequestCreation(List user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling createUsersWithListInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void createUsersWithListInput(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + createUsersWithListInputRequestCreation(user).body(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity createUsersWithListInputWithHttpInfo(List user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return createUsersWithListInputRequestCreation(user).toEntity(localVarReturnType); + } + + /** + * Creates list of users with given input array + * + *

    0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithListInputWithResponseSpec(List user) throws RestClientResponseException { + return createUsersWithListInputRequestCreation(user); + } + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec deleteUserRequestCreation(String username) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void deleteUser(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + deleteUserRequestCreation(username).body(localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity deleteUserWithHttpInfo(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return deleteUserRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Delete user + * This can only be done by the logged in user. + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be deleted + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserWithResponseSpec(String username) throws RestClientResponseException { + return deleteUserRequestCreation(username); + } + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec getUserByNameRequestCreation(String username) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling getUserByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public User getUserByName(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getUserByNameRequestCreation(username).body(localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseEntity<User> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity getUserByNameWithHttpInfo(String username) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return getUserByNameRequestCreation(username).toEntity(localVarReturnType); + } + + /** + * Get user by user name + * + *

    200 - successful operation + *

    400 - Invalid username supplied + *

    404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserByNameWithResponseSpec(String username) throws RestClientResponseException { + return getUserByNameRequestCreation(username); + } + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec loginUserRequestCreation(String username, String password) throws RestClientResponseException { + Object postBody = null; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'password' is set + if (password == null) { + throw new RestClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password)); + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return String + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public String loginUser(String username, String password) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return loginUserRequestCreation(username, password).body(localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseEntity<String> + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity loginUserWithHttpInfo(String username, String password) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return loginUserRequestCreation(username, password).toEntity(localVarReturnType); + } + + /** + * Logs user into the system + * + *

    200 - successful operation + *

    400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec loginUserWithResponseSpec(String username, String password) throws RestClientResponseException { + return loginUserRequestCreation(username, password); + } + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec logoutUserRequestCreation() throws RestClientResponseException { + Object postBody = null; + // create path and map variables + final Map pathParams = new HashMap<>(); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void logoutUser() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + logoutUserRequestCreation().body(localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity logoutUserWithHttpInfo() throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return logoutUserRequestCreation().toEntity(localVarReturnType); + } + + /** + * Logs out current logged in user session + * + *

    0 - successful operation + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec logoutUserWithResponseSpec() throws RestClientResponseException { + return logoutUserRequestCreation(); + } + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + private ResponseSpec updateUserRequestCreation(String username, User user) throws RestClientResponseException { + Object postBody = user; + // verify the required parameter 'username' is set + if (username == null) { + throw new RestClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new RestClientResponseException("Missing the required parameter 'user' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } + // create path and map variables + final Map pathParams = new HashMap<>(); + + pathParams.put("username", username); + + final MultiValueMap queryParams = new LinkedMultiValueMap<>(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap cookieParams = new LinkedMultiValueMap<>(); + final MultiValueMap formParams = new LinkedMultiValueMap<>(); + + final String[] localVarAccepts = { }; + final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = { + "application/json" + }; + final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public void updateUser(String username, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + updateUserRequestCreation(username, user).body(localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseEntity updateUserWithHttpInfo(String username, User user) throws RestClientResponseException { + ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {}; + return updateUserRequestCreation(username, user).toEntity(localVarReturnType); + } + + /** + * Updated user + * This can only be done by the logged in user. + *

    400 - Invalid user supplied + *

    404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @return ResponseSpec + * @throws RestClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserWithResponseSpec(String username, User user) throws RestClientResponseException { + return updateUserRequestCreation(username, user); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 00000000000..f2597a71272 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,62 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if (location.equals("query")) { + queryParams.add(paramName, value); + } else if (location.equals("header")) { + headerParams.add(paramName, value); + } else if (location.equals("cookie")) { + cookieParams.add(paramName, value); + } + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 00000000000..4f9a14ebd7c --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,14 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +public interface Authentication { + /** + * Apply authentication settings to header and / or query parameters. + * @param queryParams The query parameters for the request + * @param headerParams The header parameters for the request + * @param cookieParams The cookie parameters for the request + */ + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams); +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 00000000000..f0afdd6841c --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,38 @@ +package org.openapitools.client.auth; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 00000000000..75b318e2922 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,56 @@ +package org.openapitools.client.auth; + +import java.util.Optional; +import java.util.function.Supplier; +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 00000000000..9ab517eee4f --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,24 @@ +package org.openapitools.client.auth; + +import org.springframework.http.HttpHeaders; +import org.springframework.util.MultiValueMap; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + if (accessToken != null) { + headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken); + } + } +} diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 00000000000..909e57b2462 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,5 @@ +package org.openapitools.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..0a43fa2d40e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,152 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AdditionalPropertiesClass + */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AdditionalPropertiesClass { + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + private Map mapProperty; + + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + private Map> mapOfMapProperty; + + public AdditionalPropertiesClass() { + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapProperty() { + return mapProperty; + } + + + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..245502c27cb --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,135 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * AllOfWithSingleRef + */ +@JsonPropertyOrder({ + AllOfWithSingleRef.JSON_PROPERTY_USERNAME, + AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AllOfWithSingleRef { + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType"; + private SingleRefType singleRefType; + + public AllOfWithSingleRef() { + } + + public AllOfWithSingleRef username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + + this.singleRefType = singleRefType; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SingleRefType getSingleRefType() { + return singleRefType; + } + + + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 00000000000..0ee7ca10136 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Animal + */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), +}) + +public class Animal { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + protected String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + protected String color = "red"; + + public Animal() { + } + + public Animal className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + public Animal color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..acce678d27d --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,115 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayOfArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber; + + public ArrayOfArrayOfNumberOnly() { + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..7d58942a9d5 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,115 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber; + + public ArrayOfNumberOnly() { + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayNumber() { + return arrayNumber; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 00000000000..1d99c254d99 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,193 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ArrayTest + */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayTest { + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel; + + public ArrayTest() { + } + + public ArrayTest arrayOfString(List arrayOfString) { + + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayOfString() { + return arrayOfString; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 00000000000..7ff0d8d1c68 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,258 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Capitalization + */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Capitalization { + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; + + public Capitalization() { + } + + public Capitalization smallCamel(String smallCamel) { + + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallCamel() { + return smallCamel; + } + + + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalCamel() { + return capitalCamel; + } + + + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization smallSnake(String smallSnake) { + + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallSnake() { + return smallSnake; + } + + + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalSnake() { + return capitalSnake; + } + + + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getATTNAME() { + return ATT_NAME; + } + + + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..275ac0a572a --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,128 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Cat + */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Cat extends Animal { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + public Cat() { + + } + + public Cat declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + @Override + public Cat className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(String color) { + this.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..9937475f745 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; + + public Category() { + } + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 00000000000..deec65f5ecc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ChildWithNullable + */ +@JsonPropertyOrder({ + ChildWithNullable.JSON_PROPERTY_OTHER_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class ChildWithNullable extends ParentWithNullable { + public static final String JSON_PROPERTY_OTHER_PROPERTY = "otherProperty"; + private String otherProperty; + + public ChildWithNullable() { + + } + + public ChildWithNullable otherProperty(String otherProperty) { + + this.otherProperty = otherProperty; + return this; + } + + /** + * Get otherProperty + * @return otherProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getOtherProperty() { + return otherProperty; + } + + + @JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + @Override + public ChildWithNullable type(TypeEnum type) { + this.setType(type); + return this; + } + + @Override + public ChildWithNullable nullableProperty(String nullableProperty) { + this.setNullableProperty(nullableProperty); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 00000000000..dcd0d2ec424 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model with \"_class\" property + */ +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ClassModel { + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; + + public ClassModel() { + } + + public ClassModel propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 00000000000..0eddf18ba0d --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Client + */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Client { + public static final String JSON_PROPERTY_CLIENT = "client"; + private String client; + + public Client() { + } + + public Client client(String client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClient() { + return client; + } + + + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 00000000000..d89d61e6410 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * DeprecatedObject + * @deprecated + */ +@Deprecated +@JsonPropertyOrder({ + DeprecatedObject.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DeprecatedObject { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public DeprecatedObject() { + } + + public DeprecatedObject name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..2721eb32f72 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,128 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Dog + */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Dog extends Animal { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + public Dog() { + + } + + public Dog breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + @Override + public Dog className(String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(String color) { + this.setColor(color); + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 00000000000..ad4fbf45d14 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,215 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EnumArrays + */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum; + + public EnumArrays() { + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayEnum() { + return arrayEnum; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 00000000000..1190cf5abe3 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 00000000000..2981d30db90 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,492 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * EnumTest + */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) +@JsonTypeName("Enum_Test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private JsonNullable outerEnum = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + public EnumTest() { + } + + public EnumTest enumString(EnumStringEnum enumString) { + + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumStringEnum getEnumString() { + return enumString; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public OuterEnum getOuterEnum() { + return outerEnum.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getOuterEnum_JsonNullable() { + return outerEnum; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { + this.outerEnum = outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + equalsNullable(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..4ac66ca3434 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FakeBigDecimalMap200Response + */ +@JsonPropertyOrder({ + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID, + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP +}) +@JsonTypeName("fakeBigDecimalMap_200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeBigDecimalMap200Response { + public static final String JSON_PROPERTY_SOME_ID = "someId"; + private BigDecimal someId; + + public static final String JSON_PROPERTY_SOME_MAP = "someMap"; + private Map someMap; + + public FakeBigDecimalMap200Response() { + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + + this.someId = someId; + return this; + } + + /** + * Get someId + * @return someId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getSomeId() { + return someId; + } + + + @JsonProperty(JSON_PROPERTY_SOME_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + /** + * Get someMap + * @return someMap + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getSomeMap() { + return someMap; + } + + + @JsonProperty(JSON_PROPERTY_SOME_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..c9aa160c135 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,146 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FileSchemaTestClass + */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FileSchemaTestClass { + public static final String JSON_PROPERTY_FILE = "file"; + private ModelFile _file; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files; + + public FileSchemaTestClass() { + } + + public FileSchemaTestClass _file(ModelFile _file) { + + this._file = _file; + return this; + } + + /** + * Get _file + * @return _file + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ModelFile getFile() { + return _file; + } + + + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass files(List files) { + + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 00000000000..e9069943cec --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Foo + */ +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Foo { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar = "bar"; + + public Foo() { + } + + public Foo bar(String bar) { + + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBar(String bar) { + this.bar = bar; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..2d464d604c8 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FooGetDefaultResponse + */ +@JsonPropertyOrder({ + FooGetDefaultResponse.JSON_PROPERTY_STRING +}) +@JsonTypeName("_foo_get_default_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooGetDefaultResponse { + public static final String JSON_PROPERTY_STRING = "string"; + private Foo string; + + public FooGetDefaultResponse() { + } + + public FooGetDefaultResponse string(Foo string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Foo getString() { + return string; + } + + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(Foo string) { + this.string = string; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 00000000000..c67a8985f9e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,584 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * FormatTest + */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_DECIMAL, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) +@JsonTypeName("format_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FormatTest { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_DECIMAL = "decimal"; + private BigDecimal decimal; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + private String patternWithDigits; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + private String patternWithDigitsAndDelimiter; + + public FormatTest() { + } + + public FormatTest integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInteger() { + return integer; + } + + + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInt32() { + return int32; + } + + + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInt64() { + return int64; + } + + + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest decimal(BigDecimal decimal) { + + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getDecimal() { + return decimal; + } + + + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest string(String string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getString() { + return string; + } + + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public byte[] getByte() { + return _byte; + } + + + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getBinary() { + return binary; + } + + + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getDate() { + return date; + } + + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigits() { + return patternWithDigits; + } + + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..6ed089041e3 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,125 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * HasOnlyReadOnly + */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) +@JsonTypeName("hasOnlyReadOnly") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HasOnlyReadOnly { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; + + public HasOnlyReadOnly() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + /** + * Get foo + * @return foo + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFoo() { + return foo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 00000000000..5131a02efc6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,126 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HealthCheckResult { + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + private JsonNullable nullableMessage = JsonNullable.undefined(); + + public HealthCheckResult() { + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getNullableMessage() { + return nullableMessage.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableMessage_JsonNullable() { + return nullableMessage; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableMessage)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 00000000000..5a4ac913b51 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MapTest + */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MapTest { + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap; + + public MapTest() { + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getDirectMap() { + return directMap; + } + + + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getIndirectMap() { + return indirectMap; + } + + + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..16c0c4ffefc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,178 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + private Map map; + + public MixedPropertiesAndAdditionalPropertiesClass() { + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMap() { + return map; + } + + + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 00000000000..6890500da26 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,135 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name starting with number + */ +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) +@JsonTypeName("200_response") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Model200Response { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; + + public Model200Response() { + } + + public Model200Response name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; + } + + public Model200Response propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..5855bba3134 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("ApiResponse") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCode() { + return code; + } + + + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 00000000000..536c114f7bf --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 00000000000..a54c89f4aef --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 00000000000..0ae4173b86e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing reserved words + */ +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) +@JsonTypeName("Return") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelReturn { + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; + + public ModelReturn() { + } + + public ModelReturn _return(Integer _return) { + + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReturn() { + return _return; + } + + + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 00000000000..0e5b485fe91 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,186 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name same as property name + */ +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Name { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; + + public Name() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } + + public Name name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSnakeCase() { + return snakeCase; + } + + + + public Name property(String property) { + + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProperty() { + return property; + } + + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * @return _123number + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer get123number() { + return _123number; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 00000000000..337ee2088f3 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,614 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NullableClass + */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NullableClass extends HashMap { + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + private JsonNullable integerProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + private JsonNullable numberProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + private JsonNullable booleanProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + private JsonNullable stringProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + private JsonNullable dateProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + private JsonNullable datetimeProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + private List arrayItemsNullable; + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + private JsonNullable> objectNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + private Map objectItemsNullable; + + public NullableClass() { + + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + + return this; + } + + /** + * Get integerProp + * @return integerProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Integer getIntegerProp() { + return integerProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getIntegerProp_JsonNullable() { + return integerProp; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + public void setIntegerProp_JsonNullable(JsonNullable integerProp) { + this.integerProp = integerProp; + } + + public void setIntegerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public BigDecimal getNumberProp() { + return numberProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNumberProp_JsonNullable() { + return numberProp; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + public void setNumberProp_JsonNullable(JsonNullable numberProp) { + this.numberProp = numberProp; + } + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Boolean getBooleanProp() { + return booleanProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getBooleanProp_JsonNullable() { + return booleanProp; + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getStringProp() { + return stringProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getStringProp_JsonNullable() { + return stringProp; + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + public void setStringProp_JsonNullable(JsonNullable stringProp) { + this.stringProp = stringProp; + } + + public void setStringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public LocalDate getDateProp() { + return dateProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDateProp_JsonNullable() { + return dateProp; + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + public void setDateProp_JsonNullable(JsonNullable dateProp) { + this.dateProp = dateProp; + } + + public void setDateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public OffsetDateTime getDatetimeProp() { + return datetimeProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getDatetimeProp_JsonNullable() { + return datetimeProp; + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayNullableProp.get().add(arrayNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public List getArrayNullableProp() { + return arrayNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayNullableProp_JsonNullable() { + return arrayNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList<>()); + } + try { + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { + return arrayAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + public void setArrayAndItemsNullableProp_JsonNullable(JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectNullableProp.get().put(key, objectNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Map getObjectNullableProp() { + return objectNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectNullableProp_JsonNullable() { + return objectNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + public void setObjectNullableProp_JsonNullable(JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = JsonNullable.>of(new HashMap<>()); + } + try { + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { + return objectAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + public void setObjectAndItemsNullableProp_JsonNullable(JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return equalsNullable(this.integerProp, nullableClass.integerProp) && + equalsNullable(this.numberProp, nullableClass.numberProp) && + equalsNullable(this.booleanProp, nullableClass.booleanProp) && + equalsNullable(this.stringProp, nullableClass.stringProp) && + equalsNullable(this.dateProp, nullableClass.dateProp) && + equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && + equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && + equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && + equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 00000000000..ae83af4b079 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * NumberOnly + */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NumberOnly { + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; + + public NumberOnly() { + } + + public NumberOnly justNumber(BigDecimal justNumber) { + + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getJustNumber() { + return justNumber; + } + + + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..bf0d9346ec4 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,215 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ObjectWithDeprecatedFields + */ +@JsonPropertyOrder({ + ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, + ObjectWithDeprecatedFields.JSON_PROPERTY_ID, + ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, + ObjectWithDeprecatedFields.JSON_PROPERTY_BARS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ObjectWithDeprecatedFields { + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; + + public static final String JSON_PROPERTY_ID = "id"; + private BigDecimal id; + + public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + private DeprecatedObject deprecatedRef; + + public static final String JSON_PROPERTY_BARS = "bars"; + private List bars; + + public ObjectWithDeprecatedFields() { + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUuid() { + return uuid; + } + + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields bars(List bars) { + + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getBars() { + return bars; + } + + + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBars(List bars) { + this.bars = bars; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..31d5d4f19c5 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,296 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + public Order() { + } + + public Order id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPetId() { + return petId; + } + + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuantity() { + return quantity; + } + + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getShipDate() { + return shipDate; + } + + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getComplete() { + return complete; + } + + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 00000000000..03e67767714 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OuterComposite + */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterComposite { + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; + + public OuterComposite() { + } + + public OuterComposite myNumber(BigDecimal myNumber) { + + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getMyNumber() { + return myNumber; + } + + + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myString(String myString) { + + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMyString() { + return myString; + } + + + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMyBoolean() { + return myBoolean; + } + + + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 00000000000..4cd955b63dc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..73077cc8c31 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 00000000000..e6c2e38c2e7 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..ef61373b187 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..eb11a70eecb --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * OuterObjectWithEnumProperty + */ +@JsonPropertyOrder({ + OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterObjectWithEnumProperty { + public static final String JSON_PROPERTY_VALUE = "value"; + private OuterEnumInteger value; + + public OuterObjectWithEnumProperty() { + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public OuterEnumInteger getValue() { + return value; + } + + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 00000000000..f032bccf711 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -0,0 +1,202 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ParentWithNullable + */ +@JsonPropertyOrder({ + ParentWithNullable.JSON_PROPERTY_TYPE, + ParentWithNullable.JSON_PROPERTY_NULLABLE_PROPERTY +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + +public class ParentWithNullable { + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + protected TypeEnum type; + + public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; + protected JsonNullable nullableProperty = JsonNullable.undefined(); + + public ParentWithNullable() { + } + + public ParentWithNullable type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + @jakarta.annotation.Nullable + @JsonIgnore + + public String getNullableProperty() { + return nullableProperty.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getNullableProperty_JsonNullable() { + return nullableProperty; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) + public void setNullableProperty_JsonNullable(JsonNullable nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + equalsNullable(this.nullableProperty, parentWithNullable.nullableProperty); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, hashCodeNullable(nullableProperty)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..c4b4ba4b393 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,320 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private Set photoUrls; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet() { + } + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Category getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(Set photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Set getPhotoUrls() { + return photoUrls; + } + + + @JsonDeserialize(as = LinkedHashSet.class) + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..806117333ca --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ReadOnlyFirst + */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ReadOnlyFirst { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; + + public ReadOnlyFirst() { + } + /** + * Constructor with only readonly parameters + */ + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + public ReadOnlyFirst baz(String baz) { + + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBaz() { + return baz; + } + + + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 00000000000..f9922454755 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 00000000000..92a42c44734 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * SpecialModelName + */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) +@JsonTypeName("_special_model.name_") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class SpecialModelName { + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; + + public SpecialModelName() { + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..fb996d933b6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public Tag() { + } + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..1239e610351 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(JSON_PROPERTY_SOME_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..c8db7dc4238 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,320 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class User { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; + + public User() { + } + + public User id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhone() { + return phone; + } + + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUserStatus() { + return userStatus; + } + + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..f17f97c4def --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + */ + @Test + public void call123testSpecialTagsTest() { + Client client = null; + Client response = api.call123testSpecialTags(client); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..be7d082abc6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for DefaultApi + */ +@Ignore +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + + /** + * + * + * + */ + @Test + public void fooGetTest() { + FooGetDefaultResponse response = api.fooGet(); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 00000000000..fd55e7b08a6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,369 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for FakeApi + */ +@Ignore +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + FakeBigDecimalMap200Response response = api.fakeBigDecimalMap(); + + // TODO: test validations + } + + /** + * Health check endpoint + * + * + */ + @Test + public void fakeHealthGetTest() { + HealthCheckResult response = api.fakeHealthGet(); + + // TODO: test validations + } + + /** + * test http signature authentication + * + * + */ + @Test + public void fakeHttpSignatureTestTest() { + Pet pet = null; + String query1 = null; + String header1 = null; + api.fakeHttpSignatureTest(pet, query1, header1); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + OuterComposite outerComposite = null; + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of enum (int) properties with examples + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + Map requestBody = null; + api.testAdditionalPropertiesReference(requestBody); + + // TODO: test validations + } + + /** + * + * + * For this test, the body has to be a binary file. + */ + @Test + public void testBodyWithBinaryTest() { + File body = null; + api.testBodyWithBinary(body); + + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request must reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + FileSchemaTestClass fileSchemaTestClass = null; + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + + /** + * + * + * + */ + @Test + public void testBodyWithQueryParamsTest() { + String query = null; + User user = null; + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + Client client = null; + Client response = api.testClientModel(client); + + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + @Test + public void testEndpointParametersTest() { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; + String password = null; + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumQueryModelArray = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + */ + @Test + public void testGroupParametersTest() { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + Map requestBody = null; + api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + + // TODO: test validations + } + + /** + * test nullable parent property + * + * + */ + @Test + public void testNullableTest() { + ChildWithNullable childWithNullable = null; + api.testNullable(childWithNullable); + + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + String allowEmpty = null; + Map language = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + */ + @Test + public void testStringMapReferenceTest() { + Map requestBody = null; + api.testStringMapReference(requestBody); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 00000000000..9b9e18fb233 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for FakeClassnameTags123Api + */ +@Ignore +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + + /** + * To test class name in snake case + * + * To test class name in snake case + */ + @Test + public void testClassnameTest() { + Client client = null; + Client response = api.testClassname(client); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..005740d942a --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for PetApi + */ +@Ignore +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + */ + @Test + public void addPetTest() { + Pet pet = null; + api.addPet(pet); + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + */ + @Test + public void deletePetTest() { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ + @Test + public void findPetsByStatusTest() { + List status = null; + List response = api.findPetsByStatus(status); + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ + @Test + public void findPetsByTagsTest() { + Set tags = null; + Set response = api.findPetsByTags(tags); + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + */ + @Test + public void getPetByIdTest() { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + */ + @Test + public void updatePetTest() { + Pet pet = null; + api.updatePet(pet); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + */ + @Test + public void updatePetWithFormTest() { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + + // TODO: test validations + } + + /** + * uploads an image + * + * + */ + @Test + public void uploadFileTest() { + Long petId = null; + String additionalMetadata = null; + File _file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + */ + @Test + public void uploadFileWithRequiredFileTest() { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..682b18f0b1d --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for StoreApi + */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @Test + public void deleteOrderTest() { + String orderId = null; + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + */ + @Test + public void getInventoryTest() { + Map response = api.getInventory(); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + */ + @Test + public void getOrderByIdTest() { + Long orderId = null; + Order response = api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + Order order = null; + Order response = api.placeOrder(order); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..a0323a12351 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * API tests for UserApi + */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + */ + @Test + public void createUserTest() { + User user = null; + api.createUser(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + */ + @Test + public void createUsersWithArrayInputTest() { + List user = null; + api.createUsersWithArrayInput(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + */ + @Test + public void createUsersWithListInputTest() { + List user = null; + api.createUsersWithListInput(user); + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + */ + @Test + public void deleteUserTest() { + String username = null; + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * + */ + @Test + public void getUserByNameTest() { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + */ + @Test + public void loginUserTest() { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + */ + @Test + public void logoutUserTest() { + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + String username = null; + User user = null; + api.updateUser(username, user); + + // TODO: test validations + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..6bdecfe07c9 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..f4b06d323d6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 00000000000..24776d3cb51 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..6bbe877044d --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..eaf908bb1ab --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 00000000000..99c6bcf5360 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 00000000000..a0217acd1f2 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,87 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..1b389a075be --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..22fcbd7f3cc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 00000000000..a89d26497bc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 00000000000..6ef5c744fbc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 00000000000..8028f11bc2b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..b04c2097b20 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..b2a12ab4c5e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 00000000000..4a755b0d442 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 00000000000..48aa1a737fc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 00000000000..1e65944cbdc --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 00000000000..3250ad91974 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..0048cb2c749 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..81bc69c9a7b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 00000000000..a9e2c8c126e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 00000000000..38a39e1c0ca --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,172 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..908f0aff6ed --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..0f45c2fcd5b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 00000000000..3752c5ba31f --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..0f47e193af8 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 00000000000..5743b70142b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..436e4abd59e --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 00000000000..f128d7b9ac2 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 00000000000..92273f48d23 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 00000000000..1c5337654cd --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 00000000000..1a6aa18fa20 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 00000000000..d960ef76e5c --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 00000000000..8623386a5e9 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..aa755cf8cb4 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..670c2535646 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 00000000000..870a977da94 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..d818b23c7d5 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..1d7b3338bca --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..cacda46a76f --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 00000000000..0333ee657a0 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..ac7169192a5 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 00000000000..2e4de561806 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..2e4303f1e4b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..c56da4290fa --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..476e4ca161b --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..9501cf722d6 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..dc9cf9742ef --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,55 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..edb986ca550 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..69d274133b9 --- /dev/null +++ b/samples/client/petstore/java/restclient/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/resteasy/.github/workflows/maven.yml b/samples/client/petstore/java/resteasy/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resteasy/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resteasy/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 19096d36954..bb1f0718903 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -104,7 +104,8 @@ ext { jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" - junit_version = "4.13" + assertj_version = "3.23.1" + junit_version = "5.10.2" } dependencies { @@ -120,5 +121,6 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.assertj:assertj-core:$assertj_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index fa0bd87c5d7..268c41cff69 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -19,7 +19,8 @@ lazy val root = (project in file(".")). "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "junit" % "junit" % "4.13" % "test", + "org.assertj" % "assertj-core" % "3.23.1" % "test", + "junit" % "junit" % "5.10.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/resteasy/docs/ParentWithNullable.md b/samples/client/petstore/java/resteasy/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/resteasy/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/resteasy/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resteasy/gradlew b/samples/client/petstore/java/resteasy/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/resteasy/gradlew +++ b/samples/client/petstore/java/resteasy/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resteasy/gradlew.bat b/samples/client/petstore/java/resteasy/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resteasy/gradlew.bat +++ b/samples/client/petstore/java/resteasy/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 619da34f6cd..3d4831fc3ae 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -64,7 +64,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -240,8 +239,14 @@ - junit - junit + org.assertj + assertj-core + ${assertj-version} + test + + + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -255,6 +260,7 @@ 1.3.5 2.9.10 1.0.0 - 4.13 + 3.23.1 + 5.10.2 diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 4afcc27fcc5..85b3c9ae19d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -76,7 +76,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index bb578593d22..c7ec666bb18 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -67,7 +67,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index e6d3fb6801e..3e5dfccd5dc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -79,7 +79,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index 154e6cc2374..41b29a30249 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..accb755a668 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..ed8e1e2da05 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index f03d7aefbce..58a77ffded8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index ca790c41027..04f1adb80ea 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,7 +243,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -269,7 +268,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -295,7 +293,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -321,7 +318,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -355,7 +351,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -381,7 +376,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -407,7 +401,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 512b6e34aaf..e2c63da4e8d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -70,7 +70,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f4f44fa76aa..e149084b1a5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 2652fbc3331..f76f9b027ec 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -130,7 +130,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -158,7 +157,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -184,7 +182,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +209,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -240,7 +236,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -268,7 +263,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -294,7 +288,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -320,7 +313,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -346,7 +338,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -372,7 +363,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -398,7 +388,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -424,7 +413,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -450,7 +438,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -476,7 +463,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -502,7 +488,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..9fc24a2b7f4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 2b1642eb26e..136e37557dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e059b95f066..4ec2bb53611 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..517b2eb9f07 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..c8f27c57192 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..458314f0d83 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NullableClass.java index 44c483b70c3..7ce7d5cb48a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NullableClass.java @@ -127,7 +127,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -161,7 +160,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -195,7 +193,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -229,7 +226,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -263,7 +259,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -297,7 +292,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -343,7 +337,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -389,7 +382,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -423,7 +415,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -469,7 +460,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -515,7 +505,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index cc3d7df1253..f573813253c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -79,7 +79,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -107,7 +106,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -135,7 +133,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..05dfbdaeefa 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..7045f92dd8f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ParentWithNullable.java index e3705e43937..0f980144308 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -85,7 +85,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -115,7 +115,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index f3978908526..180ee4787ba 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d585c01ecc3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..201029ba21a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 8ed799606d5..b501d23345c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 9f3d3543c84..bfa256f1e32 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/DefaultApiTest.java index 6e55220f09e..a4c30f626ba 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java index ee35df281fb..168aeba6164 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -27,9 +27,9 @@ import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 4369000f256..631ee0453c3 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java index 6612ffc6283..494c91ba315 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.io.File; import java.io.FileWriter; @@ -183,7 +183,7 @@ public class PetApiTest { fw.close(); file.deleteOnExit(); ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - Assert.assertEquals((long)response.getCode(), 200); + Assertions.assertEquals((long)response.getCode(), 200); } /** * uploads an image (required) diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/StoreApiTest.java index f0456cb1998..049b5387a8e 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -15,9 +15,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/UserApiTest.java index 6a405a0ae6f..f4a9f387822 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -16,9 +16,9 @@ package org.openapitools.client.api; import org.openapitools.client.ApiException; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.Assert; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; import java.time.LocalDate; import java.time.OffsetDateTime; diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 29bc5ae9694..787d688e130 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index dad0e9235de..3f04e91bf13 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AllOfWithSingleRef diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AnimalTest.java index da5609b5489..f461e8aee76 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index cbc199f1575..a58ead43198 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 762f9d6dc33..02ec7e7c56b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -22,9 +22,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 20dc34a8c51..ab92570feca 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CapitalizationTest.java index 4fd3728ab89..d6017d04097 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CatTest.java index d591bdd30ef..5a63409b79d 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java index 12de38c0c08..d4909139f42 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec3..a109c6f7175 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClassModelTest.java index d1936d85e81..7213ea0482b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClientTest.java index 7aa0f5859ff..94dc977fcb3 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index 65fd3cc0b76..ef13089e92a 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DeprecatedObject diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DogTest.java index 744c8a406fe..8e8013c6108 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 694e4196138..64a0a0adc23 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumClassTest.java index 3f50e1bfb9e..ae6973ba637 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumTestTest.java index 0a1fd0f4268..a737a20f6c9 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,9 +26,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..1792f6169d9 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index fb8827a1e88..e346751e1b9 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index cd15af86ee9..c1db998eb2d 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FooGetDefaultResponse diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooTest.java index 2a92367019b..ece58545bfd 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Foo diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java index 8a9d3adfc01..d5ee3bc731d 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,9 +23,9 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index bf777b061cc..b408ad1c4c0 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index e96ffaa18f4..638820e3bb7 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,9 +22,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HealthCheckResult diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MapTestTest.java index 50e909f0381..cbe8b3bfddc 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index b16858dc17e..2c9924c2e73 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,9 +23,9 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index dd90f6799d3..b1bbea4045b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index e63f2ae5e9c..972a351b129 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java index 264249edc1c..97053c1ebd8 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java index 81fd2dcc6a6..71a14983d09 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelReturnTest.java index 5840d4f8f0c..cad3f081c54 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NameTest.java index 9280c171539..9dafc643a8b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NullableClassTest.java index c79c6366f83..7d30912d4c8 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -30,9 +30,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NullableClass diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 63b5bc0440e..46d3b1b334d 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index 4203b62f784..a58269e7c3b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -23,9 +23,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ObjectWithDeprecatedFields diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java index e0fbb529af6..915233936f1 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 840cf65c8d0..4106235863a 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 5b9bae28ec6..31fc4a3cab2 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumDefaultValue diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index 731acbf905f..41a2e5a97ce 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumIntegerDefaultValue diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 234945cec0f..2f25518a1b1 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumInteger diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumTest.java index b312b11a09e..4b4689794b9 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 964d1281b21..569e16247e6 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterObjectWithEnumProperty diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13..828d360428e 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -25,9 +25,9 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java index ca23198fbf1..51c0563373c 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/PetTest.java @@ -26,9 +26,9 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b356d6993c5..e9889594579 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 920d02c930c..bdcda63a512 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,9 +13,9 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SingleRefType diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 8eb0b1bd269..3fe4051508d 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java index 6dc0868167c..ef31f21248b 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9d..8e5a4ba75d2 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/UserTest.java index b029d279409..819e2d8f761 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User diff --git a/samples/client/petstore/java/resttemplate-jakarta/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate-jakarta/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resttemplate-jakarta/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resttemplate-jakarta/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resttemplate-jakarta/gradlew b/samples/client/petstore/java/resttemplate-jakarta/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/resttemplate-jakarta/gradlew +++ b/samples/client/petstore/java/resttemplate-jakarta/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resttemplate-jakarta/gradlew.bat b/samples/client/petstore/java/resttemplate-jakarta/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/gradlew.bat +++ b/samples/client/petstore/java/resttemplate-jakarta/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java index d5094674046..53262dca481 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,14 @@ public class Category { public Category() { } + /** + * Constructor with all args parameters + */ + public Category(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_NAME) String name) { + this.id = id; + this.name = name; + } + public Category id(Long id) { this.id = id; @@ -66,7 +74,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 362a14ca672..75d9e0f7777 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -46,6 +46,15 @@ public class ModelApiResponse { public ModelApiResponse() { } + /** + * Constructor with all args parameters + */ + public ModelApiResponse(@JsonProperty(JSON_PROPERTY_CODE) Integer code, @JsonProperty(JSON_PROPERTY_TYPE) String type, @JsonProperty(JSON_PROPERTY_MESSAGE) String message) { + this.code = code; + this.type = type; + this.message = message; + } + public ModelApiResponse code(Integer code) { this.code = code; @@ -71,7 +80,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +105,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java index 2274e517808..ad523355f6c 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,18 @@ public class Order { public Order() { } + /** + * Constructor with all args parameters + */ + public Order(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_PET_ID) Long petId, @JsonProperty(JSON_PROPERTY_QUANTITY) Integer quantity, @JsonProperty(JSON_PROPERTY_SHIP_DATE) OffsetDateTime shipDate, @JsonProperty(JSON_PROPERTY_STATUS) StatusEnum status, @JsonProperty(JSON_PROPERTY_COMPLETE) Boolean complete) { + this.id = id; + this.petId = petId; + this.quantity = quantity; + this.shipDate = shipDate; + this.status = status; + this.complete = complete; + } + public Order id(Long id) { this.id = id; @@ -120,7 +132,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +157,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +182,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +207,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +232,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java index f2387841ab7..4d2350bd21c 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -99,6 +99,18 @@ public class Pet { public Pet() { } + /** + * Constructor with all args parameters + */ + public Pet(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_CATEGORY) Category category, @JsonProperty(JSON_PROPERTY_NAME) String name, @JsonProperty(JSON_PROPERTY_PHOTO_URLS) List photoUrls, @JsonProperty(JSON_PROPERTY_TAGS) List tags, @JsonProperty(JSON_PROPERTY_STATUS) StatusEnum status) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + public Pet id(Long id) { this.id = id; @@ -124,7 +136,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -150,7 +161,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -176,7 +186,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -210,7 +219,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -244,7 +252,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java index 0e5baf64d92..89d04728d6f 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,14 @@ public class Tag { public Tag() { } + /** + * Constructor with all args parameters + */ + public Tag(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_NAME) String name) { + this.id = id; + this.name = name; + } + public Tag id(Long id) { this.id = id; @@ -66,7 +74,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java index c202bde3bd0..1de14518c65 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -65,6 +65,20 @@ public class User { public User() { } + /** + * Constructor with all args parameters + */ + public User(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_USERNAME) String username, @JsonProperty(JSON_PROPERTY_FIRST_NAME) String firstName, @JsonProperty(JSON_PROPERTY_LAST_NAME) String lastName, @JsonProperty(JSON_PROPERTY_EMAIL) String email, @JsonProperty(JSON_PROPERTY_PASSWORD) String password, @JsonProperty(JSON_PROPERTY_PHONE) String phone, @JsonProperty(JSON_PROPERTY_USER_STATUS) Integer userStatus) { + this.id = id; + this.username = username; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.phone = phone; + this.userStatus = userStatus; + } + public User id(Long id) { this.id = id; @@ -90,7 +104,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +129,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +154,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +179,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +204,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +229,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +254,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/resttemplate-swagger1/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate-swagger1/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resttemplate-swagger1/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resttemplate-swagger1/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resttemplate-swagger1/gradlew b/samples/client/petstore/java/resttemplate-swagger1/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/gradlew +++ b/samples/client/petstore/java/resttemplate-swagger1/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resttemplate-swagger1/gradlew.bat b/samples/client/petstore/java/resttemplate-swagger1/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/gradlew.bat +++ b/samples/client/petstore/java/resttemplate-swagger1/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java index 2fa2a2f4b47..b3b5b41f1b2 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java @@ -70,7 +70,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 899043d57cf..f512afe18ed 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -75,7 +75,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -102,7 +101,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java index ea8512454f0..78d5990a969 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java @@ -124,7 +124,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -151,7 +150,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -178,7 +176,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -205,7 +202,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -232,7 +228,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 6e8d6b1cd43..9318da486f9 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -128,7 +128,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -155,7 +154,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -182,7 +180,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -217,7 +214,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -252,7 +248,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java index a1eb57d37c8..f5223ee058a 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java @@ -70,7 +70,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java index 9193a178739..30a852d0af0 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java @@ -94,7 +94,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -121,7 +120,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -148,7 +146,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -175,7 +172,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -202,7 +198,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -229,7 +224,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -256,7 +250,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/resttemplate-swagger2/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate-swagger2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resttemplate-swagger2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resttemplate-swagger2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resttemplate-swagger2/gradlew b/samples/client/petstore/java/resttemplate-swagger2/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/gradlew +++ b/samples/client/petstore/java/resttemplate-swagger2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resttemplate-swagger2/gradlew.bat b/samples/client/petstore/java/resttemplate-swagger2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/gradlew.bat +++ b/samples/client/petstore/java/resttemplate-swagger2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java index f9e95798a56..0f7c33d2ae8 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -69,7 +69,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 0a17c4c6b45..0c16024fb7e 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -74,7 +74,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -101,7 +100,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java index fb816f416d2..c595f9c8b8d 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -123,7 +123,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -150,7 +149,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -177,7 +175,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -204,7 +201,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -231,7 +227,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java index 8d2c7c29a0d..f578ac3077a 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -154,7 +153,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -181,7 +179,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; @@ -216,7 +213,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -251,7 +247,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java index a2bd439898d..1feff5d025f 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -69,7 +69,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java index a8f95d34aac..6f757b42fdd 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -93,7 +93,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -120,7 +119,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -147,7 +145,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -174,7 +171,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -201,7 +197,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -228,7 +223,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -255,7 +249,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resttemplate-withXml/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ParentWithNullable.md b/samples/client/petstore/java/resttemplate-withXml/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resttemplate-withXml/gradlew b/samples/client/petstore/java/resttemplate-withXml/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/resttemplate-withXml/gradlew +++ b/samples/client/petstore/java/resttemplate-withXml/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resttemplate-withXml/gradlew.bat b/samples/client/petstore/java/resttemplate-withXml/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resttemplate-withXml/gradlew.bat +++ b/samples/client/petstore/java/resttemplate-withXml/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index db247086110..2f5c5eb12d4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -95,7 +95,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 2c1d03a868f..28fb48270d5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -78,7 +78,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index 12554e5229e..387e6dea9a6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -58,7 +58,7 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; @XmlElement(name = "color") - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -90,7 +90,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index 774256cd5bb..1a7481952e1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -105,7 +105,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -143,7 +142,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index b84bef4913e..286a38f1492 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -97,7 +97,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -125,7 +124,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -153,7 +151,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -181,7 +178,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -209,7 +205,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 9751bc7323e..be0f40c4f84 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -77,7 +77,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index e9c8f08a033..66ef0003138 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -161,7 +161,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 8c9bf79af6a..61b47757307 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -278,7 +278,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -306,7 +305,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -334,7 +332,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -362,7 +359,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -397,7 +393,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -425,7 +420,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -453,7 +447,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index a09479287b5..a345093b67c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -84,7 +84,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 6102c801e07..37960229b66 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -84,7 +84,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index d43bf273481..781d709fef0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -156,7 +156,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -186,7 +185,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -214,7 +212,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -244,7 +241,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -274,7 +270,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -304,7 +299,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -332,7 +326,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -360,7 +353,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -388,7 +380,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -416,7 +407,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -444,7 +434,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -472,7 +461,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -500,7 +488,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -528,7 +515,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -556,7 +542,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 68c44468f97..a42ee4ae607 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -66,7 +66,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 85b87aa9510..ca791ebe738 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -150,7 +150,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -188,7 +187,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -226,7 +224,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8500866c659..0e7a6ac6fa9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -91,7 +91,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -119,7 +118,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 68477a1776a..fd7abec7f76 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -78,7 +78,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9e4f1ff6aca..1db5153e02d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -83,7 +83,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -111,7 +110,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index e6eafaa7ebe..823660e828e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -87,7 +87,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -103,7 +102,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -131,7 +129,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java index acd5b34f6aa..0c5227f0207 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java @@ -166,7 +166,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -201,7 +200,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -236,7 +234,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -271,7 +268,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -306,7 +302,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -341,7 +336,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -389,7 +383,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -437,7 +430,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -475,7 +467,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -523,7 +514,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -571,7 +561,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index f09e573d26b..b8523d8e919 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -95,7 +95,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -125,7 +124,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -155,7 +153,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 7b1033f48b8..5389fbe7def 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -141,7 +141,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -169,7 +168,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -197,7 +195,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -225,7 +222,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -253,7 +249,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index 77435f9dba8..53d1710851e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -83,7 +83,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -111,7 +110,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 6c6c45e5a12..641295ec133 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -62,7 +62,7 @@ public class ParentWithNullable { @XmlEnum(String.class) public enum TypeEnum { @XmlEnumValue("ChildWithNullable") - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -97,7 +97,7 @@ public class ParentWithNullable { public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; @XmlElement(name = "nullableProperty") - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -129,7 +129,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index b6f28482476..e229f5c955d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -155,7 +155,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -183,7 +182,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -211,7 +209,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -252,7 +249,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -292,7 +288,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 152d9804ada..1c7259dbfd1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -65,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index b42ec5ce6f5..ad9edf45859 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -77,7 +77,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 12cad2a9b23..77a4237aa78 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -107,7 +107,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -135,7 +134,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -163,7 +161,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -191,7 +188,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -219,7 +215,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -247,7 +242,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -275,7 +269,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml b/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml +++ b/samples/client/petstore/java/resttemplate/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/resttemplate/docs/ParentWithNullable.md b/samples/client/petstore/java/resttemplate/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/resttemplate/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/resttemplate/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/resttemplate/gradlew b/samples/client/petstore/java/resttemplate/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/resttemplate/gradlew +++ b/samples/client/petstore/java/resttemplate/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/resttemplate/gradlew.bat b/samples/client/petstore/java/resttemplate/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/resttemplate/gradlew.bat +++ b/samples/client/petstore/java/resttemplate/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cab1a91ecf6..ff8249326e7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -43,6 +43,14 @@ public class AdditionalPropertiesClass { public AdditionalPropertiesClass() { } + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesClass(@JsonProperty(JSON_PROPERTY_MAP_PROPERTY) Map mapProperty, @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) Map> mapOfMapProperty) { + this.mapProperty = mapProperty; + this.mapOfMapProperty = mapOfMapProperty; + } + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -76,7 +84,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; @@ -149,5 +156,64 @@ public class AdditionalPropertiesClass { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private AdditionalPropertiesClass instance; + + public Builder() { + this(new AdditionalPropertiesClass()); + } + + protected Builder(AdditionalPropertiesClass instance) { + this.instance = instance; + } + + public AdditionalPropertiesClass.Builder mapProperty(Map mapProperty) { + this.instance.mapProperty = mapProperty; + return this; + } + public AdditionalPropertiesClass.Builder mapOfMapProperty(Map> mapOfMapProperty) { + this.instance.mapOfMapProperty = mapOfMapProperty; + return this; + } + + + /** + * returns a built AdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public AdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AdditionalPropertiesClass.Builder builder() { + return new AdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesClass.Builder toBuilder() { + return new AdditionalPropertiesClass.Builder() + .mapProperty(getMapProperty()) + .mapOfMapProperty(getMapOfMapProperty()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index bb578593d22..763b123cf4d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -42,6 +42,14 @@ public class AllOfWithSingleRef { public AllOfWithSingleRef() { } + /** + * Constructor with all args parameters + */ + public AllOfWithSingleRef(@JsonProperty(JSON_PROPERTY_USERNAME) String username, @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) SingleRefType singleRefType) { + this.username = username; + this.singleRefType = singleRefType; + } + public AllOfWithSingleRef username(String username) { this.username = username; @@ -67,7 +75,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; @@ -132,5 +139,64 @@ public class AllOfWithSingleRef { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private AllOfWithSingleRef instance; + + public Builder() { + this(new AllOfWithSingleRef()); + } + + protected Builder(AllOfWithSingleRef instance) { + this.instance = instance; + } + + public AllOfWithSingleRef.Builder username(String username) { + this.instance.username = username; + return this; + } + public AllOfWithSingleRef.Builder singleRefType(SingleRefType singleRefType) { + this.instance.singleRefType = singleRefType; + return this; + } + + + /** + * returns a built AllOfWithSingleRef instance. + * + * The builder is not reusable. + */ + public AllOfWithSingleRef build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllOfWithSingleRef.Builder builder() { + return new AllOfWithSingleRef.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllOfWithSingleRef.Builder toBuilder() { + return new AllOfWithSingleRef.Builder() + .username(getUsername()) + .singleRefType(getSingleRefType()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index e6d3fb6801e..decc86a5459 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -49,11 +49,19 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } + /** + * Constructor with all args parameters + */ + public Animal(@JsonProperty(JSON_PROPERTY_CLASS_NAME) String className, @JsonProperty(JSON_PROPERTY_COLOR) String color) { + this.className = className; + this.color = color; + } + public Animal className(String className) { this.className = className; @@ -79,7 +87,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; @@ -144,5 +151,64 @@ public class Animal { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Animal instance; + + public Builder() { + this(new Animal()); + } + + protected Builder(Animal instance) { + this.instance = instance; + } + + public Animal.Builder className(String className) { + this.instance.className = className; + return this; + } + public Animal.Builder color(String color) { + this.instance.color = color; + return this; + } + + + /** + * returns a built Animal instance. + * + * The builder is not reusable. + */ + public Animal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Animal.Builder builder() { + return new Animal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Animal.Builder toBuilder() { + return new Animal.Builder() + .className(getClassName()) + .color(getColor()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 0b75df2e200..f9103b6ef46 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -41,6 +41,13 @@ public class ArrayOfArrayOfNumberOnly { public ArrayOfArrayOfNumberOnly() { } + /** + * Constructor with all args parameters + */ + public ArrayOfArrayOfNumberOnly(@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -111,5 +118,59 @@ public class ArrayOfArrayOfNumberOnly { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ArrayOfArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfArrayOfNumberOnly()); + } + + protected Builder(ArrayOfArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) { + this.instance.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + /** + * returns a built ArrayOfArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfArrayOfNumberOnly.Builder builder() { + return new ArrayOfArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfArrayOfNumberOnly.Builder() + .arrayArrayNumber(getArrayArrayNumber()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index c164bc7d02b..3a5bc090b7c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -41,6 +41,13 @@ public class ArrayOfNumberOnly { public ArrayOfNumberOnly() { } + /** + * Constructor with all args parameters + */ + public ArrayOfNumberOnly(@JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) List arrayNumber) { + this.arrayNumber = arrayNumber; + } + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -111,5 +118,59 @@ public class ArrayOfNumberOnly { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfNumberOnly()); + } + + protected Builder(ArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) { + this.instance.arrayNumber = arrayNumber; + return this; + } + + + /** + * returns a built ArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfNumberOnly.Builder builder() { + return new ArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfNumberOnly.Builder() + .arrayNumber(getArrayNumber()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 56c2863353c..2a8e7d6b8f9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -49,6 +49,15 @@ public class ArrayTest { public ArrayTest() { } + /** + * Constructor with all args parameters + */ + public ArrayTest(@JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) List arrayOfString, @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) List> arrayArrayOfInteger, @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) List> arrayArrayOfModel) { + this.arrayOfString = arrayOfString; + this.arrayArrayOfInteger = arrayArrayOfInteger; + this.arrayArrayOfModel = arrayArrayOfModel; + } + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -82,7 +91,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +124,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; @@ -191,5 +198,69 @@ public class ArrayTest { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ArrayTest instance; + + public Builder() { + this(new ArrayTest()); + } + + protected Builder(ArrayTest instance) { + this.instance = instance; + } + + public ArrayTest.Builder arrayOfString(List arrayOfString) { + this.instance.arrayOfString = arrayOfString; + return this; + } + public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.instance.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) { + this.instance.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + /** + * returns a built ArrayTest instance. + * + * The builder is not reusable. + */ + public ArrayTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayTest.Builder builder() { + return new ArrayTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayTest.Builder toBuilder() { + return new ArrayTest.Builder() + .arrayOfString(getArrayOfString()) + .arrayArrayOfInteger(getArrayArrayOfInteger()) + .arrayArrayOfModel(getArrayArrayOfModel()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..afe76d1effe 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -57,6 +57,18 @@ public class Capitalization { public Capitalization() { } + /** + * Constructor with all args parameters + */ + public Capitalization(@JsonProperty(JSON_PROPERTY_SMALL_CAMEL) String smallCamel, @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) String capitalCamel, @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) String smallSnake, @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) String capitalSnake, @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) String scAETHFlowPoints, @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) String ATT_NAME) { + this.smallCamel = smallCamel; + this.capitalCamel = capitalCamel; + this.smallSnake = smallSnake; + this.capitalSnake = capitalSnake; + this.scAETHFlowPoints = scAETHFlowPoints; + this.ATT_NAME = ATT_NAME; + } + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; @@ -82,7 +94,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +119,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +144,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +169,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +194,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; @@ -259,5 +266,84 @@ public class Capitalization { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Capitalization instance; + + public Builder() { + this(new Capitalization()); + } + + protected Builder(Capitalization instance) { + this.instance = instance; + } + + public Capitalization.Builder smallCamel(String smallCamel) { + this.instance.smallCamel = smallCamel; + return this; + } + public Capitalization.Builder capitalCamel(String capitalCamel) { + this.instance.capitalCamel = capitalCamel; + return this; + } + public Capitalization.Builder smallSnake(String smallSnake) { + this.instance.smallSnake = smallSnake; + return this; + } + public Capitalization.Builder capitalSnake(String capitalSnake) { + this.instance.capitalSnake = capitalSnake; + return this; + } + public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) { + this.instance.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + public Capitalization.Builder ATT_NAME(String ATT_NAME) { + this.instance.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * returns a built Capitalization instance. + * + * The builder is not reusable. + */ + public Capitalization build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Capitalization.Builder builder() { + return new Capitalization.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Capitalization.Builder toBuilder() { + return new Capitalization.Builder() + .smallCamel(getSmallCamel()) + .capitalCamel(getCapitalCamel()) + .smallSnake(getSmallSnake()) + .capitalSnake(getCapitalSnake()) + .scAETHFlowPoints(getScAETHFlowPoints()) + .ATT_NAME(getATTNAME()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index ea026441f36..825d182d714 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -48,6 +48,14 @@ public class Cat extends Animal { } + /** + * Constructor with all args parameters + */ + public Cat(@JsonProperty(JSON_PROPERTY_DECLAWED) Boolean declawed, @JsonProperty(JSON_PROPERTY_CLASS_NAME) String className, @JsonProperty(JSON_PROPERTY_COLOR) String color) { + super(className, color); + this.declawed = declawed; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; @@ -124,5 +132,73 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } + public static class Builder extends Animal.Builder { + + private Cat instance; + + public Builder() { + this(new Cat()); + } + + protected Builder(Cat instance) { + super(instance); + this.instance = instance; + } + + public Cat.Builder declawed(Boolean declawed) { + this.instance.declawed = declawed; + return this; + } + + public Cat.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Cat.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Cat instance. + * + * The builder is not reusable. + */ + public Cat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Cat.Builder builder() { + return new Cat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Cat.Builder toBuilder() { + return new Cat.Builder() + .className(getClassName()) + .color(getColor()) + .declawed(getDeclawed()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..26be0de5232 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -41,6 +41,14 @@ public class Category { public Category() { } + /** + * Constructor with all args parameters + */ + public Category(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_NAME) String name) { + this.id = id; + this.name = name; + } + public Category id(Long id) { this.id = id; @@ -66,7 +74,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; @@ -131,5 +138,64 @@ public class Category { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Category instance; + + public Builder() { + this(new Category()); + } + + protected Builder(Category instance) { + this.instance = instance; + } + + public Category.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Category.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Category instance. + * + * The builder is not reusable. + */ + public Category build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Category.Builder builder() { + return new Category.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Category.Builder toBuilder() { + return new Category.Builder() + .id(getId()) + .name(getName()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java index d90495dcd16..f7c20ba0565 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -49,6 +49,14 @@ public class ChildWithNullable extends ParentWithNullable { } + /** + * Constructor with all args parameters + */ + public ChildWithNullable(@JsonProperty(JSON_PROPERTY_OTHER_PROPERTY) String otherProperty, @JsonProperty(JSON_PROPERTY_TYPE) TypeEnum type, @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) String nullableProperty) { + super(type, nullableProperty); + this.otherProperty = otherProperty; + } + public ChildWithNullable otherProperty(String otherProperty) { this.otherProperty = otherProperty; @@ -136,5 +144,77 @@ public class ChildWithNullable extends ParentWithNullable { return o.toString().replace("\n", "\n "); } + public static class Builder extends ParentWithNullable.Builder { + + private ChildWithNullable instance; + + public Builder() { + this(new ChildWithNullable()); + } + + protected Builder(ChildWithNullable instance) { + super(instance); + this.instance = instance; + } + + public ChildWithNullable.Builder otherProperty(String otherProperty) { + this.instance.otherProperty = otherProperty; + return this; + } + + public ChildWithNullable.Builder type(TypeEnum type) { // inherited: true + super.type(type); + return this; + } + + public ChildWithNullable.Builder nullableProperty(String nullableProperty) { // inherited: true + super.nullableProperty(nullableProperty); + return this; + } + public ChildWithNullable.Builder nullableProperty(JsonNullable nullableProperty) { + this.instance.nullableProperty = nullableProperty; + return this; + } + + + /** + * returns a built ChildWithNullable instance. + * + * The builder is not reusable. + */ + public ChildWithNullable build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChildWithNullable.Builder builder() { + return new ChildWithNullable.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChildWithNullable.Builder toBuilder() { + return new ChildWithNullable.Builder() + .type(getType()) + .nullableProperty(getNullableProperty()) + .otherProperty(getOtherProperty()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 2114fdc17be..0bf712502cf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -37,6 +37,13 @@ public class ClassModel { public ClassModel() { } + /** + * Constructor with all args parameters + */ + public ClassModel(@JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) String propertyClass) { + this.propertyClass = propertyClass; + } + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -99,5 +106,59 @@ public class ClassModel { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ClassModel instance; + + public Builder() { + this(new ClassModel()); + } + + protected Builder(ClassModel instance) { + this.instance = instance; + } + + public ClassModel.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built ClassModel instance. + * + * The builder is not reusable. + */ + public ClassModel build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClassModel.Builder builder() { + return new ClassModel.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClassModel.Builder toBuilder() { + return new ClassModel.Builder() + .propertyClass(getPropertyClass()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 2bd7e3ef027..acaafc3237b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -37,6 +37,13 @@ public class Client { public Client() { } + /** + * Constructor with all args parameters + */ + public Client(@JsonProperty(JSON_PROPERTY_CLIENT) String client) { + this.client = client; + } + public Client client(String client) { this.client = client; @@ -99,5 +106,59 @@ public class Client { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Client instance; + + public Builder() { + this(new Client()); + } + + protected Builder(Client instance) { + this.instance = instance; + } + + public Client.Builder client(String client) { + this.instance.client = client; + return this; + } + + + /** + * returns a built Client instance. + * + * The builder is not reusable. + */ + public Client build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Client.Builder builder() { + return new Client.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Client.Builder toBuilder() { + return new Client.Builder() + .client(getClient()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java index f142c01c211..91e2c31cbe4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -39,6 +39,13 @@ public class DeprecatedObject { public DeprecatedObject() { } + /** + * Constructor with all args parameters + */ + public DeprecatedObject(@JsonProperty(JSON_PROPERTY_NAME) String name) { + this.name = name; + } + public DeprecatedObject name(String name) { this.name = name; @@ -101,5 +108,59 @@ public class DeprecatedObject { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private DeprecatedObject instance; + + public Builder() { + this(new DeprecatedObject()); + } + + protected Builder(DeprecatedObject instance) { + this.instance = instance; + } + + public DeprecatedObject.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built DeprecatedObject instance. + * + * The builder is not reusable. + */ + public DeprecatedObject build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeprecatedObject.Builder builder() { + return new DeprecatedObject.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeprecatedObject.Builder toBuilder() { + return new DeprecatedObject.Builder() + .name(getName()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 1f21725e7a3..fe6d658d442 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -48,6 +48,14 @@ public class Dog extends Animal { } + /** + * Constructor with all args parameters + */ + public Dog(@JsonProperty(JSON_PROPERTY_BREED) String breed, @JsonProperty(JSON_PROPERTY_CLASS_NAME) String className, @JsonProperty(JSON_PROPERTY_COLOR) String color) { + super(className, color); + this.breed = breed; + } + public Dog breed(String breed) { this.breed = breed; @@ -124,5 +132,73 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } + public static class Builder extends Animal.Builder { + + private Dog instance; + + public Builder() { + this(new Dog()); + } + + protected Builder(Dog instance) { + super(instance); + this.instance = instance; + } + + public Dog.Builder breed(String breed) { + this.instance.breed = breed; + return this; + } + + public Dog.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Dog.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Dog instance. + * + * The builder is not reusable. + */ + public Dog build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Dog.Builder builder() { + return new Dog.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Dog.Builder toBuilder() { + return new Dog.Builder() + .className(getClassName()) + .color(getColor()) + .breed(getBreed()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 8af99f889d1..1c9ca816a07 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -114,6 +114,14 @@ public class EnumArrays { public EnumArrays() { } + /** + * Constructor with all args parameters + */ + public EnumArrays(@JsonProperty(JSON_PROPERTY_JUST_SYMBOL) JustSymbolEnum justSymbol, @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) List arrayEnum) { + this.justSymbol = justSymbol; + this.arrayEnum = arrayEnum; + } + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -139,7 +147,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; @@ -212,5 +219,64 @@ public class EnumArrays { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private EnumArrays instance; + + public Builder() { + this(new EnumArrays()); + } + + protected Builder(EnumArrays instance) { + this.instance = instance; + } + + public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) { + this.instance.justSymbol = justSymbol; + return this; + } + public EnumArrays.Builder arrayEnum(List arrayEnum) { + this.instance.arrayEnum = arrayEnum; + return this; + } + + + /** + * returns a built EnumArrays instance. + * + * The builder is not reusable. + */ + public EnumArrays build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumArrays.Builder builder() { + return new EnumArrays.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumArrays.Builder toBuilder() { + return new EnumArrays.Builder() + .justSymbol(getJustSymbol()) + .arrayEnum(getArrayEnum()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index ca790c41027..c40d9ee636c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -218,6 +218,20 @@ public class EnumTest { public EnumTest() { } + /** + * Constructor with all args parameters + */ + public EnumTest(@JsonProperty(JSON_PROPERTY_ENUM_STRING) EnumStringEnum enumString, @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) EnumStringRequiredEnum enumStringRequired, @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) EnumIntegerEnum enumInteger, @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) EnumNumberEnum enumNumber, @JsonProperty(JSON_PROPERTY_OUTER_ENUM) OuterEnum outerEnum, @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) OuterEnumInteger outerEnumInteger, @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) OuterEnumDefaultValue outerEnumDefaultValue, @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.enumString = enumString; + this.enumStringRequired = enumStringRequired; + this.enumInteger = enumInteger; + this.enumNumber = enumNumber; + this.outerEnum = outerEnum == null ? JsonNullable.undefined() : JsonNullable.of(outerEnum); + this.outerEnumInteger = outerEnumInteger; + this.outerEnumDefaultValue = outerEnumDefaultValue; + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; @@ -243,7 +257,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -269,7 +282,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -295,7 +307,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -321,7 +332,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -355,7 +365,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -381,7 +390,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -407,7 +415,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; @@ -495,5 +502,98 @@ public class EnumTest { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private EnumTest instance; + + public Builder() { + this(new EnumTest()); + } + + protected Builder(EnumTest instance) { + this.instance = instance; + } + + public EnumTest.Builder enumString(EnumStringEnum enumString) { + this.instance.enumString = enumString; + return this; + } + public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.instance.enumStringRequired = enumStringRequired; + return this; + } + public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) { + this.instance.enumInteger = enumInteger; + return this; + } + public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) { + this.instance.enumNumber = enumNumber; + return this; + } + public EnumTest.Builder outerEnum(OuterEnum outerEnum) { + this.instance.outerEnum = JsonNullable.of(outerEnum); + return this; + } + public EnumTest.Builder outerEnum(JsonNullable outerEnum) { + this.instance.outerEnum = outerEnum; + return this; + } + public EnumTest.Builder outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.instance.outerEnumInteger = outerEnumInteger; + return this; + } + public EnumTest.Builder outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.instance.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + public EnumTest.Builder outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.instance.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * returns a built EnumTest instance. + * + * The builder is not reusable. + */ + public EnumTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumTest.Builder builder() { + return new EnumTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumTest.Builder toBuilder() { + return new EnumTest.Builder() + .enumString(getEnumString()) + .enumStringRequired(getEnumStringRequired()) + .enumInteger(getEnumInteger()) + .enumNumber(getEnumNumber()) + .outerEnum(getOuterEnum()) + .outerEnumInteger(getOuterEnumInteger()) + .outerEnumDefaultValue(getOuterEnumDefaultValue()) + .outerEnumIntegerDefaultValue(getOuterEnumIntegerDefaultValue()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 0603bc3a013..ed2bd8b8cc3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -45,6 +45,14 @@ public class FakeBigDecimalMap200Response { public FakeBigDecimalMap200Response() { } + /** + * Constructor with all args parameters + */ + public FakeBigDecimalMap200Response(@JsonProperty(JSON_PROPERTY_SOME_ID) BigDecimal someId, @JsonProperty(JSON_PROPERTY_SOME_MAP) Map someMap) { + this.someId = someId; + this.someMap = someMap; + } + public FakeBigDecimalMap200Response someId(BigDecimal someId) { this.someId = someId; @@ -70,7 +78,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; @@ -143,5 +150,64 @@ public class FakeBigDecimalMap200Response { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private FakeBigDecimalMap200Response instance; + + public Builder() { + this(new FakeBigDecimalMap200Response()); + } + + protected Builder(FakeBigDecimalMap200Response instance) { + this.instance = instance; + } + + public FakeBigDecimalMap200Response.Builder someId(BigDecimal someId) { + this.instance.someId = someId; + return this; + } + public FakeBigDecimalMap200Response.Builder someMap(Map someMap) { + this.instance.someMap = someMap; + return this; + } + + + /** + * returns a built FakeBigDecimalMap200Response instance. + * + * The builder is not reusable. + */ + public FakeBigDecimalMap200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FakeBigDecimalMap200Response.Builder builder() { + return new FakeBigDecimalMap200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FakeBigDecimalMap200Response.Builder toBuilder() { + return new FakeBigDecimalMap200Response.Builder() + .someId(getSomeId()) + .someMap(getSomeMap()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e7135557afb..141f1ed45d8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -45,6 +45,14 @@ public class FileSchemaTestClass { public FileSchemaTestClass() { } + /** + * Constructor with all args parameters + */ + public FileSchemaTestClass(@JsonProperty(JSON_PROPERTY_FILE) ModelFile _file, @JsonProperty(JSON_PROPERTY_FILES) List files) { + this._file = _file; + this.files = files; + } + public FileSchemaTestClass _file(ModelFile _file) { this._file = _file; @@ -70,7 +78,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; @@ -143,5 +150,64 @@ public class FileSchemaTestClass { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private FileSchemaTestClass instance; + + public Builder() { + this(new FileSchemaTestClass()); + } + + protected Builder(FileSchemaTestClass instance) { + this.instance = instance; + } + + public FileSchemaTestClass.Builder _file(ModelFile _file) { + this.instance._file = _file; + return this; + } + public FileSchemaTestClass.Builder files(List files) { + this.instance.files = files; + return this; + } + + + /** + * returns a built FileSchemaTestClass instance. + * + * The builder is not reusable. + */ + public FileSchemaTestClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileSchemaTestClass.Builder builder() { + return new FileSchemaTestClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSchemaTestClass.Builder toBuilder() { + return new FileSchemaTestClass.Builder() + ._file(getFile()) + .files(getFiles()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java index 336ab5f2a6d..afe48149069 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java @@ -37,6 +37,13 @@ public class Foo { public Foo() { } + /** + * Constructor with all args parameters + */ + public Foo(@JsonProperty(JSON_PROPERTY_BAR) String bar) { + this.bar = bar; + } + public Foo bar(String bar) { this.bar = bar; @@ -99,5 +106,59 @@ public class Foo { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Foo instance; + + public Builder() { + this(new Foo()); + } + + protected Builder(Foo instance) { + this.instance = instance; + } + + public Foo.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + + + /** + * returns a built Foo instance. + * + * The builder is not reusable. + */ + public Foo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Foo.Builder builder() { + return new Foo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Foo.Builder toBuilder() { + return new Foo.Builder() + .bar(getBar()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 9977c248dee..a80081e63d5 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -39,6 +39,13 @@ public class FooGetDefaultResponse { public FooGetDefaultResponse() { } + /** + * Constructor with all args parameters + */ + public FooGetDefaultResponse(@JsonProperty(JSON_PROPERTY_STRING) Foo string) { + this.string = string; + } + public FooGetDefaultResponse string(Foo string) { this.string = string; @@ -101,5 +108,59 @@ public class FooGetDefaultResponse { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private FooGetDefaultResponse instance; + + public Builder() { + this(new FooGetDefaultResponse()); + } + + protected Builder(FooGetDefaultResponse instance) { + this.instance = instance; + } + + public FooGetDefaultResponse.Builder string(Foo string) { + this.instance.string = string; + return this; + } + + + /** + * returns a built FooGetDefaultResponse instance. + * + * The builder is not reusable. + */ + public FooGetDefaultResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FooGetDefaultResponse.Builder builder() { + return new FooGetDefaultResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FooGetDefaultResponse.Builder toBuilder() { + return new FooGetDefaultResponse.Builder() + .string(getString()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 2652fbc3331..121ba1bba78 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -103,6 +103,28 @@ public class FormatTest { public FormatTest() { } + /** + * Constructor with all args parameters + */ + public FormatTest(@JsonProperty(JSON_PROPERTY_INTEGER) Integer integer, @JsonProperty(JSON_PROPERTY_INT32) Integer int32, @JsonProperty(JSON_PROPERTY_INT64) Long int64, @JsonProperty(JSON_PROPERTY_NUMBER) BigDecimal number, @JsonProperty(JSON_PROPERTY_FLOAT) Float _float, @JsonProperty(JSON_PROPERTY_DOUBLE) Double _double, @JsonProperty(JSON_PROPERTY_DECIMAL) BigDecimal decimal, @JsonProperty(JSON_PROPERTY_STRING) String string, @JsonProperty(JSON_PROPERTY_BYTE) byte[] _byte, @JsonProperty(JSON_PROPERTY_BINARY) File binary, @JsonProperty(JSON_PROPERTY_DATE) LocalDate date, @JsonProperty(JSON_PROPERTY_DATE_TIME) OffsetDateTime dateTime, @JsonProperty(JSON_PROPERTY_UUID) UUID uuid, @JsonProperty(JSON_PROPERTY_PASSWORD) String password, @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) String patternWithDigits, @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) String patternWithDigitsAndDelimiter) { + this.integer = integer; + this.int32 = int32; + this.int64 = int64; + this.number = number; + this._float = _float; + this._double = _double; + this.decimal = decimal; + this.string = string; + this._byte = _byte; + this.binary = binary; + this.date = date; + this.dateTime = dateTime; + this.uuid = uuid; + this.password = password; + this.patternWithDigits = patternWithDigits; + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + public FormatTest integer(Integer integer) { this.integer = integer; @@ -130,7 +152,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -158,7 +179,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -184,7 +204,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +231,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -240,7 +258,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -268,7 +285,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -294,7 +310,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -320,7 +335,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -346,7 +360,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -372,7 +385,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -398,7 +410,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -424,7 +435,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -450,7 +460,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -476,7 +485,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -502,7 +510,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; @@ -595,5 +602,134 @@ public class FormatTest { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private FormatTest instance; + + public Builder() { + this(new FormatTest()); + } + + protected Builder(FormatTest instance) { + this.instance = instance; + } + + public FormatTest.Builder integer(Integer integer) { + this.instance.integer = integer; + return this; + } + public FormatTest.Builder int32(Integer int32) { + this.instance.int32 = int32; + return this; + } + public FormatTest.Builder int64(Long int64) { + this.instance.int64 = int64; + return this; + } + public FormatTest.Builder number(BigDecimal number) { + this.instance.number = number; + return this; + } + public FormatTest.Builder _float(Float _float) { + this.instance._float = _float; + return this; + } + public FormatTest.Builder _double(Double _double) { + this.instance._double = _double; + return this; + } + public FormatTest.Builder decimal(BigDecimal decimal) { + this.instance.decimal = decimal; + return this; + } + public FormatTest.Builder string(String string) { + this.instance.string = string; + return this; + } + public FormatTest.Builder _byte(byte[] _byte) { + this.instance._byte = _byte; + return this; + } + public FormatTest.Builder binary(File binary) { + this.instance.binary = binary; + return this; + } + public FormatTest.Builder date(LocalDate date) { + this.instance.date = date; + return this; + } + public FormatTest.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public FormatTest.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public FormatTest.Builder password(String password) { + this.instance.password = password; + return this; + } + public FormatTest.Builder patternWithDigits(String patternWithDigits) { + this.instance.patternWithDigits = patternWithDigits; + return this; + } + public FormatTest.Builder patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.instance.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * returns a built FormatTest instance. + * + * The builder is not reusable. + */ + public FormatTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FormatTest.Builder builder() { + return new FormatTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FormatTest.Builder toBuilder() { + return new FormatTest.Builder() + .integer(getInteger()) + .int32(getInt32()) + .int64(getInt64()) + .number(getNumber()) + ._float(getFloat()) + ._double(getDouble()) + .decimal(getDecimal()) + .string(getString()) + ._byte(getByte()) + .binary(getBinary()) + .date(getDate()) + .dateTime(getDateTime()) + .uuid(getUuid()) + .password(getPassword()) + .patternWithDigits(getPatternWithDigits()) + .patternWithDigitsAndDelimiter(getPatternWithDigitsAndDelimiter()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..fa85baa3bea 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters and all parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo @@ -120,5 +121,64 @@ public class HasOnlyReadOnly { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private HasOnlyReadOnly instance; + + public Builder() { + this(new HasOnlyReadOnly()); + } + + protected Builder(HasOnlyReadOnly instance) { + this.instance = instance; + } + + public HasOnlyReadOnly.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public HasOnlyReadOnly.Builder foo(String foo) { + this.instance.foo = foo; + return this; + } + + + /** + * returns a built HasOnlyReadOnly instance. + * + * The builder is not reusable. + */ + public HasOnlyReadOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HasOnlyReadOnly.Builder builder() { + return new HasOnlyReadOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HasOnlyReadOnly.Builder toBuilder() { + return new HasOnlyReadOnly.Builder() + .bar(getBar()) + .foo(getFoo()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java index ab073044ca9..c8df265798c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -41,6 +41,13 @@ public class HealthCheckResult { public HealthCheckResult() { } + /** + * Constructor with all args parameters + */ + public HealthCheckResult(@JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) String nullableMessage) { + this.nullableMessage = nullableMessage == null ? JsonNullable.undefined() : JsonNullable.of(nullableMessage); + } + public HealthCheckResult nullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); @@ -122,5 +129,63 @@ public class HealthCheckResult { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private HealthCheckResult instance; + + public Builder() { + this(new HealthCheckResult()); + } + + protected Builder(HealthCheckResult instance) { + this.instance = instance; + } + + public HealthCheckResult.Builder nullableMessage(String nullableMessage) { + this.instance.nullableMessage = JsonNullable.of(nullableMessage); + return this; + } + public HealthCheckResult.Builder nullableMessage(JsonNullable nullableMessage) { + this.instance.nullableMessage = nullableMessage; + return this; + } + + + /** + * returns a built HealthCheckResult instance. + * + * The builder is not reusable. + */ + public HealthCheckResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HealthCheckResult.Builder builder() { + return new HealthCheckResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HealthCheckResult.Builder toBuilder() { + return new HealthCheckResult.Builder() + .nullableMessage(getNullableMessage()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index d0c703482c7..1b8592530bc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -86,6 +86,16 @@ public class MapTest { public MapTest() { } + /** + * Constructor with all args parameters + */ + public MapTest(@JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) Map> mapMapOfString, @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) Map mapOfEnumString, @JsonProperty(JSON_PROPERTY_DIRECT_MAP) Map directMap, @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) Map indirectMap) { + this.mapMapOfString = mapMapOfString; + this.mapOfEnumString = mapOfEnumString; + this.directMap = directMap; + this.indirectMap = indirectMap; + } + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -119,7 +129,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +162,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +195,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; @@ -264,5 +271,74 @@ public class MapTest { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private MapTest instance; + + public Builder() { + this(new MapTest()); + } + + protected Builder(MapTest instance) { + this.instance = instance; + } + + public MapTest.Builder mapMapOfString(Map> mapMapOfString) { + this.instance.mapMapOfString = mapMapOfString; + return this; + } + public MapTest.Builder mapOfEnumString(Map mapOfEnumString) { + this.instance.mapOfEnumString = mapOfEnumString; + return this; + } + public MapTest.Builder directMap(Map directMap) { + this.instance.directMap = directMap; + return this; + } + public MapTest.Builder indirectMap(Map indirectMap) { + this.instance.indirectMap = indirectMap; + return this; + } + + + /** + * returns a built MapTest instance. + * + * The builder is not reusable. + */ + public MapTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MapTest.Builder builder() { + return new MapTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MapTest.Builder toBuilder() { + return new MapTest.Builder() + .mapMapOfString(getMapMapOfString()) + .mapOfEnumString(getMapOfEnumString()) + .directMap(getDirectMap()) + .indirectMap(getIndirectMap()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7974465691c..f3a7afa4064 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -50,6 +50,15 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public MixedPropertiesAndAdditionalPropertiesClass() { } + /** + * Constructor with all args parameters + */ + public MixedPropertiesAndAdditionalPropertiesClass(@JsonProperty(JSON_PROPERTY_UUID) UUID uuid, @JsonProperty(JSON_PROPERTY_DATE_TIME) OffsetDateTime dateTime, @JsonProperty(JSON_PROPERTY_MAP) Map map) { + this.uuid = uuid; + this.dateTime = dateTime; + this.map = map; + } + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -75,7 +84,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +109,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; @@ -176,5 +183,69 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private MixedPropertiesAndAdditionalPropertiesClass instance; + + public Builder() { + this(new MixedPropertiesAndAdditionalPropertiesClass()); + } + + protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) { + this.instance = instance; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) { + this.instance.map = map; + return this; + } + + + /** + * returns a built MixedPropertiesAndAdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public MixedPropertiesAndAdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder() + .uuid(getUuid()) + .dateTime(getDateTime()) + .map(getMap()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..6eee6490ef6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -42,6 +42,14 @@ public class Model200Response { public Model200Response() { } + /** + * Constructor with all args parameters + */ + public Model200Response(@JsonProperty(JSON_PROPERTY_NAME) Integer name, @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) String propertyClass) { + this.name = name; + this.propertyClass = propertyClass; + } + public Model200Response name(Integer name) { this.name = name; @@ -67,7 +75,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; @@ -132,5 +139,64 @@ public class Model200Response { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Model200Response instance; + + public Builder() { + this(new Model200Response()); + } + + protected Builder(Model200Response instance) { + this.instance = instance; + } + + public Model200Response.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Model200Response.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built Model200Response instance. + * + * The builder is not reusable. + */ + public Model200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Model200Response.Builder builder() { + return new Model200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Model200Response.Builder toBuilder() { + return new Model200Response.Builder() + .name(getName()) + .propertyClass(getPropertyClass()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..90de098a3b1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -46,6 +46,15 @@ public class ModelApiResponse { public ModelApiResponse() { } + /** + * Constructor with all args parameters + */ + public ModelApiResponse(@JsonProperty(JSON_PROPERTY_CODE) Integer code, @JsonProperty(JSON_PROPERTY_TYPE) String type, @JsonProperty(JSON_PROPERTY_MESSAGE) String message) { + this.code = code; + this.type = type; + this.message = message; + } + public ModelApiResponse code(Integer code) { this.code = code; @@ -71,7 +80,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +105,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; @@ -164,5 +171,69 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ModelApiResponse instance; + + public Builder() { + this(new ModelApiResponse()); + } + + protected Builder(ModelApiResponse instance) { + this.instance = instance; + } + + public ModelApiResponse.Builder code(Integer code) { + this.instance.code = code; + return this; + } + public ModelApiResponse.Builder type(String type) { + this.instance.type = type; + return this; + } + public ModelApiResponse.Builder message(String message) { + this.instance.message = message; + return this; + } + + + /** + * returns a built ModelApiResponse instance. + * + * The builder is not reusable. + */ + public ModelApiResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelApiResponse.Builder builder() { + return new ModelApiResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelApiResponse.Builder toBuilder() { + return new ModelApiResponse.Builder() + .code(getCode()) + .type(getType()) + .message(getMessage()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java index 771999ef3b7..94bab49dfa7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -38,6 +38,13 @@ public class ModelFile { public ModelFile() { } + /** + * Constructor with all args parameters + */ + public ModelFile(@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) String sourceURI) { + this.sourceURI = sourceURI; + } + public ModelFile sourceURI(String sourceURI) { this.sourceURI = sourceURI; @@ -100,5 +107,59 @@ public class ModelFile { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ModelFile instance; + + public Builder() { + this(new ModelFile()); + } + + protected Builder(ModelFile instance) { + this.instance = instance; + } + + public ModelFile.Builder sourceURI(String sourceURI) { + this.instance.sourceURI = sourceURI; + return this; + } + + + /** + * returns a built ModelFile instance. + * + * The builder is not reusable. + */ + public ModelFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelFile.Builder builder() { + return new ModelFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelFile.Builder toBuilder() { + return new ModelFile.Builder() + .sourceURI(getSourceURI()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java index a1698002f7b..76eb515b5a2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -38,6 +38,13 @@ public class ModelList { public ModelList() { } + /** + * Constructor with all args parameters + */ + public ModelList(@JsonProperty(JSON_PROPERTY_123LIST) String _123list) { + this._123list = _123list; + } + public ModelList _123list(String _123list) { this._123list = _123list; @@ -100,5 +107,59 @@ public class ModelList { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ModelList instance; + + public Builder() { + this(new ModelList()); + } + + protected Builder(ModelList instance) { + this.instance = instance; + } + + public ModelList.Builder _123list(String _123list) { + this.instance._123list = _123list; + return this; + } + + + /** + * returns a built ModelList instance. + * + * The builder is not reusable. + */ + public ModelList build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelList.Builder builder() { + return new ModelList.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelList.Builder toBuilder() { + return new ModelList.Builder() + ._123list(get123list()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 8aabaea3780..8b27c484888 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -38,6 +38,13 @@ public class ModelReturn { public ModelReturn() { } + /** + * Constructor with all args parameters + */ + public ModelReturn(@JsonProperty(JSON_PROPERTY_RETURN) Integer _return) { + this._return = _return; + } + public ModelReturn _return(Integer _return) { this._return = _return; @@ -100,5 +107,59 @@ public class ModelReturn { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ModelReturn instance; + + public Builder() { + this(new ModelReturn()); + } + + protected Builder(ModelReturn instance) { + this.instance = instance; + } + + public ModelReturn.Builder _return(Integer _return) { + this.instance._return = _return; + return this; + } + + + /** + * returns a built ModelReturn instance. + * + * The builder is not reusable. + */ + public ModelReturn build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelReturn.Builder builder() { + return new ModelReturn.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelReturn.Builder toBuilder() { + return new ModelReturn.Builder() + ._return(getReturn()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..0abc898a643 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -59,6 +61,16 @@ public class Name { this._123number = _123number; } + /** + * Constructor with all args parameters + */ + public Name(@JsonProperty(JSON_PROPERTY_NAME) Integer name, @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @JsonProperty(JSON_PROPERTY_PROPERTY) String property, @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number) { + this.name = name; + this.snakeCase = snakeCase; + this.property = property; + this._123number = _123number; + } + public Name name(Integer name) { this.name = name; @@ -84,7 +96,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +110,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +135,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number @@ -183,5 +192,74 @@ public class Name { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Name instance; + + public Builder() { + this(new Name()); + } + + protected Builder(Name instance) { + this.instance = instance; + } + + public Name.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Name.Builder snakeCase(Integer snakeCase) { + this.instance.snakeCase = snakeCase; + return this; + } + public Name.Builder property(String property) { + this.instance.property = property; + return this; + } + public Name.Builder _123number(Integer _123number) { + this.instance._123number = _123number; + return this; + } + + + /** + * returns a built Name instance. + * + * The builder is not reusable. + */ + public Name build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Name.Builder builder() { + return new Name.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Name.Builder toBuilder() { + return new Name.Builder() + .name(getName()) + .snakeCase(getSnakeCase()) + .property(getProperty()) + ._123number(get123number()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java index 01b6bc8f2a9..c2483aaa7b9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java @@ -94,6 +94,25 @@ public class NullableClass extends HashMap { } + /** + * Constructor with all args parameters + */ + public NullableClass(@JsonProperty(JSON_PROPERTY_INTEGER_PROP) Integer integerProp, @JsonProperty(JSON_PROPERTY_NUMBER_PROP) BigDecimal numberProp, @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) Boolean booleanProp, @JsonProperty(JSON_PROPERTY_STRING_PROP) String stringProp, @JsonProperty(JSON_PROPERTY_DATE_PROP) LocalDate dateProp, @JsonProperty(JSON_PROPERTY_DATETIME_PROP) OffsetDateTime datetimeProp, @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) List arrayNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) List arrayAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) List arrayItemsNullable, @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) Map objectNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) Map objectAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) Map objectItemsNullable) { + super(); + this.integerProp = integerProp == null ? JsonNullable.undefined() : JsonNullable.of(integerProp); + this.numberProp = numberProp == null ? JsonNullable.undefined() : JsonNullable.of(numberProp); + this.booleanProp = booleanProp == null ? JsonNullable.undefined() : JsonNullable.of(booleanProp); + this.stringProp = stringProp == null ? JsonNullable.undefined() : JsonNullable.of(stringProp); + this.dateProp = dateProp == null ? JsonNullable.undefined() : JsonNullable.of(dateProp); + this.datetimeProp = datetimeProp == null ? JsonNullable.undefined() : JsonNullable.of(datetimeProp); + this.arrayNullableProp = arrayNullableProp == null ? JsonNullable.>undefined() : JsonNullable.of(arrayNullableProp); + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp == null ? JsonNullable.>undefined() : JsonNullable.of(arrayAndItemsNullableProp); + this.arrayItemsNullable = arrayItemsNullable; + this.objectNullableProp = objectNullableProp == null ? JsonNullable.>undefined() : JsonNullable.of(objectNullableProp); + this.objectAndItemsNullableProp = objectAndItemsNullableProp == null ? JsonNullable.>undefined() : JsonNullable.of(objectAndItemsNullableProp); + this.objectItemsNullable = objectItemsNullable; + } + public NullableClass integerProp(Integer integerProp) { this.integerProp = JsonNullable.of(integerProp); @@ -127,7 +146,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -161,7 +179,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -195,7 +212,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -229,7 +245,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -263,7 +278,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -297,7 +311,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -343,7 +356,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -389,7 +401,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -423,7 +434,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -469,7 +479,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -515,7 +524,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; @@ -621,5 +629,154 @@ public class NullableClass extends HashMap { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private NullableClass instance; + + public Builder() { + this(new NullableClass()); + } + + protected Builder(NullableClass instance) { + this.instance = instance; + } + + public NullableClass.Builder integerProp(Integer integerProp) { + this.instance.integerProp = JsonNullable.of(integerProp); + return this; + } + public NullableClass.Builder integerProp(JsonNullable integerProp) { + this.instance.integerProp = integerProp; + return this; + } + public NullableClass.Builder numberProp(BigDecimal numberProp) { + this.instance.numberProp = JsonNullable.of(numberProp); + return this; + } + public NullableClass.Builder numberProp(JsonNullable numberProp) { + this.instance.numberProp = numberProp; + return this; + } + public NullableClass.Builder booleanProp(Boolean booleanProp) { + this.instance.booleanProp = JsonNullable.of(booleanProp); + return this; + } + public NullableClass.Builder booleanProp(JsonNullable booleanProp) { + this.instance.booleanProp = booleanProp; + return this; + } + public NullableClass.Builder stringProp(String stringProp) { + this.instance.stringProp = JsonNullable.of(stringProp); + return this; + } + public NullableClass.Builder stringProp(JsonNullable stringProp) { + this.instance.stringProp = stringProp; + return this; + } + public NullableClass.Builder dateProp(LocalDate dateProp) { + this.instance.dateProp = JsonNullable.of(dateProp); + return this; + } + public NullableClass.Builder dateProp(JsonNullable dateProp) { + this.instance.dateProp = dateProp; + return this; + } + public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) { + this.instance.datetimeProp = JsonNullable.of(datetimeProp); + return this; + } + public NullableClass.Builder datetimeProp(JsonNullable datetimeProp) { + this.instance.datetimeProp = datetimeProp; + return this; + } + public NullableClass.Builder arrayNullableProp(List arrayNullableProp) { + this.instance.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + return this; + } + public NullableClass.Builder arrayNullableProp(JsonNullable> arrayNullableProp) { + this.instance.arrayNullableProp = arrayNullableProp; + return this; + } + public NullableClass.Builder arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.instance.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + return this; + } + public NullableClass.Builder arrayAndItemsNullableProp(JsonNullable> arrayAndItemsNullableProp) { + this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + public NullableClass.Builder arrayItemsNullable(List arrayItemsNullable) { + this.instance.arrayItemsNullable = arrayItemsNullable; + return this; + } + public NullableClass.Builder objectNullableProp(Map objectNullableProp) { + this.instance.objectNullableProp = JsonNullable.>of(objectNullableProp); + return this; + } + public NullableClass.Builder objectNullableProp(JsonNullable> objectNullableProp) { + this.instance.objectNullableProp = objectNullableProp; + return this; + } + public NullableClass.Builder objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.instance.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); + return this; + } + public NullableClass.Builder objectAndItemsNullableProp(JsonNullable> objectAndItemsNullableProp) { + this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + public NullableClass.Builder objectItemsNullable(Map objectItemsNullable) { + this.instance.objectItemsNullable = objectItemsNullable; + return this; + } + + + /** + * returns a built NullableClass instance. + * + * The builder is not reusable. + */ + public NullableClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NullableClass.Builder builder() { + return new NullableClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NullableClass.Builder toBuilder() { + return new NullableClass.Builder() + .integerProp(getIntegerProp()) + .numberProp(getNumberProp()) + .booleanProp(getBooleanProp()) + .stringProp(getStringProp()) + .dateProp(getDateProp()) + .datetimeProp(getDatetimeProp()) + .arrayNullableProp(getArrayNullableProp()) + .arrayAndItemsNullableProp(getArrayAndItemsNullableProp()) + .arrayItemsNullable(getArrayItemsNullable()) + .objectNullableProp(getObjectNullableProp()) + .objectAndItemsNullableProp(getObjectAndItemsNullableProp()) + .objectItemsNullable(getObjectItemsNullable()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 57d9e315d4f..96c4017ee89 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -38,6 +38,13 @@ public class NumberOnly { public NumberOnly() { } + /** + * Constructor with all args parameters + */ + public NumberOnly(@JsonProperty(JSON_PROPERTY_JUST_NUMBER) BigDecimal justNumber) { + this.justNumber = justNumber; + } + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; @@ -100,5 +107,59 @@ public class NumberOnly { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private NumberOnly instance; + + public Builder() { + this(new NumberOnly()); + } + + protected Builder(NumberOnly instance) { + this.instance = instance; + } + + public NumberOnly.Builder justNumber(BigDecimal justNumber) { + this.instance.justNumber = justNumber; + return this; + } + + + /** + * returns a built NumberOnly instance. + * + * The builder is not reusable. + */ + public NumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NumberOnly.Builder builder() { + return new NumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NumberOnly.Builder toBuilder() { + return new NumberOnly.Builder() + .justNumber(getJustNumber()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index d28ddafb90b..58f8db806f7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -54,6 +54,16 @@ public class ObjectWithDeprecatedFields { public ObjectWithDeprecatedFields() { } + /** + * Constructor with all args parameters + */ + public ObjectWithDeprecatedFields(@JsonProperty(JSON_PROPERTY_UUID) String uuid, @JsonProperty(JSON_PROPERTY_ID) BigDecimal id, @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) DeprecatedObject deprecatedRef, @JsonProperty(JSON_PROPERTY_BARS) List bars) { + this.uuid = uuid; + this.id = id; + this.deprecatedRef = deprecatedRef; + this.bars = bars; + } + public ObjectWithDeprecatedFields uuid(String uuid) { this.uuid = uuid; @@ -79,7 +89,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -107,7 +116,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -135,7 +143,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; @@ -214,5 +221,74 @@ public class ObjectWithDeprecatedFields { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ObjectWithDeprecatedFields instance; + + public Builder() { + this(new ObjectWithDeprecatedFields()); + } + + protected Builder(ObjectWithDeprecatedFields instance) { + this.instance = instance; + } + + public ObjectWithDeprecatedFields.Builder uuid(String uuid) { + this.instance.uuid = uuid; + return this; + } + public ObjectWithDeprecatedFields.Builder id(BigDecimal id) { + this.instance.id = id; + return this; + } + public ObjectWithDeprecatedFields.Builder deprecatedRef(DeprecatedObject deprecatedRef) { + this.instance.deprecatedRef = deprecatedRef; + return this; + } + public ObjectWithDeprecatedFields.Builder bars(List bars) { + this.instance.bars = bars; + return this; + } + + + /** + * returns a built ObjectWithDeprecatedFields instance. + * + * The builder is not reusable. + */ + public ObjectWithDeprecatedFields build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ObjectWithDeprecatedFields.Builder builder() { + return new ObjectWithDeprecatedFields.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ObjectWithDeprecatedFields.Builder toBuilder() { + return new ObjectWithDeprecatedFields.Builder() + .uuid(getUuid()) + .id(getId()) + .deprecatedRef(getDeprecatedRef()) + .bars(getBars()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..24162db7c62 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -95,6 +95,18 @@ public class Order { public Order() { } + /** + * Constructor with all args parameters + */ + public Order(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_PET_ID) Long petId, @JsonProperty(JSON_PROPERTY_QUANTITY) Integer quantity, @JsonProperty(JSON_PROPERTY_SHIP_DATE) OffsetDateTime shipDate, @JsonProperty(JSON_PROPERTY_STATUS) StatusEnum status, @JsonProperty(JSON_PROPERTY_COMPLETE) Boolean complete) { + this.id = id; + this.petId = petId; + this.quantity = quantity; + this.shipDate = shipDate; + this.status = status; + this.complete = complete; + } + public Order id(Long id) { this.id = id; @@ -120,7 +132,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +157,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +182,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +207,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +232,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; @@ -297,5 +304,84 @@ public class Order { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Order instance; + + public Builder() { + this(new Order()); + } + + protected Builder(Order instance) { + this.instance = instance; + } + + public Order.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Order.Builder petId(Long petId) { + this.instance.petId = petId; + return this; + } + public Order.Builder quantity(Integer quantity) { + this.instance.quantity = quantity; + return this; + } + public Order.Builder shipDate(OffsetDateTime shipDate) { + this.instance.shipDate = shipDate; + return this; + } + public Order.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + public Order.Builder complete(Boolean complete) { + this.instance.complete = complete; + return this; + } + + + /** + * returns a built Order instance. + * + * The builder is not reusable. + */ + public Order build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Order.Builder builder() { + return new Order.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Order.Builder toBuilder() { + return new Order.Builder() + .id(getId()) + .petId(getPetId()) + .quantity(getQuantity()) + .shipDate(getShipDate()) + .status(getStatus()) + .complete(getComplete()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..3a57fc43ad4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -46,6 +46,15 @@ public class OuterComposite { public OuterComposite() { } + /** + * Constructor with all args parameters + */ + public OuterComposite(@JsonProperty(JSON_PROPERTY_MY_NUMBER) BigDecimal myNumber, @JsonProperty(JSON_PROPERTY_MY_STRING) String myString, @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) Boolean myBoolean) { + this.myNumber = myNumber; + this.myString = myString; + this.myBoolean = myBoolean; + } + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; @@ -71,7 +80,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +105,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; @@ -164,5 +171,69 @@ public class OuterComposite { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private OuterComposite instance; + + public Builder() { + this(new OuterComposite()); + } + + protected Builder(OuterComposite instance) { + this.instance = instance; + } + + public OuterComposite.Builder myNumber(BigDecimal myNumber) { + this.instance.myNumber = myNumber; + return this; + } + public OuterComposite.Builder myString(String myString) { + this.instance.myString = myString; + return this; + } + public OuterComposite.Builder myBoolean(Boolean myBoolean) { + this.instance.myBoolean = myBoolean; + return this; + } + + + /** + * returns a built OuterComposite instance. + * + * The builder is not reusable. + */ + public OuterComposite build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OuterComposite.Builder builder() { + return new OuterComposite.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OuterComposite.Builder toBuilder() { + return new OuterComposite.Builder() + .myNumber(getMyNumber()) + .myString(getMyString()) + .myBoolean(getMyBoolean()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 9a077aa0970..b7b6b6175c2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -38,6 +38,13 @@ public class OuterObjectWithEnumProperty { public OuterObjectWithEnumProperty() { } + /** + * Constructor with all args parameters + */ + public OuterObjectWithEnumProperty(@JsonProperty(JSON_PROPERTY_VALUE) OuterEnumInteger value) { + this.value = value; + } + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { this.value = value; @@ -100,5 +107,59 @@ public class OuterObjectWithEnumProperty { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private OuterObjectWithEnumProperty instance; + + public Builder() { + this(new OuterObjectWithEnumProperty()); + } + + protected Builder(OuterObjectWithEnumProperty instance) { + this.instance = instance; + } + + public OuterObjectWithEnumProperty.Builder value(OuterEnumInteger value) { + this.instance.value = value; + return this; + } + + + /** + * returns a built OuterObjectWithEnumProperty instance. + * + * The builder is not reusable. + */ + public OuterObjectWithEnumProperty build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OuterObjectWithEnumProperty.Builder builder() { + return new OuterObjectWithEnumProperty.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OuterObjectWithEnumProperty.Builder toBuilder() { + return new OuterObjectWithEnumProperty.Builder() + .value(getValue()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java index e3705e43937..b108cbf6ea4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -85,11 +85,19 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } + /** + * Constructor with all args parameters + */ + public ParentWithNullable(@JsonProperty(JSON_PROPERTY_TYPE) TypeEnum type, @JsonProperty(JSON_PROPERTY_NULLABLE_PROPERTY) String nullableProperty) { + this.type = type; + this.nullableProperty = nullableProperty == null ? JsonNullable.undefined() : JsonNullable.of(nullableProperty); + } + public ParentWithNullable type(TypeEnum type) { this.type = type; @@ -115,7 +123,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); @@ -199,5 +206,68 @@ public class ParentWithNullable { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ParentWithNullable instance; + + public Builder() { + this(new ParentWithNullable()); + } + + protected Builder(ParentWithNullable instance) { + this.instance = instance; + } + + public ParentWithNullable.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public ParentWithNullable.Builder nullableProperty(String nullableProperty) { + this.instance.nullableProperty = JsonNullable.of(nullableProperty); + return this; + } + public ParentWithNullable.Builder nullableProperty(JsonNullable nullableProperty) { + this.instance.nullableProperty = nullableProperty; + return this; + } + + + /** + * returns a built ParentWithNullable instance. + * + * The builder is not reusable. + */ + public ParentWithNullable build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ParentWithNullable.Builder builder() { + return new ParentWithNullable.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentWithNullable.Builder toBuilder() { + return new ParentWithNullable.Builder() + .type(getType()) + .nullableProperty(getNullableProperty()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index ca0962d2e5b..edc9f16a7f2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -102,6 +102,18 @@ public class Pet { public Pet() { } + /** + * Constructor with all args parameters + */ + public Pet(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_CATEGORY) Category category, @JsonProperty(JSON_PROPERTY_NAME) String name, @JsonProperty(JSON_PROPERTY_PHOTO_URLS) Set photoUrls, @JsonProperty(JSON_PROPERTY_TAGS) List tags, @JsonProperty(JSON_PROPERTY_STATUS) StatusEnum status) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + public Pet id(Long id) { this.id = id; @@ -127,7 +139,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +164,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +189,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +223,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +256,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; @@ -321,5 +328,84 @@ public class Pet { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Pet instance; + + public Builder() { + this(new Pet()); + } + + protected Builder(Pet instance) { + this.instance = instance; + } + + public Pet.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Pet.Builder category(Category category) { + this.instance.category = category; + return this; + } + public Pet.Builder name(String name) { + this.instance.name = name; + return this; + } + public Pet.Builder photoUrls(Set photoUrls) { + this.instance.photoUrls = photoUrls; + return this; + } + public Pet.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + public Pet.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + + + /** + * returns a built Pet instance. + * + * The builder is not reusable. + */ + public Pet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Pet.Builder builder() { + return new Pet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pet.Builder toBuilder() { + return new Pet.Builder() + .id(getId()) + .category(getCategory()) + .name(getName()) + .photoUrls(getPhotoUrls()) + .tags(getTags()) + .status(getStatus()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d74cc836731 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -49,6 +51,14 @@ public class ReadOnlyFirst { this.bar = bar; } + /** + * Constructor with all args parameters + */ + public ReadOnlyFirst(@JsonProperty(JSON_PROPERTY_BAR) String bar, @JsonProperty(JSON_PROPERTY_BAZ) String baz) { + this.bar = bar; + this.baz = baz; + } + /** * Get bar * @return bar @@ -63,7 +73,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; @@ -128,5 +137,64 @@ public class ReadOnlyFirst { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private ReadOnlyFirst instance; + + public Builder() { + this(new ReadOnlyFirst()); + } + + protected Builder(ReadOnlyFirst instance) { + this.instance = instance; + } + + public ReadOnlyFirst.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public ReadOnlyFirst.Builder baz(String baz) { + this.instance.baz = baz; + return this; + } + + + /** + * returns a built ReadOnlyFirst instance. + * + * The builder is not reusable. + */ + public ReadOnlyFirst build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ReadOnlyFirst.Builder builder() { + return new ReadOnlyFirst.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadOnlyFirst.Builder toBuilder() { + return new ReadOnlyFirst.Builder() + .bar(getBar()) + .baz(getBaz()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index 26f99ed95e6..7651df76be9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -38,6 +38,13 @@ public class SpecialModelName { public SpecialModelName() { } + /** + * Constructor with all args parameters + */ + public SpecialModelName(@JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; @@ -100,5 +107,59 @@ public class SpecialModelName { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private SpecialModelName instance; + + public Builder() { + this(new SpecialModelName()); + } + + protected Builder(SpecialModelName instance) { + this.instance = instance; + } + + public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) { + this.instance.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * returns a built SpecialModelName instance. + * + * The builder is not reusable. + */ + public SpecialModelName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SpecialModelName.Builder builder() { + return new SpecialModelName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialModelName.Builder toBuilder() { + return new SpecialModelName.Builder() + .$specialPropertyName(get$SpecialPropertyName()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..1e0942a8f47 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -41,6 +41,14 @@ public class Tag { public Tag() { } + /** + * Constructor with all args parameters + */ + public Tag(@JsonProperty(JSON_PROPERTY_ID) Long id, @JsonProperty(JSON_PROPERTY_NAME) String name) { + this.id = id; + this.name = name; + } + public Tag id(Long id) { this.id = id; @@ -66,7 +74,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; @@ -131,5 +138,64 @@ public class Tag { return o.toString().replace("\n", "\n "); } + public static class Builder { + + private Tag instance; + + public Builder() { + this(new Tag()); + } + + protected Builder(Tag instance) { + this.instance = instance; + } + + public Tag.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Tag.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Tag instance. + * + * The builder is not reusable. + */ + public Tag build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Tag.Builder builder() { + return new Tag.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Tag.Builder toBuilder() { + return new Tag.Builder() + .id(getId()) + .name(getName()); + } + + } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0d37480fa3f..40747d4d557 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -41,6 +41,14 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/retrofit2-play26/gradlew.bat b/samples/client/petstore/java/retrofit2-play26/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/retrofit2-play26/gradlew.bat +++ b/samples/client/petstore/java/retrofit2-play26/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index bba36e92e33..a933da27912 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -117,7 +117,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -153,7 +152,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -188,7 +186,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -223,7 +220,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -259,7 +255,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -295,7 +290,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -331,7 +325,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -367,7 +360,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -394,7 +386,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -421,7 +412,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 7f13f2c53ed..68b0e8f5c91 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -52,7 +52,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -84,7 +84,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index d7b0bf895d5..830eee3cbd2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -85,7 +85,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -121,7 +120,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index f3c61d9ba16..c3d7ca473c5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -85,7 +85,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -112,7 +111,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -139,7 +137,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -166,7 +163,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -193,7 +189,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index 4ae10f6c25b..0702a4e4b91 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -47,7 +47,7 @@ import jakarta.validation.Valid; public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 114b3a872c9..116fe04bf20 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -69,7 +69,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 5552f313a9a..402847e9c8d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -142,7 +142,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index 3609d770cdd..e046bf275b0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -227,7 +227,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -255,7 +254,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -282,7 +280,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -309,7 +306,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 39730e5a2a8..732ab8fbe34 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -74,7 +74,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List<@Valid ModelFile> files) { this.files = files; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index cd64283b9a5..bc87e89136e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -125,7 +125,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -154,7 +153,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -181,7 +179,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +209,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -241,7 +237,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -270,7 +265,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -297,7 +291,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -325,7 +318,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -353,7 +345,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -382,7 +373,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -410,7 +400,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -438,7 +427,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -466,7 +454,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 3b55be668ef..643809d2c31 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -43,7 +43,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -69,7 +71,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 0be17a23a63..f68ec4df914 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -123,7 +123,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -158,7 +157,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -193,7 +191,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9b7f2b19940..ebf89a2463a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -79,7 +79,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -107,7 +106,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index acdb11d3dad..5e373830d04 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -70,7 +70,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 3a4d3edacd6..b46efb531bc 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -74,7 +74,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -101,7 +100,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 57a3b04d751..af284016f17 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -50,7 +50,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -88,7 +90,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -104,7 +105,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -131,7 +131,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index 853cb08be8a..7313e8ad8d8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -123,7 +123,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -150,7 +149,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -177,7 +175,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -205,7 +202,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -232,7 +228,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index e58c9a3c8ba..e23424c36bd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -75,7 +75,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -102,7 +101,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 8d05df09618..a5b395f3e16 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -130,7 +130,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -158,7 +157,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -186,7 +184,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -223,7 +220,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List<@Valid Tag> tags) { this.tags = tags; @@ -259,7 +255,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 25646e855a5..8341211432b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -42,7 +42,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -66,7 +68,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index b9fe947d0fd..2d769878e57 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -69,7 +69,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 4753b7d9768..38647bdab8f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -86,7 +86,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -115,7 +114,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -143,7 +141,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -171,7 +168,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d67013289e4..e3d89fcb283 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -90,7 +90,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -119,7 +118,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -147,7 +145,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -175,7 +172,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -203,7 +199,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index 95a62ceb080..5732783a30b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -93,7 +93,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -120,7 +119,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -147,7 +145,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -174,7 +171,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -201,7 +197,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -228,7 +223,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -255,7 +249,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index 1122eaf273c..4f236d780d5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -181,7 +181,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -209,7 +208,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -236,7 +234,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -263,7 +260,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -298,7 +294,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -325,7 +320,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -353,7 +347,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -380,7 +373,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -407,7 +399,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -442,7 +433,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -477,7 +467,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -504,7 +493,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -532,7 +520,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -559,7 +546,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -586,7 +572,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -621,7 +606,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -656,7 +640,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -683,7 +666,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -711,7 +693,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -738,7 +719,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -765,7 +745,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -800,7 +779,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -835,7 +813,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -862,7 +839,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -890,7 +866,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -917,7 +892,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -944,7 +918,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -979,7 +952,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml +++ b/samples/client/petstore/java/retrofit2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/retrofit2/gradlew b/samples/client/petstore/java/retrofit2/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/retrofit2/gradlew +++ b/samples/client/petstore/java/retrofit2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/retrofit2/gradlew.bat b/samples/client/petstore/java/retrofit2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/retrofit2/gradlew.bat +++ b/samples/client/petstore/java/retrofit2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 152e1381603..cc4e35b8534 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -107,7 +107,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -137,7 +136,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -167,7 +165,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -197,7 +194,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -227,7 +223,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -257,7 +252,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -287,7 +281,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -317,7 +310,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -339,7 +331,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -361,7 +352,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java index 5527351f1dc..42bfd3e8f78 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ public class Animal { public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -59,7 +59,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java index 3b38c83ad11..d32703c6a35 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -75,7 +75,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -105,7 +104,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java index d717bece888..5754da56c1a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -75,7 +75,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -97,7 +96,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -119,7 +117,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -141,7 +138,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -163,7 +159,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java index f529cb83d3a..2facf39b805 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,7 @@ import org.openapitools.client.model.Animal; public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java index 99e03cdac01..175c4272671 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java @@ -59,7 +59,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java index edd7d5f5c59..bb1b5af5ec2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -156,7 +156,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 9ac5fb513df..cf7152d7b74 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -264,7 +264,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -286,7 +285,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -308,7 +306,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -330,7 +327,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ed1ed57d4fc..58470d89d2c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -63,7 +63,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java index c01d2777129..6558de31c11 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -114,7 +114,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -138,7 +137,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -160,7 +158,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -184,7 +181,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -208,7 +204,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -232,7 +227,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -254,7 +248,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -276,7 +269,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -298,7 +290,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -320,7 +311,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -342,7 +332,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -364,7 +353,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -386,7 +374,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index dd9a2164062..7b36ff52a99 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,7 +37,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -60,7 +62,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index 012255d9a6d..35c12d819b6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -124,7 +124,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -154,7 +153,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -184,7 +182,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f768e6be6ad..3ea68ff1cde 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,7 +68,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -90,7 +89,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java index 333bbf6e72d..568e11bb99d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -59,7 +59,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5c96ae62e6a..8b0bae353e6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -63,7 +63,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -85,7 +84,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java index 51b16ffba1d..abd4b6b520e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java @@ -45,7 +45,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -77,7 +79,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -90,7 +91,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -112,7 +112,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java index da8e7b81292..ddfe93fb538 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java @@ -125,7 +125,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -147,7 +146,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -169,7 +167,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -191,7 +188,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -213,7 +209,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java index 07cf49a6545..29cad25a60a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -64,7 +64,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -86,7 +85,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index 4cf10766871..a3589f3a3a2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -131,7 +131,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -175,7 +173,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -205,7 +202,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -235,7 +231,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1e57b7124f2..b7e9397bb92 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,7 +37,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -58,7 +60,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java index e9a38647a05..c5a553b77db 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java @@ -59,7 +59,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 2de3bc9d908..5ecc2f60e07 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -75,7 +75,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -97,7 +96,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -119,7 +117,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -141,7 +138,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 5bb60d794d3..3f3671dc58e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -79,7 +79,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -101,7 +100,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -123,7 +121,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -145,7 +142,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -167,7 +163,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java index 6de8823bb90..a450c67dfa8 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java @@ -83,7 +83,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -105,7 +104,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -127,7 +125,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -149,7 +146,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -171,7 +167,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -193,7 +188,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -215,7 +209,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java index 689624d6364..1ac473f9da6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -171,7 +171,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -193,7 +192,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -215,7 +213,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -237,7 +234,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -267,7 +263,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -289,7 +284,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -311,7 +305,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -333,7 +326,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -355,7 +347,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -385,7 +376,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -415,7 +405,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -437,7 +426,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -459,7 +447,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -481,7 +468,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -503,7 +489,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -533,7 +518,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -563,7 +547,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -585,7 +568,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -607,7 +589,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -629,7 +610,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -651,7 +631,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -681,7 +660,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -711,7 +689,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -733,7 +710,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -755,7 +731,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -777,7 +752,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -799,7 +773,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -829,7 +802,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml +++ b/samples/client/petstore/java/retrofit2rx2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/retrofit2rx2/gradlew b/samples/client/petstore/java/retrofit2rx2/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/retrofit2rx2/gradlew +++ b/samples/client/petstore/java/retrofit2rx2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/retrofit2rx2/gradlew.bat b/samples/client/petstore/java/retrofit2rx2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/retrofit2rx2/gradlew.bat +++ b/samples/client/petstore/java/retrofit2rx2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 152e1381603..cc4e35b8534 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -107,7 +107,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -137,7 +136,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -167,7 +165,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -197,7 +194,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -227,7 +223,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -257,7 +252,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -287,7 +281,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -317,7 +310,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -339,7 +331,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -361,7 +352,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java index 5527351f1dc..42bfd3e8f78 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ public class Animal { public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -59,7 +59,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java index 3b38c83ad11..d32703c6a35 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -75,7 +75,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -105,7 +104,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java index d717bece888..5754da56c1a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -75,7 +75,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -97,7 +96,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -119,7 +117,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -141,7 +138,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -163,7 +159,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java index f529cb83d3a..2facf39b805 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,7 @@ import org.openapitools.client.model.Animal; public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java index 99e03cdac01..175c4272671 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java @@ -59,7 +59,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java index edd7d5f5c59..bb1b5af5ec2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -156,7 +156,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 9ac5fb513df..cf7152d7b74 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -264,7 +264,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -286,7 +285,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -308,7 +306,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -330,7 +327,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ed1ed57d4fc..58470d89d2c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -63,7 +63,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java index c01d2777129..6558de31c11 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -114,7 +114,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -138,7 +137,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -160,7 +158,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -184,7 +181,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -208,7 +204,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -232,7 +227,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -254,7 +248,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -276,7 +269,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -298,7 +290,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -320,7 +311,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -342,7 +332,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -364,7 +353,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -386,7 +374,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index dd9a2164062..7b36ff52a99 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,7 +37,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -60,7 +62,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index 012255d9a6d..35c12d819b6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -124,7 +124,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -154,7 +153,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -184,7 +182,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f768e6be6ad..3ea68ff1cde 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,7 +68,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -90,7 +89,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java index 333bbf6e72d..568e11bb99d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -59,7 +59,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5c96ae62e6a..8b0bae353e6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -63,7 +63,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -85,7 +84,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java index 51b16ffba1d..abd4b6b520e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java @@ -45,7 +45,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -77,7 +79,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -90,7 +91,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -112,7 +112,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java index da8e7b81292..ddfe93fb538 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java @@ -125,7 +125,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -147,7 +146,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -169,7 +167,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -191,7 +188,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -213,7 +209,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java index 07cf49a6545..29cad25a60a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -64,7 +64,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -86,7 +85,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index 4cf10766871..a3589f3a3a2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -131,7 +131,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -175,7 +173,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -205,7 +202,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -235,7 +231,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1e57b7124f2..b7e9397bb92 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,7 +37,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -58,7 +60,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java index e9a38647a05..c5a553b77db 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java @@ -59,7 +59,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 2de3bc9d908..5ecc2f60e07 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -75,7 +75,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -97,7 +96,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -119,7 +117,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -141,7 +138,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 5bb60d794d3..3f3671dc58e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -79,7 +79,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -101,7 +100,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -123,7 +121,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -145,7 +142,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -167,7 +163,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java index 6de8823bb90..a450c67dfa8 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java @@ -83,7 +83,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -105,7 +104,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -127,7 +125,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -149,7 +146,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -171,7 +167,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -193,7 +188,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -215,7 +209,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java index 689624d6364..1ac473f9da6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -171,7 +171,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -193,7 +192,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -215,7 +213,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -237,7 +234,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -267,7 +263,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -289,7 +284,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -311,7 +305,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -333,7 +326,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -355,7 +347,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -385,7 +376,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -415,7 +405,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -437,7 +426,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -459,7 +447,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -481,7 +468,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -503,7 +489,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -533,7 +518,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -563,7 +547,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -585,7 +568,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -607,7 +589,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -629,7 +610,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -651,7 +631,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -681,7 +660,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -711,7 +689,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -733,7 +710,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -755,7 +731,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -777,7 +752,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -799,7 +773,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -829,7 +802,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml b/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml +++ b/samples/client/petstore/java/retrofit2rx3/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/retrofit2rx3/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/retrofit2rx3/gradlew b/samples/client/petstore/java/retrofit2rx3/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/retrofit2rx3/gradlew +++ b/samples/client/petstore/java/retrofit2rx3/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/retrofit2rx3/gradlew.bat b/samples/client/petstore/java/retrofit2rx3/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/retrofit2rx3/gradlew.bat +++ b/samples/client/petstore/java/retrofit2rx3/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 152e1381603..cc4e35b8534 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -107,7 +107,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -137,7 +136,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -167,7 +165,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -197,7 +194,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -227,7 +223,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -257,7 +252,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -287,7 +281,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -317,7 +310,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -339,7 +331,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -361,7 +352,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java index 5527351f1dc..42bfd3e8f78 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ public class Animal { public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -59,7 +59,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java index 3b38c83ad11..d32703c6a35 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -75,7 +75,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -105,7 +104,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java index d717bece888..5754da56c1a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -75,7 +75,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -97,7 +96,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -119,7 +117,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -141,7 +138,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -163,7 +159,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java index f529cb83d3a..2facf39b805 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,7 @@ import org.openapitools.client.model.Animal; public class Cat extends Animal { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java index 99e03cdac01..175c4272671 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java @@ -59,7 +59,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java index edd7d5f5c59..bb1b5af5ec2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -156,7 +156,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index 9ac5fb513df..cf7152d7b74 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -264,7 +264,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -286,7 +285,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -308,7 +306,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -330,7 +327,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ed1ed57d4fc..58470d89d2c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -63,7 +63,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java index c01d2777129..6558de31c11 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -114,7 +114,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -138,7 +137,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -160,7 +158,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -184,7 +181,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -208,7 +204,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -232,7 +227,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -254,7 +248,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -276,7 +269,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -298,7 +290,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -320,7 +311,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -342,7 +332,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -364,7 +353,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -386,7 +374,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index dd9a2164062..7b36ff52a99 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -37,7 +37,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ public HasOnlyReadOnly( String bar, @@ -60,7 +62,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java index 012255d9a6d..35c12d819b6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java @@ -124,7 +124,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -154,7 +153,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -184,7 +182,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f768e6be6ad..3ea68ff1cde 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,7 +68,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -90,7 +89,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java index 333bbf6e72d..568e11bb99d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -59,7 +59,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5c96ae62e6a..8b0bae353e6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -63,7 +63,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -85,7 +84,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java index 51b16ffba1d..abd4b6b520e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java @@ -45,7 +45,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ public Name( Integer snakeCase, @@ -77,7 +79,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -90,7 +91,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -112,7 +112,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java index da8e7b81292..ddfe93fb538 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java @@ -125,7 +125,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -147,7 +146,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -169,7 +167,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -191,7 +188,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -213,7 +209,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java index 07cf49a6545..29cad25a60a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -64,7 +64,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -86,7 +85,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java index 4cf10766871..a3589f3a3a2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java @@ -131,7 +131,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -175,7 +173,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -205,7 +202,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -235,7 +231,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1e57b7124f2..b7e9397bb92 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -37,7 +37,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ public ReadOnlyFirst( String bar @@ -58,7 +60,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java index e9a38647a05..c5a553b77db 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java @@ -59,7 +59,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 2de3bc9d908..5ecc2f60e07 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -75,7 +75,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -97,7 +96,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -119,7 +117,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -141,7 +138,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 5bb60d794d3..3f3671dc58e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -79,7 +79,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -101,7 +100,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -123,7 +121,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -145,7 +142,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -167,7 +163,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java index 6de8823bb90..a450c67dfa8 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java @@ -83,7 +83,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -105,7 +104,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -127,7 +125,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -149,7 +146,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -171,7 +167,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -193,7 +188,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -215,7 +209,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java index 689624d6364..1ac473f9da6 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java @@ -171,7 +171,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -193,7 +192,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -215,7 +213,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -237,7 +234,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -267,7 +263,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -289,7 +284,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -311,7 +305,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -333,7 +326,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -355,7 +347,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -385,7 +376,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -415,7 +405,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -437,7 +426,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -459,7 +447,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -481,7 +468,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -503,7 +489,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -533,7 +518,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -563,7 +547,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -585,7 +568,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -607,7 +589,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -629,7 +610,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -651,7 +631,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -681,7 +660,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -711,7 +689,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -733,7 +710,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -755,7 +731,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -777,7 +752,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -799,7 +773,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -829,7 +802,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml b/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml +++ b/samples/client/petstore/java/vertx-no-nullable/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/vertx-no-nullable/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/vertx-no-nullable/gradlew b/samples/client/petstore/java/vertx-no-nullable/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/vertx-no-nullable/gradlew +++ b/samples/client/petstore/java/vertx-no-nullable/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/vertx-no-nullable/gradlew.bat b/samples/client/petstore/java/vertx-no-nullable/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/vertx-no-nullable/gradlew.bat +++ b/samples/client/petstore/java/vertx-no-nullable/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index 69ca7cabfd4..8798bf4bea6 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -667,54 +667,54 @@ public class ApiClient extends JavaTimeFormatter { private final Map authentications = new LinkedHashMap<>(); - public void addPetstore_authAuthentication(String accessToken) { + public void addPetstoreAuthAuthentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("petstore_auth", auth); } - public void addApi_keyAuthentication(String apikey, String apiKeyPrefix) { + public void addApiKeyAuthentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth("header","api_key"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("api_key", auth); } - public void addApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + public void addApiKeyQueryAuthentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth("query","api_key_query"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("api_key_query", auth); } - public void addHttp_basic_testAuthentication(String username, String password) { + public void addHttpBasicTestAuthentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("http_basic_test", auth); } - public static AuthInfo forPetstore_authAuthentication(String accessToken) { + public static AuthInfo forPetstoreAuthAuthentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.addPetstore_authAuthentication(accessToken); + authInfo.addPetstoreAuthAuthentication(accessToken); return authInfo; } - public static AuthInfo forApi_keyAuthentication(String apikey, String apiKeyPrefix) { + public static AuthInfo forApiKeyAuthentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.addApi_keyAuthentication(apikey, apiKeyPrefix); + authInfo.addApiKeyAuthentication(apikey, apiKeyPrefix); return authInfo; } - public static AuthInfo forApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + public static AuthInfo forApiKeyQueryAuthentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.addApi_key_queryAuthentication(apikey, apiKeyPrefix); + authInfo.addApiKeyQueryAuthentication(apikey, apiKeyPrefix); return authInfo; } - public static AuthInfo forHttp_basic_test(String username, String password) { + public static AuthInfo forHttpBasicTest(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.addHttp_basic_testAuthentication(username, password); + authInfo.addHttpBasicTestAuthentication(username, password); return authInfo; } } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 85f60180cf0..07369d6cefd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -114,7 +114,6 @@ public class AdditionalPropertiesClass { this.mapString = mapString; } - public AdditionalPropertiesClass mapNumber(Map mapNumber) { this.mapNumber = mapNumber; @@ -148,7 +147,6 @@ public class AdditionalPropertiesClass { this.mapNumber = mapNumber; } - public AdditionalPropertiesClass mapInteger(Map mapInteger) { this.mapInteger = mapInteger; @@ -182,7 +180,6 @@ public class AdditionalPropertiesClass { this.mapInteger = mapInteger; } - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { this.mapBoolean = mapBoolean; @@ -216,7 +213,6 @@ public class AdditionalPropertiesClass { this.mapBoolean = mapBoolean; } - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { this.mapArrayInteger = mapArrayInteger; @@ -250,7 +246,6 @@ public class AdditionalPropertiesClass { this.mapArrayInteger = mapArrayInteger; } - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { this.mapArrayAnytype = mapArrayAnytype; @@ -284,7 +279,6 @@ public class AdditionalPropertiesClass { this.mapArrayAnytype = mapArrayAnytype; } - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { this.mapMapString = mapMapString; @@ -318,7 +312,6 @@ public class AdditionalPropertiesClass { this.mapMapString = mapMapString; } - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { this.mapMapAnytype = mapMapAnytype; @@ -352,7 +345,6 @@ public class AdditionalPropertiesClass { this.mapMapAnytype = mapMapAnytype; } - public AdditionalPropertiesClass anytype1(Object anytype1) { this.anytype1 = anytype1; @@ -378,7 +370,6 @@ public class AdditionalPropertiesClass { this.anytype1 = anytype1; } - public AdditionalPropertiesClass anytype2(Object anytype2) { this.anytype2 = anytype2; @@ -404,7 +395,6 @@ public class AdditionalPropertiesClass { this.anytype2 = anytype2; } - public AdditionalPropertiesClass anytype3(Object anytype3) { this.anytype3 = anytype3; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index d30c63a276a..711644819bf 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -50,7 +50,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -80,7 +80,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 154e6cc2374..41b29a30249 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..accb755a668 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 892a7af3b94..121bba4519c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -45,7 +45,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + protected Boolean declawed; public Cat() { diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..ed8e1e2da05 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index f03d7aefbce..58a77ffded8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 49835bfbd44..53ee553f740 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -224,7 +224,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -250,7 +249,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -276,7 +274,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -302,7 +299,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f4f44fa76aa..e149084b1a5 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 0535bc52a7a..f502fee0984 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -122,7 +122,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -150,7 +149,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -176,7 +174,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -204,7 +201,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -232,7 +228,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -260,7 +255,6 @@ public class FormatTest { this._double = _double; } - public FormatTest string(String string) { this.string = string; @@ -286,7 +280,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -312,7 +305,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(AsyncFile binary) { this.binary = binary; @@ -338,7 +330,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -364,7 +355,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -390,7 +380,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -416,7 +405,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -442,7 +430,6 @@ public class FormatTest { this.password = password; } - public FormatTest bigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..9fc24a2b7f4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 2b1642eb26e..136e37557dd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e059b95f066..4ec2bb53611 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..517b2eb9f07 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..c8f27c57192 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..458314f0d83 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..05dfbdaeefa 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..7045f92dd8f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index f3978908526..180ee4787ba 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d585c01ecc3 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..201029ba21a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 31061ea6669..579da79a3e7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -82,7 +82,6 @@ public class TypeHolderDefault { this.stringItem = stringItem; } - public TypeHolderDefault numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -108,7 +107,6 @@ public class TypeHolderDefault { this.numberItem = numberItem; } - public TypeHolderDefault integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -134,7 +132,6 @@ public class TypeHolderDefault { this.integerItem = integerItem; } - public TypeHolderDefault boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -160,7 +157,6 @@ public class TypeHolderDefault { this.boolItem = boolItem; } - public TypeHolderDefault arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index aa5f1182b3e..4fb1973cb1b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -86,7 +86,6 @@ public class TypeHolderExample { this.stringItem = stringItem; } - public TypeHolderExample numberItem(BigDecimal numberItem) { this.numberItem = numberItem; @@ -112,7 +111,6 @@ public class TypeHolderExample { this.numberItem = numberItem; } - public TypeHolderExample floatItem(Float floatItem) { this.floatItem = floatItem; @@ -138,7 +136,6 @@ public class TypeHolderExample { this.floatItem = floatItem; } - public TypeHolderExample integerItem(Integer integerItem) { this.integerItem = integerItem; @@ -164,7 +161,6 @@ public class TypeHolderExample { this.integerItem = integerItem; } - public TypeHolderExample boolItem(Boolean boolItem) { this.boolItem = boolItem; @@ -190,7 +186,6 @@ public class TypeHolderExample { this.boolItem = boolItem; } - public TypeHolderExample arrayItem(List arrayItem) { this.arrayItem = arrayItem; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java index 8ed799606d5..b501d23345c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 841129b4231..92837b71b1c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -178,7 +178,6 @@ public class XmlItem { this.attributeString = attributeString; } - public XmlItem attributeNumber(BigDecimal attributeNumber) { this.attributeNumber = attributeNumber; @@ -204,7 +203,6 @@ public class XmlItem { this.attributeNumber = attributeNumber; } - public XmlItem attributeInteger(Integer attributeInteger) { this.attributeInteger = attributeInteger; @@ -230,7 +228,6 @@ public class XmlItem { this.attributeInteger = attributeInteger; } - public XmlItem attributeBoolean(Boolean attributeBoolean) { this.attributeBoolean = attributeBoolean; @@ -256,7 +253,6 @@ public class XmlItem { this.attributeBoolean = attributeBoolean; } - public XmlItem wrappedArray(List wrappedArray) { this.wrappedArray = wrappedArray; @@ -290,7 +286,6 @@ public class XmlItem { this.wrappedArray = wrappedArray; } - public XmlItem nameString(String nameString) { this.nameString = nameString; @@ -316,7 +311,6 @@ public class XmlItem { this.nameString = nameString; } - public XmlItem nameNumber(BigDecimal nameNumber) { this.nameNumber = nameNumber; @@ -342,7 +336,6 @@ public class XmlItem { this.nameNumber = nameNumber; } - public XmlItem nameInteger(Integer nameInteger) { this.nameInteger = nameInteger; @@ -368,7 +361,6 @@ public class XmlItem { this.nameInteger = nameInteger; } - public XmlItem nameBoolean(Boolean nameBoolean) { this.nameBoolean = nameBoolean; @@ -394,7 +386,6 @@ public class XmlItem { this.nameBoolean = nameBoolean; } - public XmlItem nameArray(List nameArray) { this.nameArray = nameArray; @@ -428,7 +419,6 @@ public class XmlItem { this.nameArray = nameArray; } - public XmlItem nameWrappedArray(List nameWrappedArray) { this.nameWrappedArray = nameWrappedArray; @@ -462,7 +452,6 @@ public class XmlItem { this.nameWrappedArray = nameWrappedArray; } - public XmlItem prefixString(String prefixString) { this.prefixString = prefixString; @@ -488,7 +477,6 @@ public class XmlItem { this.prefixString = prefixString; } - public XmlItem prefixNumber(BigDecimal prefixNumber) { this.prefixNumber = prefixNumber; @@ -514,7 +502,6 @@ public class XmlItem { this.prefixNumber = prefixNumber; } - public XmlItem prefixInteger(Integer prefixInteger) { this.prefixInteger = prefixInteger; @@ -540,7 +527,6 @@ public class XmlItem { this.prefixInteger = prefixInteger; } - public XmlItem prefixBoolean(Boolean prefixBoolean) { this.prefixBoolean = prefixBoolean; @@ -566,7 +552,6 @@ public class XmlItem { this.prefixBoolean = prefixBoolean; } - public XmlItem prefixArray(List prefixArray) { this.prefixArray = prefixArray; @@ -600,7 +585,6 @@ public class XmlItem { this.prefixArray = prefixArray; } - public XmlItem prefixWrappedArray(List prefixWrappedArray) { this.prefixWrappedArray = prefixWrappedArray; @@ -634,7 +618,6 @@ public class XmlItem { this.prefixWrappedArray = prefixWrappedArray; } - public XmlItem namespaceString(String namespaceString) { this.namespaceString = namespaceString; @@ -660,7 +643,6 @@ public class XmlItem { this.namespaceString = namespaceString; } - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { this.namespaceNumber = namespaceNumber; @@ -686,7 +668,6 @@ public class XmlItem { this.namespaceNumber = namespaceNumber; } - public XmlItem namespaceInteger(Integer namespaceInteger) { this.namespaceInteger = namespaceInteger; @@ -712,7 +693,6 @@ public class XmlItem { this.namespaceInteger = namespaceInteger; } - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { this.namespaceBoolean = namespaceBoolean; @@ -738,7 +718,6 @@ public class XmlItem { this.namespaceBoolean = namespaceBoolean; } - public XmlItem namespaceArray(List namespaceArray) { this.namespaceArray = namespaceArray; @@ -772,7 +751,6 @@ public class XmlItem { this.namespaceArray = namespaceArray; } - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { this.namespaceWrappedArray = namespaceWrappedArray; @@ -806,7 +784,6 @@ public class XmlItem { this.namespaceWrappedArray = namespaceWrappedArray; } - public XmlItem prefixNsString(String prefixNsString) { this.prefixNsString = prefixNsString; @@ -832,7 +809,6 @@ public class XmlItem { this.prefixNsString = prefixNsString; } - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { this.prefixNsNumber = prefixNsNumber; @@ -858,7 +834,6 @@ public class XmlItem { this.prefixNsNumber = prefixNsNumber; } - public XmlItem prefixNsInteger(Integer prefixNsInteger) { this.prefixNsInteger = prefixNsInteger; @@ -884,7 +859,6 @@ public class XmlItem { this.prefixNsInteger = prefixNsInteger; } - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { this.prefixNsBoolean = prefixNsBoolean; @@ -910,7 +884,6 @@ public class XmlItem { this.prefixNsBoolean = prefixNsBoolean; } - public XmlItem prefixNsArray(List prefixNsArray) { this.prefixNsArray = prefixNsArray; @@ -944,7 +917,6 @@ public class XmlItem { this.prefixNsArray = prefixNsArray; } - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { this.prefixNsWrappedArray = prefixNsWrappedArray; diff --git a/samples/client/petstore/java/vertx/.github/workflows/maven.yml b/samples/client/petstore/java/vertx/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/vertx/.github/workflows/maven.yml +++ b/samples/client/petstore/java/vertx/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/vertx/docs/ParentWithNullable.md b/samples/client/petstore/java/vertx/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/vertx/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/vertx/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/vertx/gradlew b/samples/client/petstore/java/vertx/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/vertx/gradlew +++ b/samples/client/petstore/java/vertx/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/vertx/gradlew.bat b/samples/client/petstore/java/vertx/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/vertx/gradlew.bat +++ b/samples/client/petstore/java/vertx/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java index e345a22f286..28ea1d6b8f6 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java @@ -671,67 +671,67 @@ public class ApiClient extends JavaTimeFormatter { private final Map authentications = new LinkedHashMap<>(); - public void addPetstore_authAuthentication(String accessToken) { + public void addPetstoreAuthAuthentication(String accessToken) { OAuth auth = new OAuth(); auth.setAccessToken(accessToken); authentications.put("petstore_auth", auth); } - public void addApi_keyAuthentication(String apikey, String apiKeyPrefix) { + public void addApiKeyAuthentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth("header","api_key"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("api_key", auth); } - public void addApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + public void addApiKeyQueryAuthentication(String apikey, String apiKeyPrefix) { ApiKeyAuth auth = new ApiKeyAuth("query","api_key_query"); auth.setApiKey(apikey); auth.setApiKeyPrefix(apiKeyPrefix); authentications.put("api_key_query", auth); } - public void addHttp_basic_testAuthentication(String username, String password) { + public void addHttpBasicTestAuthentication(String username, String password) { HttpBasicAuth auth = new HttpBasicAuth(); auth.setUsername(username); auth.setPassword(password); authentications.put("http_basic_test", auth); } - public void addBearer_testAuthentication(String bearerToken) { + public void addBearerTestAuthentication(String bearerToken) { HttpBearerAuth auth = new HttpBearerAuth("bearer"); auth.setBearerToken(bearerToken); authentications.put("bearer_test", auth); } - public static AuthInfo forPetstore_authAuthentication(String accessToken) { + public static AuthInfo forPetstoreAuthAuthentication(String accessToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.addPetstore_authAuthentication(accessToken); + authInfo.addPetstoreAuthAuthentication(accessToken); return authInfo; } - public static AuthInfo forApi_keyAuthentication(String apikey, String apiKeyPrefix) { + public static AuthInfo forApiKeyAuthentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.addApi_keyAuthentication(apikey, apiKeyPrefix); + authInfo.addApiKeyAuthentication(apikey, apiKeyPrefix); return authInfo; } - public static AuthInfo forApi_key_queryAuthentication(String apikey, String apiKeyPrefix) { + public static AuthInfo forApiKeyQueryAuthentication(String apikey, String apiKeyPrefix) { AuthInfo authInfo = new AuthInfo(); - authInfo.addApi_key_queryAuthentication(apikey, apiKeyPrefix); + authInfo.addApiKeyQueryAuthentication(apikey, apiKeyPrefix); return authInfo; } - public static AuthInfo forHttp_basic_test(String username, String password) { + public static AuthInfo forHttpBasicTest(String username, String password) { AuthInfo authInfo = new AuthInfo(); - authInfo.addHttp_basic_testAuthentication(username, password); + authInfo.addHttpBasicTestAuthentication(username, password); return authInfo; } - public static AuthInfo forBearer_testAuthentication(String bearerToken) { + public static AuthInfo forBearerTestAuthentication(String bearerToken) { AuthInfo authInfo = new AuthInfo(); - authInfo.addBearer_testAuthentication(bearerToken); + authInfo.addBearerTestAuthentication(bearerToken); return authInfo; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 4afcc27fcc5..85b3c9ae19d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -76,7 +76,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index bb578593d22..c7ec666bb18 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -67,7 +67,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index e6d3fb6801e..3e5dfccd5dc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -79,7 +79,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index 154e6cc2374..41b29a30249 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..accb755a668 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..ed8e1e2da05 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index f03d7aefbce..58a77ffded8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index ca790c41027..04f1adb80ea 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,7 +243,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -269,7 +268,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -295,7 +293,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -321,7 +318,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -355,7 +351,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -381,7 +376,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -407,7 +401,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 512b6e34aaf..e2c63da4e8d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -70,7 +70,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f4f44fa76aa..e149084b1a5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index 45f713fc8bd..eb477bf6359 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -130,7 +130,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -158,7 +157,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -184,7 +182,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +209,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -240,7 +236,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -268,7 +263,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -294,7 +288,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -320,7 +313,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -346,7 +338,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(AsyncFile binary) { this.binary = binary; @@ -372,7 +363,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -398,7 +388,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -424,7 +413,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -450,7 +438,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -476,7 +463,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -502,7 +488,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..9fc24a2b7f4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index 2b1642eb26e..136e37557dd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e059b95f066..4ec2bb53611 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..517b2eb9f07 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..c8f27c57192 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..458314f0d83 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NullableClass.java index 44c483b70c3..7ce7d5cb48a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NullableClass.java @@ -127,7 +127,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -161,7 +160,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -195,7 +193,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -229,7 +226,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -263,7 +259,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -297,7 +292,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -343,7 +337,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -389,7 +382,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -423,7 +415,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -469,7 +460,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -515,7 +505,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index cc3d7df1253..f573813253c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -79,7 +79,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -107,7 +106,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -135,7 +133,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..05dfbdaeefa 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..7045f92dd8f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ParentWithNullable.java index e3705e43937..0f980144308 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -85,7 +85,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -115,7 +115,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index f3978908526..180ee4787ba 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d585c01ecc3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..201029ba21a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 8ed799606d5..b501d23345c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml b/samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml +++ b/samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/webclient-jakarta/build.gradle b/samples/client/petstore/java/webclient-jakarta/build.gradle index 9e82e0e32b5..2abcdab45b1 100644 --- a/samples/client/petstore/java/webclient-jakarta/build.gradle +++ b/samples/client/petstore/java/webclient-jakarta/build.gradle @@ -119,7 +119,7 @@ ext { jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -134,5 +134,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/webclient-jakarta/docs/ParentWithNullable.md b/samples/client/petstore/java/webclient-jakarta/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/webclient-jakarta/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/webclient-jakarta/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/webclient-jakarta/gradlew b/samples/client/petstore/java/webclient-jakarta/gradlew index 005bcde0428..9d0ce634cb1 100755 --- a/samples/client/petstore/java/webclient-jakarta/gradlew +++ b/samples/client/petstore/java/webclient-jakarta/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/webclient-jakarta/gradlew.bat b/samples/client/petstore/java/webclient-jakarta/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/webclient-jakarta/gradlew.bat +++ b/samples/client/petstore/java/webclient-jakarta/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/webclient-jakarta/pom.xml b/samples/client/petstore/java/webclient-jakarta/pom.xml index 877afeb2de5..52542679310 100644 --- a/samples/client/petstore/java/webclient-jakarta/pom.xml +++ b/samples/client/petstore/java/webclient-jakarta/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 17 17 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -112,8 +112,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -127,6 +127,6 @@ 2.1.1 3.5.12 1.1.13 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 947b4341d4a..0a24ded8de6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -76,7 +76,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 0ff054502a7..245502c27cb 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -67,7 +67,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java index fa1f97b704e..0ee7ca10136 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -79,7 +79,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java index d94346edf2b..e16fd175188 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java index 4c577b9377b..7ff0d8d1c68 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java index 15574e10587..9937475f745 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java index 0976a517dbd..4343ec3d02e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java index b9e373aa0cd..2981d30db90 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,7 +243,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -269,7 +268,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -295,7 +293,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -321,7 +318,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -355,7 +351,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -381,7 +376,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -407,7 +401,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 11cffddb6cf..c3c6841eceb 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -70,7 +70,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 73124b45930..11c45bc7358 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java index fe84ac96130..c67a8985f9e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java @@ -130,7 +130,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -158,7 +157,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -184,7 +182,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +209,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -240,7 +236,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -268,7 +263,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -294,7 +288,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -320,7 +313,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -346,7 +338,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -372,7 +363,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -398,7 +388,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -424,7 +413,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -450,7 +438,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -476,7 +463,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -502,7 +488,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 45a55a85bad..6ed089041e3 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java index c93b7caa286..2591291dde6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f0566acc83f..1b5b35712a6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java index a639ad87229..6890500da26 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6b29f384735..5855bba3134 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java index f1a2ca72dfe..0e5b485fe91 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java index 5da7ad8fbd9..5ece264983f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java @@ -127,7 +127,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -161,7 +160,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -195,7 +193,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -229,7 +226,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -263,7 +259,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -297,7 +292,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -343,7 +337,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -389,7 +382,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -423,7 +415,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -469,7 +460,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -515,7 +505,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 442e3192b22..f95a7635614 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -79,7 +79,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -107,7 +106,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -135,7 +133,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java index f3c0976ed6b..31d5d4f19c5 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java index b610cc256d1..03e67767714 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java index af1d05e4871..f032bccf711 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -85,7 +85,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -115,7 +115,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java index 547a5aa00e5..048e9d34f96 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e35d4036583..806117333ca 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java index 4d55b22f596..fb996d933b6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java index 633bc3b2b1a..c8db7dc4238 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 963f3a25c7c..84aa307bcf3 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); @@ -39,8 +40,9 @@ public class AnotherFakeApiTest { */ @Test public void call123testSpecialTagsTest() { - Client client = null; - Client response = api.call123testSpecialTags(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.call123testSpecialTags(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/DefaultApiTest.java index bc3c03eac1f..2b366bb36a0 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); @@ -39,7 +40,8 @@ public class DefaultApiTest { */ @Test public void fooGetTest() { - FooGetDefaultResponse response = api.fooGet().block(); + // uncomment below to test the function + //FooGetDefaultResponse response = api.fooGet().block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeApiTest.java index 3d05cc45a1a..a80ad43c5c3 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,8 +14,10 @@ package org.openapitools.client.api; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; @@ -24,9 +26,11 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -37,12 +41,25 @@ import java.util.stream.Collectors; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + // uncomment below to test the function + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap().block(); + + // TODO: test validations + } + /** * Health check endpoint * @@ -50,7 +67,8 @@ public class FakeApiTest { */ @Test public void fakeHealthGetTest() { - HealthCheckResult response = api.fakeHealthGet().block(); + // uncomment below to test the function + //HealthCheckResult response = api.fakeHealthGet().block(); // TODO: test validations } @@ -62,10 +80,11 @@ public class FakeApiTest { */ @Test public void fakeHttpSignatureTestTest() { - Pet pet = null; - String query1 = null; - String header1 = null; - api.fakeHttpSignatureTest(pet, query1, header1).block(); + // uncomment below to test the function + //Pet pet = null; + //String query1 = null; + //String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1).block(); // TODO: test validations } @@ -77,8 +96,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body).block(); + // uncomment below to test the function + //Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body).block(); // TODO: test validations } @@ -90,8 +110,9 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); + // uncomment below to test the function + //OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); // TODO: test validations } @@ -103,8 +124,9 @@ public class FakeApiTest { */ @Test public void fakeOuterNumberSerializeTest() { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body).block(); + // uncomment below to test the function + //BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body).block(); // TODO: test validations } @@ -116,8 +138,9 @@ public class FakeApiTest { */ @Test public void fakeOuterStringSerializeTest() { - String body = null; - String response = api.fakeOuterStringSerialize(body).block(); + // uncomment below to test the function + //String body = null; + //String response = api.fakeOuterStringSerialize(body).block(); // TODO: test validations } @@ -129,8 +152,23 @@ public class FakeApiTest { */ @Test public void fakePropertyEnumIntegerSerializeTest() { - OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; - OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + // uncomment below to test the function + //OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody).block(); // TODO: test validations } @@ -142,8 +180,9 @@ public class FakeApiTest { */ @Test public void testBodyWithBinaryTest() { - File body = null; - api.testBodyWithBinary(body).block(); + // uncomment below to test the function + //File body = null; + //api.testBodyWithBinary(body).block(); // TODO: test validations } @@ -155,8 +194,9 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - api.testBodyWithFileSchema(fileSchemaTestClass).block(); + // uncomment below to test the function + //FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass).block(); // TODO: test validations } @@ -168,9 +208,10 @@ public class FakeApiTest { */ @Test public void testBodyWithQueryParamsTest() { - String query = null; - User user = null; - api.testBodyWithQueryParams(query, user).block(); + // uncomment below to test the function + //String query = null; + //User user = null; + //api.testBodyWithQueryParams(query, user).block(); // TODO: test validations } @@ -182,8 +223,9 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - Client response = api.testClientModel(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClientModel(client).block(); // TODO: test validations } @@ -195,21 +237,22 @@ public class FakeApiTest { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); + // uncomment below to test the function + //BigDecimal number = null; + //Double _double = null; + //String patternWithoutDelimiter = null; + //byte[] _byte = null; + //Integer integer = null; + //Integer int32 = null; + //Long int64 = null; + //Float _float = null; + //String string = null; + //File binary = null; + //LocalDate date = null; + //OffsetDateTime dateTime = null; + //String password = null; + //String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); // TODO: test validations } @@ -221,16 +264,17 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumQueryModelArray = null; - List enumFormStringArray = null; - String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); + // uncomment below to test the function + //List enumHeaderStringArray = null; + //String enumHeaderString = null; + //List enumQueryStringArray = null; + //String enumQueryString = null; + //Integer enumQueryInteger = null; + //Double enumQueryDouble = null; + //List enumQueryModelArray = null; + //List enumFormStringArray = null; + //String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); // TODO: test validations } @@ -242,13 +286,14 @@ public class FakeApiTest { */ @Test public void testGroupParametersTest() { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); + // uncomment below to test the function + //Integer requiredStringGroup = null; + //Boolean requiredBooleanGroup = null; + //Long requiredInt64Group = null; + //Integer stringGroup = null; + //Boolean booleanGroup = null; + //Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); // TODO: test validations } @@ -260,8 +305,23 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - api.testInlineAdditionalProperties(requestBody).block(); + // uncomment below to test the function + //Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody).block(); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // uncomment below to test the function + //TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest).block(); // TODO: test validations } @@ -273,9 +333,24 @@ public class FakeApiTest { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2).block(); + // uncomment below to test the function + //String param = null; + //String param2 = null; + //api.testJsonFormData(param, param2).block(); + + // TODO: test validations + } + + /** + * test nullable parent property + * + * + */ + @Test + public void testNullableTest() { + // uncomment below to test the function + //ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable).block(); // TODO: test validations } @@ -287,14 +362,29 @@ public class FakeApiTest { */ @Test public void testQueryParameterCollectionFormatTest() { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - String allowEmpty = null; - Map language = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + // uncomment below to test the function + //List pipe = null; + //List ioutil = null; + //List http = null; + //List url = null; + //List context = null; + //String allowEmpty = null; + //Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + */ + @Test + public void testStringMapReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testStringMapReference(requestBody).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6ce8be5ccba..a3654c1f1d0 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); @@ -39,8 +40,9 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - Client response = api.testClassname(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClassname(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java index b4f8d9ec962..d79731eb943 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,9 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +30,7 @@ import java.util.stream.Collectors; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); @@ -42,8 +43,9 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet pet = null; - api.addPet(pet).block(); + // uncomment below to test the function + //Pet pet = null; + //api.addPet(pet).block(); // TODO: test validations } @@ -55,9 +57,10 @@ public class PetApiTest { */ @Test public void deletePetTest() { - Long petId = null; - String apiKey = null; - api.deletePet(petId, apiKey).block(); + // uncomment below to test the function + //Long petId = null; + //String apiKey = null; + //api.deletePet(petId, apiKey).block(); // TODO: test validations } @@ -69,8 +72,9 @@ public class PetApiTest { */ @Test public void findPetsByStatusTest() { - List status = null; - List response = api.findPetsByStatus(status); + // uncomment below to test the function + //List status = null; + //List response = api.findPetsByStatus(status); // TODO: test validations } @@ -82,8 +86,9 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - Set tags = null; - Set response = api.findPetsByTags(tags); + // uncomment below to test the function + //Set tags = null; + //Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -95,8 +100,9 @@ public class PetApiTest { */ @Test public void getPetByIdTest() { - Long petId = null; - Pet response = api.getPetById(petId); + // uncomment below to test the function + //Long petId = null; + //Pet response = api.getPetById(petId); // TODO: test validations } @@ -108,8 +114,9 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet pet = null; - api.updatePet(pet); + // uncomment below to test the function + //Pet pet = null; + //api.updatePet(pet); // TODO: test validations } @@ -121,10 +128,11 @@ public class PetApiTest { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status).block(); + // uncomment below to test the function + //Long petId = null; + //String name = null; + //String status = null; + //api.updatePetWithForm(petId, name, status).block(); // TODO: test validations } @@ -136,10 +144,11 @@ public class PetApiTest { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File _file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); + // uncomment below to test the function + //Long petId = null; + //String additionalMetadata = null; + //File _file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); // TODO: test validations } @@ -151,10 +160,11 @@ public class PetApiTest { */ @Test public void uploadFileWithRequiredFileTest() { - Long petId = null; - File requiredFile = null; - String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); + // uncomment below to test the function + //Long petId = null; + //File requiredFile = null; + //String additionalMetadata = null; + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java index 4e4841aa45c..30645d01855 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); @@ -39,8 +40,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() { - String orderId = null; - api.deleteOrder(orderId).block(); + // uncomment below to test the function + //String orderId = null; + //api.deleteOrder(orderId).block(); // TODO: test validations } @@ -52,7 +54,8 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - Map response = api.getInventory().block(); + // uncomment below to test the function + //Map response = api.getInventory().block(); // TODO: test validations } @@ -64,8 +67,9 @@ public class StoreApiTest { */ @Test public void getOrderByIdTest() { - Long orderId = null; - Order response = api.getOrderById(orderId).block(); + // uncomment below to test the function + //Long orderId = null; + //Order response = api.getOrderById(orderId).block(); // TODO: test validations } @@ -77,8 +81,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order order = null; - Order response = api.placeOrder(order).block(); + // uncomment below to test the function + //Order order = null; + //Order response = api.placeOrder(order).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java index 7a3561a9b35..3f8d134b97c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,8 +15,9 @@ package org.openapitools.client.api; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +28,7 @@ import java.util.stream.Collectors; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); @@ -40,8 +41,9 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - api.createUser(user).block(); + // uncomment below to test the function + //User user = null; + //api.createUser(user).block(); // TODO: test validations } @@ -53,8 +55,9 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - api.createUsersWithArrayInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithArrayInput(user).block(); // TODO: test validations } @@ -66,8 +69,9 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List user = null; - api.createUsersWithListInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithListInput(user).block(); // TODO: test validations } @@ -79,8 +83,9 @@ public class UserApiTest { */ @Test public void deleteUserTest() { - String username = null; - api.deleteUser(username).block(); + // uncomment below to test the function + //String username = null; + //api.deleteUser(username).block(); // TODO: test validations } @@ -92,8 +97,9 @@ public class UserApiTest { */ @Test public void getUserByNameTest() { - String username = null; - User response = api.getUserByName(username).block(); + // uncomment below to test the function + //String username = null; + //User response = api.getUserByName(username).block(); // TODO: test validations } @@ -105,9 +111,10 @@ public class UserApiTest { */ @Test public void loginUserTest() { - String username = null; - String password = null; - String response = api.loginUser(username, password).block(); + // uncomment below to test the function + //String username = null; + //String password = null; + //String response = api.loginUser(username, password).block(); // TODO: test validations } @@ -119,7 +126,8 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - api.logoutUser().block(); + // uncomment below to test the function + //api.logoutUser().block(); // TODO: test validations } @@ -131,9 +139,10 @@ public class UserApiTest { */ @Test public void updateUserTest() { - String username = null; - User user = null; - api.updateUser(username, user).block(); + // uncomment below to test the function + //String username = null; + //User user = null; + //api.updateUser(username, user).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce42..6bdecfe07c9 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -43,7 +42,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapProperty' */ @Test - public void mapPropertyTest() { + void mapPropertyTest() { // TODO: test mapProperty } @@ -51,7 +50,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapOfMapProperty' */ @Test - public void mapOfMapPropertyTest() { + void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..f4b06d323d6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AllOfWithSingleRef */ -public class AllOfWithSingleRefTest { +class AllOfWithSingleRefTest { private final AllOfWithSingleRef model = new AllOfWithSingleRef(); /** * Model tests for AllOfWithSingleRef */ @Test - public void testAllOfWithSingleRef() { + void testAllOfWithSingleRef() { // TODO: test AllOfWithSingleRef } @@ -42,7 +41,7 @@ public class AllOfWithSingleRefTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -50,7 +49,7 @@ public class AllOfWithSingleRefTest { * Test the property 'singleRefType' */ @Test - public void singleRefTypeTest() { + void singleRefTypeTest() { // TODO: test singleRefType } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AnimalTest.java index 15d5c977c6b..24776d3cb51 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,24 +21,21 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -46,7 +43,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +51,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..6bbe877044d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnlyTest { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..eaf908bb1ab 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfNumberOnlyTest { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..99c6bcf5360 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..a0217acd1f2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -41,7 +40,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -49,7 +48,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -57,7 +56,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -65,7 +64,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -73,7 +72,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -81,7 +80,7 @@ public class CapitalizationTest { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e3..1b389a075be 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,22 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -45,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +60,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -41,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec3..a89d26497bc 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -23,21 +23,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable */ -public class ChildWithNullableTest { +class ChildWithNullableTest { private final ChildWithNullable model = new ChildWithNullable(); /** * Model tests for ChildWithNullable */ @Test - public void testChildWithNullable() { + void testChildWithNullable() { // TODO: test ChildWithNullable } @@ -45,7 +45,7 @@ public class ChildWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -53,7 +53,7 @@ public class ChildWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } @@ -61,7 +61,7 @@ public class ChildWithNullableTest { * Test the property 'otherProperty' */ @Test - public void otherPropertyTest() { + void otherPropertyTest() { // TODO: test otherProperty } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..6ef5c744fbc 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -41,7 +40,7 @@ public class ClassModelTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..8028f11bc2b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -41,7 +40,7 @@ public class ClientTest { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..b04c2097b20 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DeprecatedObject */ -public class DeprecatedObjectTest { +class DeprecatedObjectTest { private final DeprecatedObject model = new DeprecatedObject(); /** * Model tests for DeprecatedObject */ @Test - public void testDeprecatedObject() { + void testDeprecatedObject() { // TODO: test DeprecatedObject } @@ -41,7 +40,7 @@ public class DeprecatedObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,22 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +44,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +52,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +60,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..4a755b0d442 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -19,23 +19,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public class EnumArraysTest { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..48aa1a737fc 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade7..1e65944cbdc 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,22 +26,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -49,7 +48,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -57,7 +56,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -65,7 +64,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -73,7 +72,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -81,7 +80,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } @@ -89,7 +88,7 @@ public class EnumTestTest { * Test the property 'outerEnumInteger' */ @Test - public void outerEnumIntegerTest() { + void outerEnumIntegerTest() { // TODO: test outerEnumInteger } @@ -97,7 +96,7 @@ public class EnumTestTest { * Test the property 'outerEnumDefaultValue' */ @Test - public void outerEnumDefaultValueTest() { + void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } @@ -105,7 +104,7 @@ public class EnumTestTest { * Test the property 'outerEnumIntegerDefaultValue' */ @Test - public void outerEnumIntegerDefaultValueTest() { + void outerEnumIntegerDefaultValueTest() { // TODO: test outerEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..3250ad91974 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response */ -public class FakeBigDecimalMap200ResponseTest { +class FakeBigDecimalMap200ResponseTest { private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); /** * Model tests for FakeBigDecimalMap200Response */ @Test - public void testFakeBigDecimalMap200Response() { + void testFakeBigDecimalMap200Response() { // TODO: test FakeBigDecimalMap200Response } @@ -43,7 +43,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someId' */ @Test - public void someIdTest() { + void someIdTest() { // TODO: test someId } @@ -51,7 +51,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someMap' */ @Test - public void someMapTest() { + void someMapTest() { // TODO: test someMap } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..0048cb2c749 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +44,7 @@ public class FileSchemaTestClassTest { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +52,7 @@ public class FileSchemaTestClassTest { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..81bc69c9a7b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FooGetDefaultResponse */ -public class FooGetDefaultResponseTest { +class FooGetDefaultResponseTest { private final FooGetDefaultResponse model = new FooGetDefaultResponse(); /** * Model tests for FooGetDefaultResponse */ @Test - public void testFooGetDefaultResponse() { + void testFooGetDefaultResponse() { // TODO: test FooGetDefaultResponse } @@ -42,7 +41,7 @@ public class FooGetDefaultResponseTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..a9e2c8c126e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Foo */ -public class FooTest { +class FooTest { private final Foo model = new Foo(); /** * Model tests for Foo */ @Test - public void testFoo() { + void testFoo() { // TODO: test Foo } @@ -41,7 +40,7 @@ public class FooTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da1004..38a39e1c0ca 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,22 +23,21 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -46,7 +45,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -54,7 +53,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -62,7 +61,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -70,7 +69,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -78,7 +77,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -86,7 +85,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -94,7 +93,7 @@ public class FormatTestTest { * Test the property 'decimal' */ @Test - public void decimalTest() { + void decimalTest() { // TODO: test decimal } @@ -102,7 +101,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -110,7 +109,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -118,7 +117,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -126,7 +125,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -134,7 +133,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -142,7 +141,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -150,7 +149,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -158,7 +157,7 @@ public class FormatTestTest { * Test the property 'patternWithDigits' */ @Test - public void patternWithDigitsTest() { + void patternWithDigitsTest() { // TODO: test patternWithDigits } @@ -166,7 +165,7 @@ public class FormatTestTest { * Test the property 'patternWithDigitsAndDelimiter' */ @Test - public void patternWithDigitsAndDelimiterTest() { + void patternWithDigitsAndDelimiterTest() { // TODO: test patternWithDigitsAndDelimiter } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..908f0aff6ed 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -41,7 +40,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9..0f45c2fcd5b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,22 +22,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HealthCheckResult */ -public class HealthCheckResultTest { +class HealthCheckResultTest { private final HealthCheckResult model = new HealthCheckResult(); /** * Model tests for HealthCheckResult */ @Test - public void testHealthCheckResult() { + void testHealthCheckResult() { // TODO: test HealthCheckResult } @@ -45,7 +44,7 @@ public class HealthCheckResultTest { * Test the property 'nullableMessage' */ @Test - public void nullableMessageTest() { + void nullableMessageTest() { // TODO: test nullableMessage } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..3752c5ba31f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -43,7 +42,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -51,7 +50,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -59,7 +58,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -67,7 +66,7 @@ public class MapTestTest { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..0f47e193af8 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,22 +23,21 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -46,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -54,7 +53,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -62,7 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..5743b70142b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -41,7 +40,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public class Model200ResponseTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..436e4abd59e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -41,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -49,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -57,7 +56,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..f128d7b9ac2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -41,7 +40,7 @@ public class ModelFileTest { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..92273f48d23 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -41,7 +40,7 @@ public class ModelListTest { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..1c5337654cd 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -41,7 +40,7 @@ public class ModelReturnTest { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..1a6aa18fa20 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -41,7 +40,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -57,7 +56,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -65,7 +64,7 @@ public class NameTest { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..d960ef76e5c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -22,6 +22,7 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,22 +30,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NullableClass */ -public class NullableClassTest { +class NullableClassTest { private final NullableClass model = new NullableClass(); /** * Model tests for NullableClass */ @Test - public void testNullableClass() { + void testNullableClass() { // TODO: test NullableClass } @@ -52,7 +52,7 @@ public class NullableClassTest { * Test the property 'integerProp' */ @Test - public void integerPropTest() { + void integerPropTest() { // TODO: test integerProp } @@ -60,7 +60,7 @@ public class NullableClassTest { * Test the property 'numberProp' */ @Test - public void numberPropTest() { + void numberPropTest() { // TODO: test numberProp } @@ -68,7 +68,7 @@ public class NullableClassTest { * Test the property 'booleanProp' */ @Test - public void booleanPropTest() { + void booleanPropTest() { // TODO: test booleanProp } @@ -76,7 +76,7 @@ public class NullableClassTest { * Test the property 'stringProp' */ @Test - public void stringPropTest() { + void stringPropTest() { // TODO: test stringProp } @@ -84,7 +84,7 @@ public class NullableClassTest { * Test the property 'dateProp' */ @Test - public void datePropTest() { + void datePropTest() { // TODO: test dateProp } @@ -92,7 +92,7 @@ public class NullableClassTest { * Test the property 'datetimeProp' */ @Test - public void datetimePropTest() { + void datetimePropTest() { // TODO: test datetimeProp } @@ -100,7 +100,7 @@ public class NullableClassTest { * Test the property 'arrayNullableProp' */ @Test - public void arrayNullablePropTest() { + void arrayNullablePropTest() { // TODO: test arrayNullableProp } @@ -108,7 +108,7 @@ public class NullableClassTest { * Test the property 'arrayAndItemsNullableProp' */ @Test - public void arrayAndItemsNullablePropTest() { + void arrayAndItemsNullablePropTest() { // TODO: test arrayAndItemsNullableProp } @@ -116,7 +116,7 @@ public class NullableClassTest { * Test the property 'arrayItemsNullable' */ @Test - public void arrayItemsNullableTest() { + void arrayItemsNullableTest() { // TODO: test arrayItemsNullable } @@ -124,7 +124,7 @@ public class NullableClassTest { * Test the property 'objectNullableProp' */ @Test - public void objectNullablePropTest() { + void objectNullablePropTest() { // TODO: test objectNullableProp } @@ -132,7 +132,7 @@ public class NullableClassTest { * Test the property 'objectAndItemsNullableProp' */ @Test - public void objectAndItemsNullablePropTest() { + void objectAndItemsNullablePropTest() { // TODO: test objectAndItemsNullableProp } @@ -140,7 +140,7 @@ public class NullableClassTest { * Test the property 'objectItemsNullable' */ @Test - public void objectItemsNullableTest() { + void objectItemsNullableTest() { // TODO: test objectItemsNullable } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..8623386a5e9 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -42,7 +41,7 @@ public class NumberOnlyTest { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..aa755cf8cb4 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -20,24 +20,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ObjectWithDeprecatedFields */ -public class ObjectWithDeprecatedFieldsTest { +class ObjectWithDeprecatedFieldsTest { private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); /** * Model tests for ObjectWithDeprecatedFields */ @Test - public void testObjectWithDeprecatedFields() { + void testObjectWithDeprecatedFields() { // TODO: test ObjectWithDeprecatedFields } @@ -45,7 +45,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -61,7 +61,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'deprecatedRef' */ @Test - public void deprecatedRefTest() { + void deprecatedRefTest() { // TODO: test deprecatedRef } @@ -69,7 +69,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'bars' */ @Test - public void barsTest() { + void barsTest() { // TODO: test bars } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..670c2535646 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -42,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -58,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -66,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -74,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -82,7 +81,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..870a977da94 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -42,7 +41,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -50,7 +49,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -58,7 +57,7 @@ public class OuterCompositeTest { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..d818b23c7d5 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumDefaultValue */ -public class OuterEnumDefaultValueTest { +class OuterEnumDefaultValueTest { /** * Model tests for OuterEnumDefaultValue */ @Test - public void testOuterEnumDefaultValue() { + void testOuterEnumDefaultValue() { // TODO: test OuterEnumDefaultValue } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..1d7b3338bca 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumIntegerDefaultValue */ -public class OuterEnumIntegerDefaultValueTest { +class OuterEnumIntegerDefaultValueTest { /** * Model tests for OuterEnumIntegerDefaultValue */ @Test - public void testOuterEnumIntegerDefaultValue() { + void testOuterEnumIntegerDefaultValue() { // TODO: test OuterEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..cacda46a76f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumInteger */ -public class OuterEnumIntegerTest { +class OuterEnumIntegerTest { /** * Model tests for OuterEnumInteger */ @Test - public void testOuterEnumInteger() { + void testOuterEnumInteger() { // TODO: test OuterEnumInteger } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..0333ee657a0 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..ac7169192a5 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterObjectWithEnumProperty */ -public class OuterObjectWithEnumPropertyTest { +class OuterObjectWithEnumPropertyTest { private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); /** * Model tests for OuterObjectWithEnumProperty */ @Test - public void testOuterObjectWithEnumProperty() { + void testOuterObjectWithEnumProperty() { // TODO: test OuterObjectWithEnumProperty } @@ -42,7 +41,7 @@ public class OuterObjectWithEnumPropertyTest { * Test the property 'value' */ @Test - public void valueTest() { + void valueTest() { // TODO: test value } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13..2e4de561806 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -25,21 +25,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable */ -public class ParentWithNullableTest { +class ParentWithNullableTest { private final ParentWithNullable model = new ParentWithNullable(); /** * Model tests for ParentWithNullable */ @Test - public void testParentWithNullable() { + void testParentWithNullable() { // TODO: test ParentWithNullable } @@ -47,7 +47,7 @@ public class ParentWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -55,7 +55,7 @@ public class ParentWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..2e4303f1e4b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,27 +20,27 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..c56da4290fa 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -41,7 +40,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public class ReadOnlyFirstTest { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..476e4ca161b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SingleRefType */ -public class SingleRefTypeTest { +class SingleRefTypeTest { /** * Model tests for SingleRefType */ @Test - public void testSingleRefType() { + void testSingleRefType() { // TODO: test SingleRefType } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..9501cf722d6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -41,7 +40,7 @@ public class SpecialModelNameTest { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..dc9cf9742ef 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -41,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9d..edb986ca550 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ -public class TestInlineFreeformAdditionalPropertiesRequestTest { +class TestInlineFreeformAdditionalPropertiesRequestTest { private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ @Test - public void testTestInlineFreeformAdditionalPropertiesRequest() { + void testTestInlineFreeformAdditionalPropertiesRequest() { // TODO: test TestInlineFreeformAdditionalPropertiesRequest } @@ -42,7 +42,7 @@ public class TestInlineFreeformAdditionalPropertiesRequestTest { * Test the property 'someProperty' */ @Test - public void somePropertyTest() { + void somePropertyTest() { // TODO: test someProperty } diff --git a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..69d274133b9 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -41,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -57,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -65,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -73,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -81,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -89,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -97,7 +96,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nullable-arrays/.github/workflows/maven.yml b/samples/client/petstore/java/webclient-nullable-arrays/.github/workflows/maven.yml index a7d2ed86a81..9b7c8ca8cae 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/.github/workflows/maven.yml +++ b/samples/client/petstore/java/webclient-nullable-arrays/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle index 690b3ea7996..34644130754 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nullable-arrays/build.gradle @@ -119,7 +119,7 @@ ext { jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -134,5 +134,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/webclient-nullable-arrays/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/webclient-nullable-arrays/gradlew b/samples/client/petstore/java/webclient-nullable-arrays/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/gradlew +++ b/samples/client/petstore/java/webclient-nullable-arrays/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/webclient-nullable-arrays/gradlew.bat b/samples/client/petstore/java/webclient-nullable-arrays/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/gradlew.bat +++ b/samples/client/petstore/java/webclient-nullable-arrays/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/webclient-nullable-arrays/pom.xml b/samples/client/petstore/java/webclient-nullable-arrays/pom.xml index 898a6952def..a2a4517edbf 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/pom.xml +++ b/samples/client/petstore/java/webclient-nullable-arrays/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 1.8 1.8 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -112,8 +112,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -127,6 +127,6 @@ 1.3.5 3.4.34 1.0.39 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java index 5fdc67f6526..28f25821f4c 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/main/java/org/openapitools/client/model/ByteArrayObject.java @@ -91,7 +91,6 @@ public class ByteArrayObject { this.nullableArray = JsonNullable.of(nullableArray); } - public ByteArrayObject normalArray(byte[] normalArray) { this.normalArray = normalArray; @@ -117,7 +116,6 @@ public class ByteArrayObject { this.normalArray = normalArray; } - public ByteArrayObject nullableString(String nullableString) { this.nullableString = JsonNullable.of(nullableString); @@ -151,7 +149,6 @@ public class ByteArrayObject { this.nullableString = JsonNullable.of(nullableString); } - public ByteArrayObject stringField(String stringField) { this.stringField = stringField; @@ -177,7 +174,6 @@ public class ByteArrayObject { this.stringField = stringField; } - public ByteArrayObject intField(BigDecimal intField) { this.intField = intField; diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java index 6c15be4ff81..ce72b2d96b3 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.ByteArrayObject; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); @@ -39,7 +40,8 @@ public class DefaultApiTest { */ @Test public void nullableArrayTestGetTest() { - List response = api.nullableArrayTestGet().collectList().block(); + // uncomment below to test the function + //List response = api.nullableArrayTestGet().collectList().block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java b/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java index f37a3facaf0..a8c532e1df1 100644 --- a/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java +++ b/samples/client/petstore/java/webclient-nullable-arrays/src/test/java/org/openapitools/client/model/ByteArrayObjectTest.java @@ -23,22 +23,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ByteArrayObject */ -public class ByteArrayObjectTest { +class ByteArrayObjectTest { private final ByteArrayObject model = new ByteArrayObject(); /** * Model tests for ByteArrayObject */ @Test - public void testByteArrayObject() { + void testByteArrayObject() { // TODO: test ByteArrayObject } @@ -46,7 +45,7 @@ public class ByteArrayObjectTest { * Test the property 'nullableArray' */ @Test - public void nullableArrayTest() { + void nullableArrayTest() { // TODO: test nullableArray } @@ -54,7 +53,7 @@ public class ByteArrayObjectTest { * Test the property 'normalArray' */ @Test - public void normalArrayTest() { + void normalArrayTest() { // TODO: test normalArray } @@ -62,7 +61,7 @@ public class ByteArrayObjectTest { * Test the property 'nullableString' */ @Test - public void nullableStringTest() { + void nullableStringTest() { // TODO: test nullableString } @@ -70,7 +69,7 @@ public class ByteArrayObjectTest { * Test the property 'stringField' */ @Test - public void stringFieldTest() { + void stringFieldTest() { // TODO: test stringField } @@ -78,7 +77,7 @@ public class ByteArrayObjectTest { * Test the property 'intField' */ @Test - public void intFieldTest() { + void intFieldTest() { // TODO: test intField } diff --git a/samples/client/petstore/java/webclient-swagger2/.github/workflows/maven.yml b/samples/client/petstore/java/webclient-swagger2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/webclient-swagger2/.github/workflows/maven.yml +++ b/samples/client/petstore/java/webclient-swagger2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/webclient-swagger2/.openapi-generator-ignore b/samples/client/petstore/java/webclient-swagger2/.openapi-generator-ignore index daed634bb4b..7484ee590a3 100644 --- a/samples/client/petstore/java/webclient-swagger2/.openapi-generator-ignore +++ b/samples/client/petstore/java/webclient-swagger2/.openapi-generator-ignore @@ -21,4 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -# diff --git a/samples/client/petstore/java/webclient-swagger2/build.gradle b/samples/client/petstore/java/webclient-swagger2/build.gradle index 9052967eaba..c5d3d6fa0ab 100644 --- a/samples/client/petstore/java/webclient-swagger2/build.gradle +++ b/samples/client/petstore/java/webclient-swagger2/build.gradle @@ -120,7 +120,7 @@ ext { jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -136,5 +136,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/webclient-swagger2/docs/ParentWithNullable.md b/samples/client/petstore/java/webclient-swagger2/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/webclient-swagger2/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/webclient-swagger2/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/webclient-swagger2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/webclient-swagger2/gradlew b/samples/client/petstore/java/webclient-swagger2/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/webclient-swagger2/gradlew +++ b/samples/client/petstore/java/webclient-swagger2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/webclient-swagger2/gradlew.bat b/samples/client/petstore/java/webclient-swagger2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/webclient-swagger2/gradlew.bat +++ b/samples/client/petstore/java/webclient-swagger2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/webclient-swagger2/pom.xml b/samples/client/petstore/java/webclient-swagger2/pom.xml index e8297f3e954..292125371ef 100644 --- a/samples/client/petstore/java/webclient-swagger2/pom.xml +++ b/samples/client/petstore/java/webclient-swagger2/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 1.8 1.8 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -117,8 +117,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -133,6 +133,6 @@ 1.3.5 3.4.34 1.0.39 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 2bb1b0abf0e..367b7aacf62 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 3b383cb9780..eb6264f8c1e 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -69,7 +69,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java index c69137b92b7..4140a8a77f0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Animal.java @@ -50,7 +50,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -81,7 +81,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java index 7b1fe1e12ab..071f9154856 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -84,7 +84,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -119,7 +118,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java index 0f2df88c35e..2b18cdccc66 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -84,7 +84,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -111,7 +110,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -138,7 +136,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -165,7 +162,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -192,7 +188,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Category.java index 7fca6df9bcd..aaab997f826 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -68,7 +68,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java index cafbb204ac8..d612234c666 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -141,7 +141,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java index 8620f32b6f0..ef8a72db47b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -245,7 +245,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -272,7 +271,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -299,7 +297,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -326,7 +323,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -361,7 +357,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -388,7 +383,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -415,7 +409,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index e04b9b27148..fe7c6a2904f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -72,7 +72,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bed8fe6cd5d..6d42e6f7f65 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -72,7 +72,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java index c4219ebf952..651a81f588b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -132,7 +132,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -161,7 +160,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -188,7 +186,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -217,7 +214,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -246,7 +242,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -275,7 +270,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -302,7 +296,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -329,7 +322,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -356,7 +348,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -383,7 +374,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -410,7 +400,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -437,7 +426,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -464,7 +452,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -491,7 +478,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -518,7 +504,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 4b82eb8eb52..dafbeb39444 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -42,7 +42,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -68,7 +70,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java index 080afa2156e..e209482ffa8 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java @@ -121,7 +121,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -156,7 +155,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -191,7 +189,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8d73a159f85..db013f2cf1b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -77,7 +77,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -104,7 +103,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java index c5f1c4e442d..1da0b90733a 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -70,7 +70,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index cf9dfecaee4..6c9b5c678ee 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -73,7 +73,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -100,7 +99,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java index bea75336fe2..5d0bf8858f6 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java @@ -50,7 +50,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -87,7 +89,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -103,7 +104,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -130,7 +130,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java index 4ef0852b82e..706b0b3c18b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java @@ -129,7 +129,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -164,7 +163,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -199,7 +197,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -234,7 +231,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -269,7 +265,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -304,7 +299,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -351,7 +345,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -398,7 +391,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -433,7 +425,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -480,7 +471,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -527,7 +517,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index d549c5aac07..2566632300b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -81,7 +81,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -110,7 +109,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -139,7 +137,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java index b05120d07e1..0834a675351 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -122,7 +122,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -149,7 +148,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -176,7 +174,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -203,7 +200,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -230,7 +226,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java index c23157e1fbb..7eec6d7d29f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -73,7 +73,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -100,7 +99,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java index a4f79957b98..288e9a22c32 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -53,7 +53,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -86,7 +86,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -117,7 +117,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java index b902afd09c3..6c461cd7a30 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -129,7 +129,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -156,7 +155,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -183,7 +181,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -219,7 +216,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -254,7 +250,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ceca267ff14..7a8e4df0049 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -41,7 +41,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -65,7 +67,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java index 42dc6f04456..8477c92112a 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -68,7 +68,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/User.java index bff22860e53..ffc30194a69 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -92,7 +92,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -119,7 +118,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -146,7 +144,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -173,7 +170,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -200,7 +196,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -227,7 +222,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -254,7 +248,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 963f3a25c7c..84aa307bcf3 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); @@ -39,8 +40,9 @@ public class AnotherFakeApiTest { */ @Test public void call123testSpecialTagsTest() { - Client client = null; - Client response = api.call123testSpecialTags(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.call123testSpecialTags(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java index bc3c03eac1f..2b366bb36a0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); @@ -39,7 +40,8 @@ public class DefaultApiTest { */ @Test public void fooGetTest() { - FooGetDefaultResponse response = api.fooGet().block(); + // uncomment below to test the function + //FooGetDefaultResponse response = api.fooGet().block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java index 3d05cc45a1a..a80ad43c5c3 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,8 +14,10 @@ package org.openapitools.client.api; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; @@ -24,9 +26,11 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -37,12 +41,25 @@ import java.util.stream.Collectors; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + // uncomment below to test the function + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap().block(); + + // TODO: test validations + } + /** * Health check endpoint * @@ -50,7 +67,8 @@ public class FakeApiTest { */ @Test public void fakeHealthGetTest() { - HealthCheckResult response = api.fakeHealthGet().block(); + // uncomment below to test the function + //HealthCheckResult response = api.fakeHealthGet().block(); // TODO: test validations } @@ -62,10 +80,11 @@ public class FakeApiTest { */ @Test public void fakeHttpSignatureTestTest() { - Pet pet = null; - String query1 = null; - String header1 = null; - api.fakeHttpSignatureTest(pet, query1, header1).block(); + // uncomment below to test the function + //Pet pet = null; + //String query1 = null; + //String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1).block(); // TODO: test validations } @@ -77,8 +96,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body).block(); + // uncomment below to test the function + //Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body).block(); // TODO: test validations } @@ -90,8 +110,9 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); + // uncomment below to test the function + //OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); // TODO: test validations } @@ -103,8 +124,9 @@ public class FakeApiTest { */ @Test public void fakeOuterNumberSerializeTest() { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body).block(); + // uncomment below to test the function + //BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body).block(); // TODO: test validations } @@ -116,8 +138,9 @@ public class FakeApiTest { */ @Test public void fakeOuterStringSerializeTest() { - String body = null; - String response = api.fakeOuterStringSerialize(body).block(); + // uncomment below to test the function + //String body = null; + //String response = api.fakeOuterStringSerialize(body).block(); // TODO: test validations } @@ -129,8 +152,23 @@ public class FakeApiTest { */ @Test public void fakePropertyEnumIntegerSerializeTest() { - OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; - OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + // uncomment below to test the function + //OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody).block(); // TODO: test validations } @@ -142,8 +180,9 @@ public class FakeApiTest { */ @Test public void testBodyWithBinaryTest() { - File body = null; - api.testBodyWithBinary(body).block(); + // uncomment below to test the function + //File body = null; + //api.testBodyWithBinary(body).block(); // TODO: test validations } @@ -155,8 +194,9 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - api.testBodyWithFileSchema(fileSchemaTestClass).block(); + // uncomment below to test the function + //FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass).block(); // TODO: test validations } @@ -168,9 +208,10 @@ public class FakeApiTest { */ @Test public void testBodyWithQueryParamsTest() { - String query = null; - User user = null; - api.testBodyWithQueryParams(query, user).block(); + // uncomment below to test the function + //String query = null; + //User user = null; + //api.testBodyWithQueryParams(query, user).block(); // TODO: test validations } @@ -182,8 +223,9 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - Client response = api.testClientModel(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClientModel(client).block(); // TODO: test validations } @@ -195,21 +237,22 @@ public class FakeApiTest { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); + // uncomment below to test the function + //BigDecimal number = null; + //Double _double = null; + //String patternWithoutDelimiter = null; + //byte[] _byte = null; + //Integer integer = null; + //Integer int32 = null; + //Long int64 = null; + //Float _float = null; + //String string = null; + //File binary = null; + //LocalDate date = null; + //OffsetDateTime dateTime = null; + //String password = null; + //String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); // TODO: test validations } @@ -221,16 +264,17 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumQueryModelArray = null; - List enumFormStringArray = null; - String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); + // uncomment below to test the function + //List enumHeaderStringArray = null; + //String enumHeaderString = null; + //List enumQueryStringArray = null; + //String enumQueryString = null; + //Integer enumQueryInteger = null; + //Double enumQueryDouble = null; + //List enumQueryModelArray = null; + //List enumFormStringArray = null; + //String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); // TODO: test validations } @@ -242,13 +286,14 @@ public class FakeApiTest { */ @Test public void testGroupParametersTest() { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); + // uncomment below to test the function + //Integer requiredStringGroup = null; + //Boolean requiredBooleanGroup = null; + //Long requiredInt64Group = null; + //Integer stringGroup = null; + //Boolean booleanGroup = null; + //Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); // TODO: test validations } @@ -260,8 +305,23 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - api.testInlineAdditionalProperties(requestBody).block(); + // uncomment below to test the function + //Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody).block(); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // uncomment below to test the function + //TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest).block(); // TODO: test validations } @@ -273,9 +333,24 @@ public class FakeApiTest { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2).block(); + // uncomment below to test the function + //String param = null; + //String param2 = null; + //api.testJsonFormData(param, param2).block(); + + // TODO: test validations + } + + /** + * test nullable parent property + * + * + */ + @Test + public void testNullableTest() { + // uncomment below to test the function + //ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable).block(); // TODO: test validations } @@ -287,14 +362,29 @@ public class FakeApiTest { */ @Test public void testQueryParameterCollectionFormatTest() { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - String allowEmpty = null; - Map language = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + // uncomment below to test the function + //List pipe = null; + //List ioutil = null; + //List http = null; + //List url = null; + //List context = null; + //String allowEmpty = null; + //Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + */ + @Test + public void testStringMapReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testStringMapReference(requestBody).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6ce8be5ccba..a3654c1f1d0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); @@ -39,8 +40,9 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - Client response = api.testClassname(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClassname(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java index b4f8d9ec962..d79731eb943 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,9 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +30,7 @@ import java.util.stream.Collectors; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); @@ -42,8 +43,9 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet pet = null; - api.addPet(pet).block(); + // uncomment below to test the function + //Pet pet = null; + //api.addPet(pet).block(); // TODO: test validations } @@ -55,9 +57,10 @@ public class PetApiTest { */ @Test public void deletePetTest() { - Long petId = null; - String apiKey = null; - api.deletePet(petId, apiKey).block(); + // uncomment below to test the function + //Long petId = null; + //String apiKey = null; + //api.deletePet(petId, apiKey).block(); // TODO: test validations } @@ -69,8 +72,9 @@ public class PetApiTest { */ @Test public void findPetsByStatusTest() { - List status = null; - List response = api.findPetsByStatus(status); + // uncomment below to test the function + //List status = null; + //List response = api.findPetsByStatus(status); // TODO: test validations } @@ -82,8 +86,9 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - Set tags = null; - Set response = api.findPetsByTags(tags); + // uncomment below to test the function + //Set tags = null; + //Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -95,8 +100,9 @@ public class PetApiTest { */ @Test public void getPetByIdTest() { - Long petId = null; - Pet response = api.getPetById(petId); + // uncomment below to test the function + //Long petId = null; + //Pet response = api.getPetById(petId); // TODO: test validations } @@ -108,8 +114,9 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet pet = null; - api.updatePet(pet); + // uncomment below to test the function + //Pet pet = null; + //api.updatePet(pet); // TODO: test validations } @@ -121,10 +128,11 @@ public class PetApiTest { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status).block(); + // uncomment below to test the function + //Long petId = null; + //String name = null; + //String status = null; + //api.updatePetWithForm(petId, name, status).block(); // TODO: test validations } @@ -136,10 +144,11 @@ public class PetApiTest { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File _file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); + // uncomment below to test the function + //Long petId = null; + //String additionalMetadata = null; + //File _file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); // TODO: test validations } @@ -151,10 +160,11 @@ public class PetApiTest { */ @Test public void uploadFileWithRequiredFileTest() { - Long petId = null; - File requiredFile = null; - String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); + // uncomment below to test the function + //Long petId = null; + //File requiredFile = null; + //String additionalMetadata = null; + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java index 4e4841aa45c..30645d01855 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); @@ -39,8 +40,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() { - String orderId = null; - api.deleteOrder(orderId).block(); + // uncomment below to test the function + //String orderId = null; + //api.deleteOrder(orderId).block(); // TODO: test validations } @@ -52,7 +54,8 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - Map response = api.getInventory().block(); + // uncomment below to test the function + //Map response = api.getInventory().block(); // TODO: test validations } @@ -64,8 +67,9 @@ public class StoreApiTest { */ @Test public void getOrderByIdTest() { - Long orderId = null; - Order response = api.getOrderById(orderId).block(); + // uncomment below to test the function + //Long orderId = null; + //Order response = api.getOrderById(orderId).block(); // TODO: test validations } @@ -77,8 +81,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order order = null; - Order response = api.placeOrder(order).block(); + // uncomment below to test the function + //Order order = null; + //Order response = api.placeOrder(order).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java index 7a3561a9b35..3f8d134b97c 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,8 +15,9 @@ package org.openapitools.client.api; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +28,7 @@ import java.util.stream.Collectors; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); @@ -40,8 +41,9 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - api.createUser(user).block(); + // uncomment below to test the function + //User user = null; + //api.createUser(user).block(); // TODO: test validations } @@ -53,8 +55,9 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - api.createUsersWithArrayInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithArrayInput(user).block(); // TODO: test validations } @@ -66,8 +69,9 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List user = null; - api.createUsersWithListInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithListInput(user).block(); // TODO: test validations } @@ -79,8 +83,9 @@ public class UserApiTest { */ @Test public void deleteUserTest() { - String username = null; - api.deleteUser(username).block(); + // uncomment below to test the function + //String username = null; + //api.deleteUser(username).block(); // TODO: test validations } @@ -92,8 +97,9 @@ public class UserApiTest { */ @Test public void getUserByNameTest() { - String username = null; - User response = api.getUserByName(username).block(); + // uncomment below to test the function + //String username = null; + //User response = api.getUserByName(username).block(); // TODO: test validations } @@ -105,9 +111,10 @@ public class UserApiTest { */ @Test public void loginUserTest() { - String username = null; - String password = null; - String response = api.loginUser(username, password).block(); + // uncomment below to test the function + //String username = null; + //String password = null; + //String response = api.loginUser(username, password).block(); // TODO: test validations } @@ -119,7 +126,8 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - api.logoutUser().block(); + // uncomment below to test the function + //api.logoutUser().block(); // TODO: test validations } @@ -131,9 +139,10 @@ public class UserApiTest { */ @Test public void updateUserTest() { - String username = null; - User user = null; - api.updateUser(username, user).block(); + // uncomment below to test the function + //String username = null; + //User user = null; + //api.updateUser(username, user).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce42..455a8256f3f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -18,24 +18,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -43,7 +43,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapProperty' */ @Test - public void mapPropertyTest() { + void mapPropertyTest() { // TODO: test mapProperty } @@ -51,7 +51,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapOfMapProperty' */ @Test - public void mapOfMapPropertyTest() { + void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..428a96e0eed 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AllOfWithSingleRef */ -public class AllOfWithSingleRefTest { +class AllOfWithSingleRefTest { private final AllOfWithSingleRef model = new AllOfWithSingleRef(); /** * Model tests for AllOfWithSingleRef */ @Test - public void testAllOfWithSingleRef() { + void testAllOfWithSingleRef() { // TODO: test AllOfWithSingleRef } @@ -42,7 +42,7 @@ public class AllOfWithSingleRefTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -50,7 +50,7 @@ public class AllOfWithSingleRefTest { * Test the property 'singleRefType' */ @Test - public void singleRefTypeTest() { + void singleRefTypeTest() { // TODO: test singleRefType } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java index 5845dfc5d94..0fad2077847 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,22 +21,22 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -44,7 +44,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -52,7 +52,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..e20b95c6506 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -18,25 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +45,7 @@ public class ArrayOfArrayOfNumberOnlyTest { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..25fbf3ae860 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -18,25 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +45,7 @@ public class ArrayOfNumberOnlyTest { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..be18c54a3bc 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -18,25 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +45,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +53,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +61,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..ba313f884d9 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -41,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -49,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -57,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -65,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -73,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -81,7 +81,7 @@ public class CapitalizationTest { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e3..d2835b6d602 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CatTest.java @@ -21,23 +21,23 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -45,7 +45,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +53,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +61,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..a9d373574b6 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -41,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 445815405cf..ae20302481a 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -24,21 +24,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable */ -public class ChildWithNullableTest { +class ChildWithNullableTest { private final ChildWithNullable model = new ChildWithNullable(); /** * Model tests for ChildWithNullable */ @Test - public void testChildWithNullable() { + void testChildWithNullable() { // TODO: test ChildWithNullable } @@ -46,7 +46,7 @@ public class ChildWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -54,7 +54,7 @@ public class ChildWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } @@ -62,7 +62,7 @@ public class ChildWithNullableTest { * Test the property 'otherProperty' */ @Test - public void otherPropertyTest() { + void otherPropertyTest() { // TODO: test otherProperty } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java index 2e6de32fac3..646ffebd075 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -42,7 +41,7 @@ public class ClassModelTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..554e01b734f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -41,7 +41,7 @@ public class ClientTest { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..0637c6f0e49 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DeprecatedObject */ -public class DeprecatedObjectTest { +class DeprecatedObjectTest { private final DeprecatedObject model = new DeprecatedObject(); /** * Model tests for DeprecatedObject */ @Test - public void testDeprecatedObject() { + void testDeprecatedObject() { // TODO: test DeprecatedObject } @@ -41,7 +41,7 @@ public class DeprecatedObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..df2338d60e1 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/DogTest.java @@ -21,23 +21,23 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +45,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +53,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +61,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..b045a666caa 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -18,24 +18,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +44,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +52,7 @@ public class EnumArraysTest { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..48aa1a737fc 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade7..af81056eaa5 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.OuterEnumDefaultValue; import org.openapitools.client.model.OuterEnumInteger; @@ -26,22 +27,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -49,7 +49,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -57,7 +57,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -65,7 +65,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -73,7 +73,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -81,7 +81,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } @@ -89,7 +89,7 @@ public class EnumTestTest { * Test the property 'outerEnumInteger' */ @Test - public void outerEnumIntegerTest() { + void outerEnumIntegerTest() { // TODO: test outerEnumInteger } @@ -97,7 +97,7 @@ public class EnumTestTest { * Test the property 'outerEnumDefaultValue' */ @Test - public void outerEnumDefaultValueTest() { + void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } @@ -105,7 +105,7 @@ public class EnumTestTest { * Test the property 'outerEnumIntegerDefaultValue' */ @Test - public void outerEnumIntegerDefaultValueTest() { + void outerEnumIntegerDefaultValueTest() { // TODO: test outerEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index d58e6baf475..a489af133c0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -22,21 +22,21 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response */ -public class FakeBigDecimalMap200ResponseTest { +class FakeBigDecimalMap200ResponseTest { private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); /** * Model tests for FakeBigDecimalMap200Response */ @Test - public void testFakeBigDecimalMap200Response() { + void testFakeBigDecimalMap200Response() { // TODO: test FakeBigDecimalMap200Response } @@ -44,7 +44,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someId' */ @Test - public void someIdTest() { + void someIdTest() { // TODO: test someId } @@ -52,7 +52,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someMap' */ @Test - public void someMapTest() { + void someMapTest() { // TODO: test someMap } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..04fbf298304 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -18,25 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +45,7 @@ public class FileSchemaTestClassTest { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +53,7 @@ public class FileSchemaTestClassTest { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..42bbed2c2a9 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FooGetDefaultResponse */ -public class FooGetDefaultResponseTest { +class FooGetDefaultResponseTest { private final FooGetDefaultResponse model = new FooGetDefaultResponse(); /** * Model tests for FooGetDefaultResponse */ @Test - public void testFooGetDefaultResponse() { + void testFooGetDefaultResponse() { // TODO: test FooGetDefaultResponse } @@ -42,7 +42,7 @@ public class FooGetDefaultResponseTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..2cfb0aa1e9e 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Foo */ -public class FooTest { +class FooTest { private final Foo model = new Foo(); /** * Model tests for Foo */ @Test - public void testFoo() { + void testFoo() { // TODO: test Foo } @@ -41,7 +41,7 @@ public class FooTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da1004..2e5a0bb50ff 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -18,27 +18,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -46,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -54,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -62,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -70,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -78,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -86,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -94,7 +94,7 @@ public class FormatTestTest { * Test the property 'decimal' */ @Test - public void decimalTest() { + void decimalTest() { // TODO: test decimal } @@ -102,7 +102,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -110,7 +110,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -118,7 +118,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -126,7 +126,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -134,7 +134,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -142,7 +142,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -150,7 +150,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -158,7 +158,7 @@ public class FormatTestTest { * Test the property 'patternWithDigits' */ @Test - public void patternWithDigitsTest() { + void patternWithDigitsTest() { // TODO: test patternWithDigits } @@ -166,7 +166,7 @@ public class FormatTestTest { * Test the property 'patternWithDigitsAndDelimiter' */ @Test - public void patternWithDigitsAndDelimiterTest() { + void patternWithDigitsAndDelimiterTest() { // TODO: test patternWithDigitsAndDelimiter } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..add61425d5d 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -41,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +49,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index ed27372eefd..d4b620c7b75 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -23,22 +23,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HealthCheckResult */ -public class HealthCheckResultTest { +class HealthCheckResultTest { private final HealthCheckResult model = new HealthCheckResult(); /** * Model tests for HealthCheckResult */ @Test - public void testHealthCheckResult() { + void testHealthCheckResult() { // TODO: test HealthCheckResult } @@ -46,7 +45,7 @@ public class HealthCheckResultTest { * Test the property 'nullableMessage' */ @Test - public void nullableMessageTest() { + void nullableMessageTest() { // TODO: test nullableMessage } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..47f7510c268 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -18,24 +18,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -43,7 +43,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -51,7 +51,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -59,7 +59,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -67,7 +67,7 @@ public class MapTestTest { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..558e4a8bfe3 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -18,27 +18,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -46,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -54,7 +54,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -62,7 +62,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 73b121652d6..e1cfc70e0c5 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -42,7 +41,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public class Model200ResponseTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..cc8f5ea57b0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -41,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -49,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -57,7 +57,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java index 399be4a982b..d08e44935c5 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -42,7 +41,7 @@ public class ModelFileTest { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..1f746099efc 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -41,7 +41,7 @@ public class ModelListTest { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java index cbd5b33c6da..38a470b8529 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -42,7 +41,7 @@ public class ModelReturnTest { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java index 6718c62ca9c..80b16a806fb 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NameTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -42,7 +41,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -58,7 +57,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -66,7 +65,7 @@ public class NameTest { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..764e7edfc07 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -18,10 +18,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,22 +31,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NullableClass */ -public class NullableClassTest { +class NullableClassTest { private final NullableClass model = new NullableClass(); /** * Model tests for NullableClass */ @Test - public void testNullableClass() { + void testNullableClass() { // TODO: test NullableClass } @@ -52,7 +53,7 @@ public class NullableClassTest { * Test the property 'integerProp' */ @Test - public void integerPropTest() { + void integerPropTest() { // TODO: test integerProp } @@ -60,7 +61,7 @@ public class NullableClassTest { * Test the property 'numberProp' */ @Test - public void numberPropTest() { + void numberPropTest() { // TODO: test numberProp } @@ -68,7 +69,7 @@ public class NullableClassTest { * Test the property 'booleanProp' */ @Test - public void booleanPropTest() { + void booleanPropTest() { // TODO: test booleanProp } @@ -76,7 +77,7 @@ public class NullableClassTest { * Test the property 'stringProp' */ @Test - public void stringPropTest() { + void stringPropTest() { // TODO: test stringProp } @@ -84,7 +85,7 @@ public class NullableClassTest { * Test the property 'dateProp' */ @Test - public void datePropTest() { + void datePropTest() { // TODO: test dateProp } @@ -92,7 +93,7 @@ public class NullableClassTest { * Test the property 'datetimeProp' */ @Test - public void datetimePropTest() { + void datetimePropTest() { // TODO: test datetimeProp } @@ -100,7 +101,7 @@ public class NullableClassTest { * Test the property 'arrayNullableProp' */ @Test - public void arrayNullablePropTest() { + void arrayNullablePropTest() { // TODO: test arrayNullableProp } @@ -108,7 +109,7 @@ public class NullableClassTest { * Test the property 'arrayAndItemsNullableProp' */ @Test - public void arrayAndItemsNullablePropTest() { + void arrayAndItemsNullablePropTest() { // TODO: test arrayAndItemsNullableProp } @@ -116,7 +117,7 @@ public class NullableClassTest { * Test the property 'arrayItemsNullable' */ @Test - public void arrayItemsNullableTest() { + void arrayItemsNullableTest() { // TODO: test arrayItemsNullable } @@ -124,7 +125,7 @@ public class NullableClassTest { * Test the property 'objectNullableProp' */ @Test - public void objectNullablePropTest() { + void objectNullablePropTest() { // TODO: test objectNullableProp } @@ -132,7 +133,7 @@ public class NullableClassTest { * Test the property 'objectAndItemsNullableProp' */ @Test - public void objectAndItemsNullablePropTest() { + void objectAndItemsNullablePropTest() { // TODO: test objectAndItemsNullableProp } @@ -140,7 +141,7 @@ public class NullableClassTest { * Test the property 'objectItemsNullable' */ @Test - public void objectItemsNullableTest() { + void objectItemsNullableTest() { // TODO: test objectItemsNullable } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..86a2386c609 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -42,7 +42,7 @@ public class NumberOnlyTest { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..4140c54e4a6 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -18,26 +18,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ObjectWithDeprecatedFields */ -public class ObjectWithDeprecatedFieldsTest { +class ObjectWithDeprecatedFieldsTest { private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); /** * Model tests for ObjectWithDeprecatedFields */ @Test - public void testObjectWithDeprecatedFields() { + void testObjectWithDeprecatedFields() { // TODO: test ObjectWithDeprecatedFields } @@ -45,7 +46,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +54,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -61,7 +62,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'deprecatedRef' */ @Test - public void deprecatedRefTest() { + void deprecatedRefTest() { // TODO: test deprecatedRef } @@ -69,7 +70,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'bars' */ @Test - public void barsTest() { + void barsTest() { // TODO: test bars } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..0c0d62b6bf7 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -42,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -58,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -66,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -74,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -82,7 +82,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..0262b1aeb04 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -42,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -50,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -58,7 +58,7 @@ public class OuterCompositeTest { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..d818b23c7d5 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumDefaultValue */ -public class OuterEnumDefaultValueTest { +class OuterEnumDefaultValueTest { /** * Model tests for OuterEnumDefaultValue */ @Test - public void testOuterEnumDefaultValue() { + void testOuterEnumDefaultValue() { // TODO: test OuterEnumDefaultValue } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..1d7b3338bca 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumIntegerDefaultValue */ -public class OuterEnumIntegerDefaultValueTest { +class OuterEnumIntegerDefaultValueTest { /** * Model tests for OuterEnumIntegerDefaultValue */ @Test - public void testOuterEnumIntegerDefaultValue() { + void testOuterEnumIntegerDefaultValue() { // TODO: test OuterEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..cacda46a76f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumInteger */ -public class OuterEnumIntegerTest { +class OuterEnumIntegerTest { /** * Model tests for OuterEnumInteger */ @Test - public void testOuterEnumInteger() { + void testOuterEnumInteger() { // TODO: test OuterEnumInteger } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..0333ee657a0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..f4ddea07c34 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -18,23 +18,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterObjectWithEnumProperty */ -public class OuterObjectWithEnumPropertyTest { +class OuterObjectWithEnumPropertyTest { private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); /** * Model tests for OuterObjectWithEnumProperty */ @Test - public void testOuterObjectWithEnumProperty() { + void testOuterObjectWithEnumProperty() { // TODO: test OuterObjectWithEnumProperty } @@ -42,7 +42,7 @@ public class OuterObjectWithEnumPropertyTest { * Test the property 'value' */ @Test - public void valueTest() { + void valueTest() { // TODO: test value } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index 870d9c13459..bd0822bc974 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -26,21 +26,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable */ -public class ParentWithNullableTest { +class ParentWithNullableTest { private final ParentWithNullable model = new ParentWithNullable(); /** * Model tests for ParentWithNullable */ @Test - public void testParentWithNullable() { + void testParentWithNullable() { // TODO: test ParentWithNullable } @@ -48,7 +48,7 @@ public class ParentWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -56,7 +56,7 @@ public class ParentWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..326497ac2f7 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/PetTest.java @@ -19,28 +19,29 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +49,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +57,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +65,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +73,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +81,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +89,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..12b8bab7ff8 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -41,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +49,7 @@ public class ReadOnlyFirstTest { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..476e4ca161b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SingleRefType */ -public class SingleRefTypeTest { +class SingleRefTypeTest { /** * Model tests for SingleRefType */ @Test - public void testSingleRefType() { + void testSingleRefType() { // TODO: test SingleRefType } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..93c8bc45202 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -41,7 +41,7 @@ public class SpecialModelNameTest { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..b9fef55d70e 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -41,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 1a95f95a218..d219c81ed5f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ -public class TestInlineFreeformAdditionalPropertiesRequestTest { +class TestInlineFreeformAdditionalPropertiesRequestTest { private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ @Test - public void testTestInlineFreeformAdditionalPropertiesRequest() { + void testTestInlineFreeformAdditionalPropertiesRequest() { // TODO: test TestInlineFreeformAdditionalPropertiesRequest } @@ -43,7 +43,7 @@ public class TestInlineFreeformAdditionalPropertiesRequestTest { * Test the property 'someProperty' */ @Test - public void somePropertyTest() { + void somePropertyTest() { // TODO: test someProperty } diff --git a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..bb6e3fd4732 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,22 +18,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -41,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -57,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -65,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -73,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -81,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -89,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -97,7 +97,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/webclient/.github/workflows/maven.yml b/samples/client/petstore/java/webclient/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/client/petstore/java/webclient/.github/workflows/maven.yml +++ b/samples/client/petstore/java/webclient/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index e34609ac630..db3d051b142 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -119,7 +119,7 @@ ext { jackson_version = "2.13.4" jackson_databind_version = "2.13.4.2" jackson_databind_nullable_version = "0.2.6" - junit_version = "4.13.2" + junit_version = "5.10.2" } dependencies { @@ -134,5 +134,5 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/webclient/docs/ParentWithNullable.md b/samples/client/petstore/java/webclient/docs/ParentWithNullable.md index b8fcf6b42e8..e4d32298563 100644 --- a/samples/client/petstore/java/webclient/docs/ParentWithNullable.md +++ b/samples/client/petstore/java/webclient/docs/ParentWithNullable.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDWITHNULLABLE | "ChildWithNullable" | +| CHILD_WITH_NULLABLE | "ChildWithNullable" | diff --git a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/webclient/gradlew b/samples/client/petstore/java/webclient/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/client/petstore/java/webclient/gradlew +++ b/samples/client/petstore/java/webclient/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/webclient/gradlew.bat b/samples/client/petstore/java/webclient/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/client/petstore/java/webclient/gradlew.bat +++ b/samples/client/petstore/java/webclient/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index 475fc63d50d..2b74c67f6cc 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.13.0 1.8 1.8 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.3.1 attach-sources @@ -112,8 +112,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -127,6 +127,6 @@ 1.3.5 3.4.34 1.0.39 - 4.13.2 + 5.10.2 diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cab1a91ecf6..6ec15b3b259 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -76,7 +76,6 @@ public class AdditionalPropertiesClass { this.mapProperty = mapProperty; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index bb578593d22..c7ec666bb18 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -67,7 +67,6 @@ public class AllOfWithSingleRef { this.username = username; } - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index e6d3fb6801e..3e5dfccd5dc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -49,7 +49,7 @@ public class Animal { protected String className; public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + protected String color = "red"; public Animal() { } @@ -79,7 +79,6 @@ public class Animal { this.className = className; } - public Animal color(String color) { this.color = color; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 56c2863353c..84b54e52155 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -82,7 +82,6 @@ public class ArrayTest { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; @@ -116,7 +115,6 @@ public class ArrayTest { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index 11dad988900..accb755a668 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -82,7 +82,6 @@ public class Capitalization { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; @@ -108,7 +107,6 @@ public class Capitalization { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; @@ -134,7 +132,6 @@ public class Capitalization { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; @@ -160,7 +157,6 @@ public class Capitalization { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; @@ -186,7 +182,6 @@ public class Capitalization { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index 25e1399a988..ed8e1e2da05 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -66,7 +66,6 @@ public class Category { this.id = id; } - public Category name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 8af99f889d1..100e5ba84e4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -139,7 +139,6 @@ public class EnumArrays { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index ca790c41027..04f1adb80ea 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -243,7 +243,6 @@ public class EnumTest { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; @@ -269,7 +268,6 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; @@ -295,7 +293,6 @@ public class EnumTest { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; @@ -321,7 +318,6 @@ public class EnumTest { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = JsonNullable.of(outerEnum); @@ -355,7 +351,6 @@ public class EnumTest { this.outerEnum = JsonNullable.of(outerEnum); } - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { this.outerEnumInteger = outerEnumInteger; @@ -381,7 +376,6 @@ public class EnumTest { this.outerEnumInteger = outerEnumInteger; } - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { this.outerEnumDefaultValue = outerEnumDefaultValue; @@ -407,7 +401,6 @@ public class EnumTest { this.outerEnumDefaultValue = outerEnumDefaultValue; } - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 0603bc3a013..19cb2632c90 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -70,7 +70,6 @@ public class FakeBigDecimalMap200Response { this.someId = someId; } - public FakeBigDecimalMap200Response someMap(Map someMap) { this.someMap = someMap; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index e7135557afb..a1327245a90 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -70,7 +70,6 @@ public class FileSchemaTestClass { this._file = _file; } - public FileSchemaTestClass files(List files) { this.files = files; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index 2652fbc3331..f76f9b027ec 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -130,7 +130,6 @@ public class FormatTest { this.integer = integer; } - public FormatTest int32(Integer int32) { this.int32 = int32; @@ -158,7 +157,6 @@ public class FormatTest { this.int32 = int32; } - public FormatTest int64(Long int64) { this.int64 = int64; @@ -184,7 +182,6 @@ public class FormatTest { this.int64 = int64; } - public FormatTest number(BigDecimal number) { this.number = number; @@ -212,7 +209,6 @@ public class FormatTest { this.number = number; } - public FormatTest _float(Float _float) { this._float = _float; @@ -240,7 +236,6 @@ public class FormatTest { this._float = _float; } - public FormatTest _double(Double _double) { this._double = _double; @@ -268,7 +263,6 @@ public class FormatTest { this._double = _double; } - public FormatTest decimal(BigDecimal decimal) { this.decimal = decimal; @@ -294,7 +288,6 @@ public class FormatTest { this.decimal = decimal; } - public FormatTest string(String string) { this.string = string; @@ -320,7 +313,6 @@ public class FormatTest { this.string = string; } - public FormatTest _byte(byte[] _byte) { this._byte = _byte; @@ -346,7 +338,6 @@ public class FormatTest { this._byte = _byte; } - public FormatTest binary(File binary) { this.binary = binary; @@ -372,7 +363,6 @@ public class FormatTest { this.binary = binary; } - public FormatTest date(LocalDate date) { this.date = date; @@ -398,7 +388,6 @@ public class FormatTest { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -424,7 +413,6 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { this.uuid = uuid; @@ -450,7 +438,6 @@ public class FormatTest { this.uuid = uuid; } - public FormatTest password(String password) { this.password = password; @@ -476,7 +463,6 @@ public class FormatTest { this.password = password; } - public FormatTest patternWithDigits(String patternWithDigits) { this.patternWithDigits = patternWithDigits; @@ -502,7 +488,6 @@ public class FormatTest { this.patternWithDigits = patternWithDigits; } - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index f1fa3229c92..9fc24a2b7f4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -41,7 +41,9 @@ public class HasOnlyReadOnly { public HasOnlyReadOnly() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public HasOnlyReadOnly( @JsonProperty(JSON_PROPERTY_BAR) String bar, @@ -66,7 +68,6 @@ public class HasOnlyReadOnly { - /** * Get foo * @return foo diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index d0c703482c7..5838ebb17ef 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -119,7 +119,6 @@ public class MapTest { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; @@ -153,7 +152,6 @@ public class MapTest { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { this.directMap = directMap; @@ -187,7 +185,6 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7974465691c..3da490046f0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -75,7 +75,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; @@ -101,7 +100,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index efe33f45695..517b2eb9f07 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -67,7 +67,6 @@ public class Model200Response { this.name = name; } - public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 45607a9371e..c8f27c57192 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -71,7 +71,6 @@ public class ModelApiResponse { this.code = code; } - public ModelApiResponse type(String type) { this.type = type; @@ -97,7 +96,6 @@ public class ModelApiResponse { this.type = type; } - public ModelApiResponse message(String message) { this.message = message; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index bc51656e4a1..458314f0d83 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -48,7 +48,9 @@ public class Name { public Name() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public Name( @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, @@ -84,7 +86,6 @@ public class Name { this.name = name; } - /** * Get snakeCase * @return snakeCase @@ -99,7 +100,6 @@ public class Name { - public Name property(String property) { this.property = property; @@ -125,7 +125,6 @@ public class Name { this.property = property; } - /** * Get _123number * @return _123number diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index 01b6bc8f2a9..9317f72b97e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java @@ -127,7 +127,6 @@ public class NullableClass extends HashMap { this.integerProp = JsonNullable.of(integerProp); } - public NullableClass numberProp(BigDecimal numberProp) { this.numberProp = JsonNullable.of(numberProp); @@ -161,7 +160,6 @@ public class NullableClass extends HashMap { this.numberProp = JsonNullable.of(numberProp); } - public NullableClass booleanProp(Boolean booleanProp) { this.booleanProp = JsonNullable.of(booleanProp); @@ -195,7 +193,6 @@ public class NullableClass extends HashMap { this.booleanProp = JsonNullable.of(booleanProp); } - public NullableClass stringProp(String stringProp) { this.stringProp = JsonNullable.of(stringProp); @@ -229,7 +226,6 @@ public class NullableClass extends HashMap { this.stringProp = JsonNullable.of(stringProp); } - public NullableClass dateProp(LocalDate dateProp) { this.dateProp = JsonNullable.of(dateProp); @@ -263,7 +259,6 @@ public class NullableClass extends HashMap { this.dateProp = JsonNullable.of(dateProp); } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { this.datetimeProp = JsonNullable.of(datetimeProp); @@ -297,7 +292,6 @@ public class NullableClass extends HashMap { this.datetimeProp = JsonNullable.of(datetimeProp); } - public NullableClass arrayNullableProp(List arrayNullableProp) { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); @@ -343,7 +337,6 @@ public class NullableClass extends HashMap { this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); } - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); @@ -389,7 +382,6 @@ public class NullableClass extends HashMap { this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); } - public NullableClass arrayItemsNullable(List arrayItemsNullable) { this.arrayItemsNullable = arrayItemsNullable; @@ -423,7 +415,6 @@ public class NullableClass extends HashMap { this.arrayItemsNullable = arrayItemsNullable; } - public NullableClass objectNullableProp(Map objectNullableProp) { this.objectNullableProp = JsonNullable.>of(objectNullableProp); @@ -469,7 +460,6 @@ public class NullableClass extends HashMap { this.objectNullableProp = JsonNullable.>of(objectNullableProp); } - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); @@ -515,7 +505,6 @@ public class NullableClass extends HashMap { this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); } - public NullableClass objectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index d28ddafb90b..69cbd86f940 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -79,7 +79,6 @@ public class ObjectWithDeprecatedFields { this.uuid = uuid; } - public ObjectWithDeprecatedFields id(BigDecimal id) { this.id = id; @@ -107,7 +106,6 @@ public class ObjectWithDeprecatedFields { this.id = id; } - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -135,7 +133,6 @@ public class ObjectWithDeprecatedFields { this.deprecatedRef = deprecatedRef; } - public ObjectWithDeprecatedFields bars(List bars) { this.bars = bars; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index 492cd0fc058..05dfbdaeefa 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -120,7 +120,6 @@ public class Order { this.id = id; } - public Order petId(Long petId) { this.petId = petId; @@ -146,7 +145,6 @@ public class Order { this.petId = petId; } - public Order quantity(Integer quantity) { this.quantity = quantity; @@ -172,7 +170,6 @@ public class Order { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; @@ -198,7 +195,6 @@ public class Order { this.shipDate = shipDate; } - public Order status(StatusEnum status) { this.status = status; @@ -224,7 +220,6 @@ public class Order { this.status = status; } - public Order complete(Boolean complete) { this.complete = complete; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 4190bf092ca..7045f92dd8f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -71,7 +71,6 @@ public class OuterComposite { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { this.myString = myString; @@ -97,7 +96,6 @@ public class OuterComposite { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java index e3705e43937..0f980144308 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -52,7 +52,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -85,7 +85,7 @@ public class ParentWithNullable { protected TypeEnum type; public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty"; - private JsonNullable nullableProperty = JsonNullable.undefined(); + protected JsonNullable nullableProperty = JsonNullable.undefined(); public ParentWithNullable() { } @@ -115,7 +115,6 @@ public class ParentWithNullable { this.type = type; } - public ParentWithNullable nullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index ca0962d2e5b..db2a0eb0547 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -127,7 +127,6 @@ public class Pet { this.id = id; } - public Pet category(Category category) { this.category = category; @@ -153,7 +152,6 @@ public class Pet { this.category = category; } - public Pet name(String name) { this.name = name; @@ -179,7 +177,6 @@ public class Pet { this.name = name; } - public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; @@ -214,7 +211,6 @@ public class Pet { this.photoUrls = photoUrls; } - public Pet tags(List tags) { this.tags = tags; @@ -248,7 +244,6 @@ public class Pet { this.tags = tags; } - public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f9f3a6eee92..d585c01ecc3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -40,7 +40,9 @@ public class ReadOnlyFirst { public ReadOnlyFirst() { } - + /** + * Constructor with only readonly parameters + */ @JsonCreator public ReadOnlyFirst( @JsonProperty(JSON_PROPERTY_BAR) String bar @@ -63,7 +65,6 @@ public class ReadOnlyFirst { - public ReadOnlyFirst baz(String baz) { this.baz = baz; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 27b9eb388db..201029ba21a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -66,7 +66,6 @@ public class Tag { this.id = id; } - public Tag name(String name) { this.name = name; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 8ed799606d5..b501d23345c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -90,7 +90,6 @@ public class User { this.id = id; } - public User username(String username) { this.username = username; @@ -116,7 +115,6 @@ public class User { this.username = username; } - public User firstName(String firstName) { this.firstName = firstName; @@ -142,7 +140,6 @@ public class User { this.firstName = firstName; } - public User lastName(String lastName) { this.lastName = lastName; @@ -168,7 +165,6 @@ public class User { this.lastName = lastName; } - public User email(String email) { this.email = email; @@ -194,7 +190,6 @@ public class User { this.email = email; } - public User password(String password) { this.password = password; @@ -220,7 +215,6 @@ public class User { this.password = password; } - public User phone(String phone) { this.phone = phone; @@ -246,7 +240,6 @@ public class User { this.phone = phone; } - public User userStatus(Integer userStatus) { this.userStatus = userStatus; diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 963f3a25c7c..84aa307bcf3 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for AnotherFakeApi */ -@Ignore +@Disabled public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); @@ -39,8 +40,9 @@ public class AnotherFakeApiTest { */ @Test public void call123testSpecialTagsTest() { - Client client = null; - Client response = api.call123testSpecialTags(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.call123testSpecialTags(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java index bc3c03eac1f..2b366bb36a0 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for DefaultApi */ -@Ignore +@Disabled public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); @@ -39,7 +40,8 @@ public class DefaultApiTest { */ @Test public void fooGetTest() { - FooGetDefaultResponse response = api.fooGet().block(); + // uncomment below to test the function + //FooGetDefaultResponse response = api.fooGet().block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java index c67c0b507a2..a80ad43c5c3 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -14,19 +14,23 @@ package org.openapitools.client.api; import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; import java.time.LocalDate; import java.time.OffsetDateTime; -import org.openapitools.client.model.EnumClass; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -37,12 +41,25 @@ import java.util.stream.Collectors; /** * API tests for FakeApi */ -@Ignore +@Disabled public class FakeApiTest { private final FakeApi api = new FakeApi(); + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + // uncomment below to test the function + //FakeBigDecimalMap200Response response = api.fakeBigDecimalMap().block(); + + // TODO: test validations + } + /** * Health check endpoint * @@ -50,7 +67,8 @@ public class FakeApiTest { */ @Test public void fakeHealthGetTest() { - HealthCheckResult response = api.fakeHealthGet().block(); + // uncomment below to test the function + //HealthCheckResult response = api.fakeHealthGet().block(); // TODO: test validations } @@ -62,10 +80,11 @@ public class FakeApiTest { */ @Test public void fakeHttpSignatureTestTest() { - Pet pet = null; - String query1 = null; - String header1 = null; - api.fakeHttpSignatureTest(pet, query1, header1).block(); + // uncomment below to test the function + //Pet pet = null; + //String query1 = null; + //String header1 = null; + //api.fakeHttpSignatureTest(pet, query1, header1).block(); // TODO: test validations } @@ -77,8 +96,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body).block(); + // uncomment below to test the function + //Boolean body = null; + //Boolean response = api.fakeOuterBooleanSerialize(body).block(); // TODO: test validations } @@ -90,8 +110,9 @@ public class FakeApiTest { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite outerComposite = null; - OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); + // uncomment below to test the function + //OuterComposite outerComposite = null; + //OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite).block(); // TODO: test validations } @@ -103,8 +124,9 @@ public class FakeApiTest { */ @Test public void fakeOuterNumberSerializeTest() { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body).block(); + // uncomment below to test the function + //BigDecimal body = null; + //BigDecimal response = api.fakeOuterNumberSerialize(body).block(); // TODO: test validations } @@ -116,8 +138,9 @@ public class FakeApiTest { */ @Test public void fakeOuterStringSerializeTest() { - String body = null; - String response = api.fakeOuterStringSerialize(body).block(); + // uncomment below to test the function + //String body = null; + //String response = api.fakeOuterStringSerialize(body).block(); // TODO: test validations } @@ -129,8 +152,23 @@ public class FakeApiTest { */ @Test public void fakePropertyEnumIntegerSerializeTest() { - OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; - OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + // uncomment below to test the function + //OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + //OuterObjectWithEnumProperty response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty).block(); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testAdditionalPropertiesReference(requestBody).block(); // TODO: test validations } @@ -142,8 +180,9 @@ public class FakeApiTest { */ @Test public void testBodyWithBinaryTest() { - File body = null; - api.testBodyWithBinary(body).block(); + // uncomment below to test the function + //File body = null; + //api.testBodyWithBinary(body).block(); // TODO: test validations } @@ -155,8 +194,9 @@ public class FakeApiTest { */ @Test public void testBodyWithFileSchemaTest() { - FileSchemaTestClass fileSchemaTestClass = null; - api.testBodyWithFileSchema(fileSchemaTestClass).block(); + // uncomment below to test the function + //FileSchemaTestClass fileSchemaTestClass = null; + //api.testBodyWithFileSchema(fileSchemaTestClass).block(); // TODO: test validations } @@ -168,9 +208,10 @@ public class FakeApiTest { */ @Test public void testBodyWithQueryParamsTest() { - String query = null; - User user = null; - api.testBodyWithQueryParams(query, user).block(); + // uncomment below to test the function + //String query = null; + //User user = null; + //api.testBodyWithQueryParams(query, user).block(); // TODO: test validations } @@ -182,8 +223,9 @@ public class FakeApiTest { */ @Test public void testClientModelTest() { - Client client = null; - Client response = api.testClientModel(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClientModel(client).block(); // TODO: test validations } @@ -195,21 +237,22 @@ public class FakeApiTest { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); + // uncomment below to test the function + //BigDecimal number = null; + //Double _double = null; + //String patternWithoutDelimiter = null; + //byte[] _byte = null; + //Integer integer = null; + //Integer int32 = null; + //Long int64 = null; + //Float _float = null; + //String string = null; + //File binary = null; + //LocalDate date = null; + //OffsetDateTime dateTime = null; + //String password = null; + //String paramCallback = null; + //api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).block(); // TODO: test validations } @@ -221,16 +264,17 @@ public class FakeApiTest { */ @Test public void testEnumParametersTest() { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - List enumQueryModelArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumFormStringArray = null; - String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); + // uncomment below to test the function + //List enumHeaderStringArray = null; + //String enumHeaderString = null; + //List enumQueryStringArray = null; + //String enumQueryString = null; + //Integer enumQueryInteger = null; + //Double enumQueryDouble = null; + //List enumQueryModelArray = null; + //List enumFormStringArray = null; + //String enumFormString = null; + //api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).block(); // TODO: test validations } @@ -242,13 +286,14 @@ public class FakeApiTest { */ @Test public void testGroupParametersTest() { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); + // uncomment below to test the function + //Integer requiredStringGroup = null; + //Boolean requiredBooleanGroup = null; + //Long requiredInt64Group = null; + //Integer stringGroup = null; + //Boolean booleanGroup = null; + //Long int64Group = null; + //api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).block(); // TODO: test validations } @@ -260,8 +305,23 @@ public class FakeApiTest { */ @Test public void testInlineAdditionalPropertiesTest() { - Map requestBody = null; - api.testInlineAdditionalProperties(requestBody).block(); + // uncomment below to test the function + //Map requestBody = null; + //api.testInlineAdditionalProperties(requestBody).block(); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // uncomment below to test the function + //TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + //api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest).block(); // TODO: test validations } @@ -273,9 +333,24 @@ public class FakeApiTest { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2).block(); + // uncomment below to test the function + //String param = null; + //String param2 = null; + //api.testJsonFormData(param, param2).block(); + + // TODO: test validations + } + + /** + * test nullable parent property + * + * + */ + @Test + public void testNullableTest() { + // uncomment below to test the function + //ChildWithNullable childWithNullable = null; + //api.testNullable(childWithNullable).block(); // TODO: test validations } @@ -287,14 +362,29 @@ public class FakeApiTest { */ @Test public void testQueryParameterCollectionFormatTest() { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - String allowEmpty = null; - Map language = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + // uncomment below to test the function + //List pipe = null; + //List ioutil = null; + //List http = null; + //List url = null; + //List context = null; + //String allowEmpty = null; + //Map language = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language).block(); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + */ + @Test + public void testStringMapReferenceTest() { + // uncomment below to test the function + //Map requestBody = null; + //api.testStringMapReference(requestBody).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 6ce8be5ccba..a3654c1f1d0 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for FakeClassnameTags123Api */ -@Ignore +@Disabled public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); @@ -39,8 +40,9 @@ public class FakeClassnameTags123ApiTest { */ @Test public void testClassnameTest() { - Client client = null; - Client response = api.testClassname(client).block(); + // uncomment below to test the function + //Client client = null; + //Client response = api.testClassname(client).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java index b4f8d9ec962..d79731eb943 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -17,8 +17,9 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.Set; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -29,7 +30,7 @@ import java.util.stream.Collectors; /** * API tests for PetApi */ -@Ignore +@Disabled public class PetApiTest { private final PetApi api = new PetApi(); @@ -42,8 +43,9 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet pet = null; - api.addPet(pet).block(); + // uncomment below to test the function + //Pet pet = null; + //api.addPet(pet).block(); // TODO: test validations } @@ -55,9 +57,10 @@ public class PetApiTest { */ @Test public void deletePetTest() { - Long petId = null; - String apiKey = null; - api.deletePet(petId, apiKey).block(); + // uncomment below to test the function + //Long petId = null; + //String apiKey = null; + //api.deletePet(petId, apiKey).block(); // TODO: test validations } @@ -69,8 +72,9 @@ public class PetApiTest { */ @Test public void findPetsByStatusTest() { - List status = null; - List response = api.findPetsByStatus(status); + // uncomment below to test the function + //List status = null; + //List response = api.findPetsByStatus(status); // TODO: test validations } @@ -82,8 +86,9 @@ public class PetApiTest { */ @Test public void findPetsByTagsTest() { - Set tags = null; - Set response = api.findPetsByTags(tags); + // uncomment below to test the function + //Set tags = null; + //Set response = api.findPetsByTags(tags); // TODO: test validations } @@ -95,8 +100,9 @@ public class PetApiTest { */ @Test public void getPetByIdTest() { - Long petId = null; - Pet response = api.getPetById(petId); + // uncomment below to test the function + //Long petId = null; + //Pet response = api.getPetById(petId); // TODO: test validations } @@ -108,8 +114,9 @@ public class PetApiTest { */ @Test public void updatePetTest() { - Pet pet = null; - api.updatePet(pet); + // uncomment below to test the function + //Pet pet = null; + //api.updatePet(pet); // TODO: test validations } @@ -121,10 +128,11 @@ public class PetApiTest { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status).block(); + // uncomment below to test the function + //Long petId = null; + //String name = null; + //String status = null; + //api.updatePetWithForm(petId, name, status).block(); // TODO: test validations } @@ -136,10 +144,11 @@ public class PetApiTest { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File _file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); + // uncomment below to test the function + //Long petId = null; + //String additionalMetadata = null; + //File _file = null; + //ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file).block(); // TODO: test validations } @@ -151,10 +160,11 @@ public class PetApiTest { */ @Test public void uploadFileWithRequiredFileTest() { - Long petId = null; - File requiredFile = null; - String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); + // uncomment below to test the function + //Long petId = null; + //File requiredFile = null; + //String additionalMetadata = null; + //ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/StoreApiTest.java index 4e4841aa45c..30645d01855 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -14,8 +14,9 @@ package org.openapitools.client.api; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +27,7 @@ import java.util.stream.Collectors; /** * API tests for StoreApi */ -@Ignore +@Disabled public class StoreApiTest { private final StoreApi api = new StoreApi(); @@ -39,8 +40,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() { - String orderId = null; - api.deleteOrder(orderId).block(); + // uncomment below to test the function + //String orderId = null; + //api.deleteOrder(orderId).block(); // TODO: test validations } @@ -52,7 +54,8 @@ public class StoreApiTest { */ @Test public void getInventoryTest() { - Map response = api.getInventory().block(); + // uncomment below to test the function + //Map response = api.getInventory().block(); // TODO: test validations } @@ -64,8 +67,9 @@ public class StoreApiTest { */ @Test public void getOrderByIdTest() { - Long orderId = null; - Order response = api.getOrderById(orderId).block(); + // uncomment below to test the function + //Long orderId = null; + //Order response = api.getOrderById(orderId).block(); // TODO: test validations } @@ -77,8 +81,9 @@ public class StoreApiTest { */ @Test public void placeOrderTest() { - Order order = null; - Order response = api.placeOrder(order).block(); + // uncomment below to test the function + //Order order = null; + //Order response = api.placeOrder(order).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/UserApiTest.java index 7a3561a9b35..3f8d134b97c 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -15,8 +15,9 @@ package org.openapitools.client.api; import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.HashMap; @@ -27,7 +28,7 @@ import java.util.stream.Collectors; /** * API tests for UserApi */ -@Ignore +@Disabled public class UserApiTest { private final UserApi api = new UserApi(); @@ -40,8 +41,9 @@ public class UserApiTest { */ @Test public void createUserTest() { - User user = null; - api.createUser(user).block(); + // uncomment below to test the function + //User user = null; + //api.createUser(user).block(); // TODO: test validations } @@ -53,8 +55,9 @@ public class UserApiTest { */ @Test public void createUsersWithArrayInputTest() { - List user = null; - api.createUsersWithArrayInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithArrayInput(user).block(); // TODO: test validations } @@ -66,8 +69,9 @@ public class UserApiTest { */ @Test public void createUsersWithListInputTest() { - List user = null; - api.createUsersWithListInput(user).block(); + // uncomment below to test the function + //List user = null; + //api.createUsersWithListInput(user).block(); // TODO: test validations } @@ -79,8 +83,9 @@ public class UserApiTest { */ @Test public void deleteUserTest() { - String username = null; - api.deleteUser(username).block(); + // uncomment below to test the function + //String username = null; + //api.deleteUser(username).block(); // TODO: test validations } @@ -92,8 +97,9 @@ public class UserApiTest { */ @Test public void getUserByNameTest() { - String username = null; - User response = api.getUserByName(username).block(); + // uncomment below to test the function + //String username = null; + //User response = api.getUserByName(username).block(); // TODO: test validations } @@ -105,9 +111,10 @@ public class UserApiTest { */ @Test public void loginUserTest() { - String username = null; - String password = null; - String response = api.loginUser(username, password).block(); + // uncomment below to test the function + //String username = null; + //String password = null; + //String response = api.loginUser(username, password).block(); // TODO: test validations } @@ -119,7 +126,8 @@ public class UserApiTest { */ @Test public void logoutUserTest() { - api.logoutUser().block(); + // uncomment below to test the function + //api.logoutUser().block(); // TODO: test validations } @@ -131,9 +139,10 @@ public class UserApiTest { */ @Test public void updateUserTest() { - String username = null; - User user = null; - api.updateUser(username, user).block(); + // uncomment below to test the function + //String username = null; + //User user = null; + //api.updateUser(username, user).block(); // TODO: test validations } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce42..6bdecfe07c9 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -43,7 +42,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapProperty' */ @Test - public void mapPropertyTest() { + void mapPropertyTest() { // TODO: test mapProperty } @@ -51,7 +50,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapOfMapProperty' */ @Test - public void mapOfMapPropertyTest() { + void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969..f4b06d323d6 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for AllOfWithSingleRef */ -public class AllOfWithSingleRefTest { +class AllOfWithSingleRefTest { private final AllOfWithSingleRef model = new AllOfWithSingleRef(); /** * Model tests for AllOfWithSingleRef */ @Test - public void testAllOfWithSingleRef() { + void testAllOfWithSingleRef() { // TODO: test AllOfWithSingleRef } @@ -42,7 +41,7 @@ public class AllOfWithSingleRefTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -50,7 +49,7 @@ public class AllOfWithSingleRefTest { * Test the property 'singleRefType' */ @Test - public void singleRefTypeTest() { + void singleRefTypeTest() { // TODO: test singleRefType } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AnimalTest.java index 15d5c977c6b..24776d3cb51 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -21,24 +21,21 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -46,7 +43,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +51,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec..6bbe877044d 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfArrayOfNumberOnlyTest { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc..eaf908bb1ab 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -20,23 +20,23 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -44,7 +44,7 @@ public class ArrayOfNumberOnlyTest { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c..99c6bcf5360 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -44,7 +44,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -52,7 +52,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -60,7 +60,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a07..a0217acd1f2 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -41,7 +40,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -49,7 +48,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -57,7 +56,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -65,7 +64,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -73,7 +72,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -81,7 +80,7 @@ public class CapitalizationTest { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e3..1b389a075be 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CatTest.java @@ -22,22 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -45,7 +44,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +52,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +60,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e6..22fcbd7f3cc 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -41,7 +40,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java index 2616181bec3..a89d26497bc 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java @@ -23,21 +23,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.ParentWithNullable; import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ChildWithNullable */ -public class ChildWithNullableTest { +class ChildWithNullableTest { private final ChildWithNullable model = new ChildWithNullable(); /** * Model tests for ChildWithNullable */ @Test - public void testChildWithNullable() { + void testChildWithNullable() { // TODO: test ChildWithNullable } @@ -45,7 +45,7 @@ public class ChildWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -53,7 +53,7 @@ public class ChildWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } @@ -61,7 +61,7 @@ public class ChildWithNullableTest { * Test the property 'otherProperty' */ @Test - public void otherPropertyTest() { + void otherPropertyTest() { // TODO: test otherProperty } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e..6ef5c744fbc 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -41,7 +40,7 @@ public class ClassModelTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b74..8028f11bc2b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ClientTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -41,7 +40,7 @@ public class ClientTest { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af..b04c2097b20 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for DeprecatedObject */ -public class DeprecatedObjectTest { +class DeprecatedObjectTest { private final DeprecatedObject model = new DeprecatedObject(); /** * Model tests for DeprecatedObject */ @Test - public void testDeprecatedObject() { + void testDeprecatedObject() { // TODO: test DeprecatedObject } @@ -41,7 +40,7 @@ public class DeprecatedObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bd..b2a12ab4c5e 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/DogTest.java @@ -22,22 +22,21 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -45,7 +44,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -53,7 +52,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -61,7 +60,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c..4a755b0d442 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -19,23 +19,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -43,7 +43,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -51,7 +51,7 @@ public class EnumArraysTest { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..48aa1a737fc 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade7..1e65944cbdc 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -26,22 +26,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -49,7 +48,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -57,7 +56,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -65,7 +64,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -73,7 +72,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -81,7 +80,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } @@ -89,7 +88,7 @@ public class EnumTestTest { * Test the property 'outerEnumInteger' */ @Test - public void outerEnumIntegerTest() { + void outerEnumIntegerTest() { // TODO: test outerEnumInteger } @@ -97,7 +96,7 @@ public class EnumTestTest { * Test the property 'outerEnumDefaultValue' */ @Test - public void outerEnumDefaultValueTest() { + void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } @@ -105,7 +104,7 @@ public class EnumTestTest { * Test the property 'outerEnumIntegerDefaultValue' */ @Test - public void outerEnumIntegerDefaultValueTest() { + void outerEnumIntegerDefaultValueTest() { // TODO: test outerEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java index 88c1d374be6..3250ad91974 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -21,21 +21,21 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FakeBigDecimalMap200Response */ -public class FakeBigDecimalMap200ResponseTest { +class FakeBigDecimalMap200ResponseTest { private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); /** * Model tests for FakeBigDecimalMap200Response */ @Test - public void testFakeBigDecimalMap200Response() { + void testFakeBigDecimalMap200Response() { // TODO: test FakeBigDecimalMap200Response } @@ -43,7 +43,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someId' */ @Test - public void someIdTest() { + void someIdTest() { // TODO: test someId } @@ -51,7 +51,7 @@ public class FakeBigDecimalMap200ResponseTest { * Test the property 'someMap' */ @Test - public void someMapTest() { + void someMapTest() { // TODO: test someMap } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bc..0048cb2c749 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -19,24 +19,24 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +44,7 @@ public class FileSchemaTestClassTest { * Test the property '_file' */ @Test - public void _fileTest() { + void _fileTest() { // TODO: test _file } @@ -52,7 +52,7 @@ public class FileSchemaTestClassTest { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c..81bc69c9a7b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FooGetDefaultResponse */ -public class FooGetDefaultResponseTest { +class FooGetDefaultResponseTest { private final FooGetDefaultResponse model = new FooGetDefaultResponse(); /** * Model tests for FooGetDefaultResponse */ @Test - public void testFooGetDefaultResponse() { + void testFooGetDefaultResponse() { // TODO: test FooGetDefaultResponse } @@ -42,7 +41,7 @@ public class FooGetDefaultResponseTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a798..a9e2c8c126e 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FooTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Foo */ -public class FooTest { +class FooTest { private final Foo model = new Foo(); /** * Model tests for Foo */ @Test - public void testFoo() { + void testFoo() { // TODO: test Foo } @@ -41,7 +40,7 @@ public class FooTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da1004..38a39e1c0ca 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -23,22 +23,21 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -46,7 +45,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -54,7 +53,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -62,7 +61,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -70,7 +69,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -78,7 +77,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -86,7 +85,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -94,7 +93,7 @@ public class FormatTestTest { * Test the property 'decimal' */ @Test - public void decimalTest() { + void decimalTest() { // TODO: test decimal } @@ -102,7 +101,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -110,7 +109,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -118,7 +117,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -126,7 +125,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -134,7 +133,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -142,7 +141,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -150,7 +149,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -158,7 +157,7 @@ public class FormatTestTest { * Test the property 'patternWithDigits' */ @Test - public void patternWithDigitsTest() { + void patternWithDigitsTest() { // TODO: test patternWithDigits } @@ -166,7 +165,7 @@ public class FormatTestTest { * Test the property 'patternWithDigitsAndDelimiter' */ @Test - public void patternWithDigitsAndDelimiterTest() { + void patternWithDigitsAndDelimiterTest() { // TODO: test patternWithDigitsAndDelimiter } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d4500..908f0aff6ed 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -41,7 +40,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9..0f45c2fcd5b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -22,22 +22,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for HealthCheckResult */ -public class HealthCheckResultTest { +class HealthCheckResultTest { private final HealthCheckResult model = new HealthCheckResult(); /** * Model tests for HealthCheckResult */ @Test - public void testHealthCheckResult() { + void testHealthCheckResult() { // TODO: test HealthCheckResult } @@ -45,7 +44,7 @@ public class HealthCheckResultTest { * Test the property 'nullableMessage' */ @Test - public void nullableMessageTest() { + void nullableMessageTest() { // TODO: test nullableMessage } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472b..3752c5ba31f 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -20,22 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -43,7 +42,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -51,7 +50,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -59,7 +58,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -67,7 +66,7 @@ public class MapTestTest { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96be..0f47e193af8 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -23,22 +23,21 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -46,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -54,7 +53,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -62,7 +61,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f976198..5743b70142b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -41,7 +40,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public class Model200ResponseTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e..436e4abd59e 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -41,7 +40,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -49,7 +48,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -57,7 +56,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71be..f128d7b9ac2 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelFile */ -public class ModelFileTest { +class ModelFileTest { private final ModelFile model = new ModelFile(); /** * Model tests for ModelFile */ @Test - public void testModelFile() { + void testModelFile() { // TODO: test ModelFile } @@ -41,7 +40,7 @@ public class ModelFileTest { * Test the property 'sourceURI' */ @Test - public void sourceURITest() { + void sourceURITest() { // TODO: test sourceURI } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5..92273f48d23 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelList */ -public class ModelListTest { +class ModelListTest { private final ModelList model = new ModelList(); /** * Model tests for ModelList */ @Test - public void testModelList() { + void testModelList() { // TODO: test ModelList } @@ -41,7 +40,7 @@ public class ModelListTest { * Test the property '_123list' */ @Test - public void _123listTest() { + void _123listTest() { // TODO: test _123list } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d23..1c5337654cd 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -41,7 +40,7 @@ public class ModelReturnTest { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb40..1a6aa18fa20 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -41,7 +40,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -49,7 +48,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -57,7 +56,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -65,7 +64,7 @@ public class NameTest { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913..d960ef76e5c 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -22,6 +22,7 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,22 +30,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NullableClass */ -public class NullableClassTest { +class NullableClassTest { private final NullableClass model = new NullableClass(); /** * Model tests for NullableClass */ @Test - public void testNullableClass() { + void testNullableClass() { // TODO: test NullableClass } @@ -52,7 +52,7 @@ public class NullableClassTest { * Test the property 'integerProp' */ @Test - public void integerPropTest() { + void integerPropTest() { // TODO: test integerProp } @@ -60,7 +60,7 @@ public class NullableClassTest { * Test the property 'numberProp' */ @Test - public void numberPropTest() { + void numberPropTest() { // TODO: test numberProp } @@ -68,7 +68,7 @@ public class NullableClassTest { * Test the property 'booleanProp' */ @Test - public void booleanPropTest() { + void booleanPropTest() { // TODO: test booleanProp } @@ -76,7 +76,7 @@ public class NullableClassTest { * Test the property 'stringProp' */ @Test - public void stringPropTest() { + void stringPropTest() { // TODO: test stringProp } @@ -84,7 +84,7 @@ public class NullableClassTest { * Test the property 'dateProp' */ @Test - public void datePropTest() { + void datePropTest() { // TODO: test dateProp } @@ -92,7 +92,7 @@ public class NullableClassTest { * Test the property 'datetimeProp' */ @Test - public void datetimePropTest() { + void datetimePropTest() { // TODO: test datetimeProp } @@ -100,7 +100,7 @@ public class NullableClassTest { * Test the property 'arrayNullableProp' */ @Test - public void arrayNullablePropTest() { + void arrayNullablePropTest() { // TODO: test arrayNullableProp } @@ -108,7 +108,7 @@ public class NullableClassTest { * Test the property 'arrayAndItemsNullableProp' */ @Test - public void arrayAndItemsNullablePropTest() { + void arrayAndItemsNullablePropTest() { // TODO: test arrayAndItemsNullableProp } @@ -116,7 +116,7 @@ public class NullableClassTest { * Test the property 'arrayItemsNullable' */ @Test - public void arrayItemsNullableTest() { + void arrayItemsNullableTest() { // TODO: test arrayItemsNullable } @@ -124,7 +124,7 @@ public class NullableClassTest { * Test the property 'objectNullableProp' */ @Test - public void objectNullablePropTest() { + void objectNullablePropTest() { // TODO: test objectNullableProp } @@ -132,7 +132,7 @@ public class NullableClassTest { * Test the property 'objectAndItemsNullableProp' */ @Test - public void objectAndItemsNullablePropTest() { + void objectAndItemsNullablePropTest() { // TODO: test objectAndItemsNullableProp } @@ -140,7 +140,7 @@ public class NullableClassTest { * Test the property 'objectItemsNullable' */ @Test - public void objectItemsNullableTest() { + void objectItemsNullableTest() { // TODO: test objectItemsNullable } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad..8623386a5e9 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -42,7 +41,7 @@ public class NumberOnlyTest { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3d..aa755cf8cb4 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -20,24 +20,24 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ObjectWithDeprecatedFields */ -public class ObjectWithDeprecatedFieldsTest { +class ObjectWithDeprecatedFieldsTest { private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); /** * Model tests for ObjectWithDeprecatedFields */ @Test - public void testObjectWithDeprecatedFields() { + void testObjectWithDeprecatedFields() { // TODO: test ObjectWithDeprecatedFields } @@ -45,7 +45,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -61,7 +61,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'deprecatedRef' */ @Test - public void deprecatedRefTest() { + void deprecatedRefTest() { // TODO: test deprecatedRef } @@ -69,7 +69,7 @@ public class ObjectWithDeprecatedFieldsTest { * Test the property 'bars' */ @Test - public void barsTest() { + void barsTest() { // TODO: test bars } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df1..670c2535646 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OrderTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -42,7 +41,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -58,7 +57,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -66,7 +65,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -74,7 +73,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -82,7 +81,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e..870a977da94 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -42,7 +41,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -50,7 +49,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -58,7 +57,7 @@ public class OuterCompositeTest { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0..d818b23c7d5 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumDefaultValue */ -public class OuterEnumDefaultValueTest { +class OuterEnumDefaultValueTest { /** * Model tests for OuterEnumDefaultValue */ @Test - public void testOuterEnumDefaultValue() { + void testOuterEnumDefaultValue() { // TODO: test OuterEnumDefaultValue } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c70935..1d7b3338bca 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumIntegerDefaultValue */ -public class OuterEnumIntegerDefaultValueTest { +class OuterEnumIntegerDefaultValueTest { /** * Model tests for OuterEnumIntegerDefaultValue */ @Test - public void testOuterEnumIntegerDefaultValue() { + void testOuterEnumIntegerDefaultValue() { // TODO: test OuterEnumIntegerDefaultValue } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb1..cacda46a76f 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnumInteger */ -public class OuterEnumIntegerTest { +class OuterEnumIntegerTest { /** * Model tests for OuterEnumInteger */ @Test - public void testOuterEnumInteger() { + void testOuterEnumInteger() { // TODO: test OuterEnumInteger } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..0333ee657a0 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb4..ac7169192a5 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -19,22 +19,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for OuterObjectWithEnumProperty */ -public class OuterObjectWithEnumPropertyTest { +class OuterObjectWithEnumPropertyTest { private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); /** * Model tests for OuterObjectWithEnumProperty */ @Test - public void testOuterObjectWithEnumProperty() { + void testOuterObjectWithEnumProperty() { // TODO: test OuterObjectWithEnumProperty } @@ -42,7 +41,7 @@ public class OuterObjectWithEnumPropertyTest { * Test the property 'value' */ @Test - public void valueTest() { + void valueTest() { // TODO: test value } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java index bdd46008b13..2e4de561806 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java @@ -25,21 +25,21 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.fasterxml.jackson.annotation.JsonIgnore; import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ParentWithNullable */ -public class ParentWithNullableTest { +class ParentWithNullableTest { private final ParentWithNullable model = new ParentWithNullable(); /** * Model tests for ParentWithNullable */ @Test - public void testParentWithNullable() { + void testParentWithNullable() { // TODO: test ParentWithNullable } @@ -47,7 +47,7 @@ public class ParentWithNullableTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -55,7 +55,7 @@ public class ParentWithNullableTest { * Test the property 'nullableProperty' */ @Test - public void nullablePropertyTest() { + void nullablePropertyTest() { // TODO: test nullableProperty } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9a..2e4303f1e4b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,27 +20,27 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +48,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +56,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +64,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +72,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +80,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +88,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec2048..c56da4290fa 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -41,7 +40,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -49,7 +48,7 @@ public class ReadOnlyFirstTest { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b..476e4ca161b 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -13,20 +13,19 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SingleRefType */ -public class SingleRefTypeTest { +class SingleRefTypeTest { /** * Model tests for SingleRefType */ @Test - public void testSingleRefType() { + void testSingleRefType() { // TODO: test SingleRefType } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875a..9501cf722d6 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -41,7 +40,7 @@ public class SpecialModelNameTest { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948..dc9cf9742ef 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TagTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -41,7 +40,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java index 819a1e7fa9d..edb986ca550 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -20,21 +20,21 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ -public class TestInlineFreeformAdditionalPropertiesRequestTest { +class TestInlineFreeformAdditionalPropertiesRequestTest { private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); /** * Model tests for TestInlineFreeformAdditionalPropertiesRequest */ @Test - public void testTestInlineFreeformAdditionalPropertiesRequest() { + void testTestInlineFreeformAdditionalPropertiesRequest() { // TODO: test TestInlineFreeformAdditionalPropertiesRequest } @@ -42,7 +42,7 @@ public class TestInlineFreeformAdditionalPropertiesRequestTest { * Test the property 'someProperty' */ @Test - public void somePropertyTest() { + void somePropertyTest() { // TODO: test someProperty } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b..69d274133b9 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/UserTest.java @@ -18,22 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -41,7 +40,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -49,7 +48,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -57,7 +56,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -65,7 +64,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -73,7 +72,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -81,7 +80,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -89,7 +88,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -97,7 +96,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/javascript-es6/docs/HealthCheckResult.md b/samples/client/petstore/javascript-es6/docs/HealthCheckResult.md new file mode 100644 index 00000000000..bbb74ac6a0a --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/HealthCheckResult.md @@ -0,0 +1,9 @@ +# OpenApiPetstore.HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + + diff --git a/samples/client/petstore/javascript-es6/src/model/HealthCheckResult.js b/samples/client/petstore/javascript-es6/src/model/HealthCheckResult.js new file mode 100644 index 00000000000..112fd778426 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/HealthCheckResult.js @@ -0,0 +1,88 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The HealthCheckResult model module. + * @module model/HealthCheckResult + * @version 1.0.0 + */ +class HealthCheckResult { + /** + * Constructs a new HealthCheckResult. + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @alias module:model/HealthCheckResult + */ + constructor() { + + HealthCheckResult.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a HealthCheckResult from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/HealthCheckResult} obj Optional instance to populate. + * @return {module:model/HealthCheckResult} The populated HealthCheckResult instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new HealthCheckResult(); + + if (data.hasOwnProperty('NullableMessage')) { + obj['NullableMessage'] = ApiClient.convertToType(data['NullableMessage'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to HealthCheckResult. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to HealthCheckResult. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['NullableMessage'] && !(typeof data['NullableMessage'] === 'string' || data['NullableMessage'] instanceof String)) { + throw new Error("Expected the field `NullableMessage` to be a primitive type in the JSON string but got " + data['NullableMessage']); + } + + return true; + } + + +} + + + +/** + * @member {String} NullableMessage + */ +HealthCheckResult.prototype['NullableMessage'] = undefined; + + + + + + +export default HealthCheckResult; + diff --git a/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js b/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js new file mode 100644 index 00000000000..25d9ecd929f --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/HealthCheckResult.spec.js @@ -0,0 +1,65 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.OpenApiPetstore); + } +}(this, function(expect, OpenApiPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new OpenApiPetstore.HealthCheckResult(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('HealthCheckResult', function() { + it('should create an instance of HealthCheckResult', function() { + // uncomment below and update the code to test HealthCheckResult + //var instance = new OpenApiPetstore.HealthCheckResult(); + //expect(instance).to.be.a(OpenApiPetstore.HealthCheckResult); + }); + + it('should have the property nullableMessage (base name: "NullableMessage")', function() { + // uncomment below and update the code to test the property nullableMessage + //var instance = new OpenApiPetstore.HealthCheckResult(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/samples/client/petstore/julia/docs/AnotherModel.md b/samples/client/petstore/julia/docs/AnotherModel.md new file mode 100644 index 00000000000..3fc35e1b360 --- /dev/null +++ b/samples/client/petstore/julia/docs/AnotherModel.md @@ -0,0 +1,13 @@ +# AnotherModel + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**another_property** | **Int64** | | [optional] [default to nothing] +**uuid_default_value** | **String** | | [optional] [default to nothing] + + +[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/julia/src/models/model_AnotherModel.jl b/samples/client/petstore/julia/src/models/model_AnotherModel.jl new file mode 100644 index 00000000000..e5235e2e4be --- /dev/null +++ b/samples/client/petstore/julia/src/models/model_AnotherModel.jl @@ -0,0 +1,41 @@ +# This file was generated by the Julia OpenAPI Code Generator +# Do not modify this file directly. Modify the OpenAPI specification instead. + + +@doc raw"""another_model +to test mapping features + + AnotherModel(; + another_property=nothing, + uuid_default_value=nothing, + ) + + - another_property::Int64 + - uuid_default_value::String +""" +Base.@kwdef mutable struct AnotherModel <: OpenAPI.APIModel + another_property::Union{Nothing, Int64} = nothing + uuid_default_value::Union{Nothing, String} = nothing + + function AnotherModel(another_property, uuid_default_value, ) + OpenAPI.validate_property(AnotherModel, Symbol("another_property"), another_property) + OpenAPI.validate_property(AnotherModel, Symbol("uuid_default_value"), uuid_default_value) + return new(another_property, uuid_default_value, ) + end +end # type AnotherModel + +const _property_types_AnotherModel = Dict{Symbol,String}(Symbol("another_property")=>"Int64", Symbol("uuid_default_value")=>"String", ) +OpenAPI.property_type(::Type{ AnotherModel }, name::Symbol) = Union{Nothing,eval(Base.Meta.parse(_property_types_AnotherModel[name]))} + +function check_required(o::AnotherModel) + true +end + +function OpenAPI.validate_property(::Type{ AnotherModel }, name::Symbol, val) + if name === Symbol("another_property") + OpenAPI.validate_param(name, "AnotherModel", :format, val, "int32") + end + if name === Symbol("uuid_default_value") + OpenAPI.validate_param(name, "AnotherModel", :format, val, "uuid") + end +end diff --git a/samples/client/petstore/kotlin-allOff-discriminator/build.gradle b/samples/client/petstore/kotlin-allOff-discriminator/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/build.gradle +++ b/samples/client/petstore/kotlin-allOff-discriminator/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-allOff-discriminator/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-allOff-discriminator/gradlew b/samples/client/petstore/kotlin-allOff-discriminator/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/gradlew +++ b/samples/client/petstore/kotlin-allOff-discriminator/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat b/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat +++ b/samples/client/petstore/kotlin-allOff-discriminator/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-allOff-discriminator/settings.gradle b/samples/client/petstore/kotlin-allOff-discriminator/settings.gradle index 2210adb73c3..4c574dc6924 100644 --- a/samples/client/petstore/kotlin-allOff-discriminator/settings.gradle +++ b/samples/client/petstore/kotlin-allOff-discriminator/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-allOff-discriminator' diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/build.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/build.gradle +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew.bat b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew.bat +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/settings.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/settings.gradle index dd134a971e8..e2cc9f161bc 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/settings.gradle +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-array-simple-string-jvm-okhttp4' diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle index ccd5d4680c2..8474c5683e5 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/build.gradle @@ -1,7 +1,7 @@ buildscript { - ext.kotlin_version = '1.5.10' + ext.kotlin_version = '1.5.20' ext.swagger_annotations_version = "1.6.2" ext.gson_version = "2.8.6" ext.volley_version = "1.2.0" @@ -19,7 +19,7 @@ buildscript { } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:4.0.2' + classpath 'com.android.tools.build:gradle:7.4.2' } } diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..4b01038305d 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle index b96f0c03c0d..eb08621c1ee 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-array-simple-string-jvm-volley' diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/build.gradle b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/build.gradle +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/settings.gradle b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/settings.gradle index c9a032f9ade..2713d873233 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/settings.gradle +++ b/samples/client/petstore/kotlin-bigdecimal-default-okhttp4/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-bigdecimal-default-okhttp4' diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/build.gradle b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/build.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/settings.gradle b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/settings.gradle index b924bf333a6..707b810f124 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/settings.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-default-values-jvm-okhttp4' diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/build.gradle b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/build.gradle index 0460393fdfc..94c16d7910e 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/build.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/settings.gradle b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/settings.gradle index 910191f984e..3ad98b93708 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/settings.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-default-values-jvm-retrofit2' diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle b/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle index e1597d417fe..ccbdf66f37e 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/build.gradle @@ -1,7 +1,7 @@ buildscript { - ext.kotlin_version = '1.5.10' + ext.kotlin_version = '1.5.20' ext.swagger_annotations_version = "1.6.2" ext.gson_version = "2.8.6" ext.volley_version = "1.2.0" @@ -19,7 +19,7 @@ buildscript { } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:4.0.2' + classpath 'com.android.tools.build:gradle:7.4.2' } } diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..4b01038305d 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle index a1abf3a74e0..5f9a81975fc 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-default-values-jvm-volley' diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-default-values-multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew +++ b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat +++ b/samples/client/petstore/kotlin-default-values-multiplatform/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..3e5ce541214 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,132 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + + +import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.request.forms.formData +import io.ktor.client.engine.HttpClientEngine +import kotlinx.serialization.json.Json +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +open class DefaultApi : ApiClient { + + constructor( + baseUrl: String = ApiClient.BASE_URL, + httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + jsonSerializer: Json = ApiClient.JSON_DEFAULT + ) : super(baseUrl = baseUrl, httpClientEngine = httpClientEngine, httpClientConfig = httpClientConfig, jsonBlock = jsonSerializer) + + constructor( + baseUrl: String, + httpClient: HttpClient + ): super(baseUrl = baseUrl, httpClient = httpClient) + + /** + * Tests default values + * Tests default values of different parameters + * @param pi0 (default to 10) + * @param pi1 + * @param pn0 (default to 10.0) + * @param pn1 + * @param qi0 (optional, default to 10) + * @param qi1 (default to 71) + * @param qi2 (optional) + * @param qi3 + * @param qn0 (optional, default to 10.0) + * @param qn1 (default to 71.0) + * @param qn2 (optional) + * @param qn3 + * @param hi0 (optional, default to 10) + * @param hi1 (default to 71) + * @param hi2 (optional) + * @param hi3 + * @param hn0 (optional, default to 10.0) + * @param hn1 (default to 71.0) + * @param hn2 (optional) + * @param hn3 + * @param fi0 (optional, default to 10) + * @param fi1 (default to 71) + * @param fi2 (optional) + * @param fi3 + * @param fn0 (optional, default to 10.0) + * @param fn1 (default to 71.0) + * @param fn2 (optional) + * @param fn3 + * @param fn4 + * @return void + */ + open suspend fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: kotlin.Double = 10.0.toDouble(), pn1: kotlin.Double, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: kotlin.Double? = 10.0.toDouble(), qn1: kotlin.Double = 71.0.toDouble(), qn2: kotlin.Double? = null, qn3: kotlin.Double, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: kotlin.Double? = 10.0.toDouble(), hn1: kotlin.Double = 71.0.toDouble(), hn2: kotlin.Double? = null, hn3: kotlin.Double, fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: kotlin.Double? = 10.0.toDouble(), fn1: kotlin.Double = 71.0.toDouble(), fn2: kotlin.Double? = null, fn3: kotlin.Double, fn4: kotlin.collections.List): HttpResponse { + + val localVariableAuthNames = listOf() + + val localVariableBody = + formData { + fi0?.apply { append("fi0", fi0) } + fi1?.apply { append("fi1", fi1) } + fi2?.apply { append("fi2", fi2) } + fi3?.apply { append("fi3", fi3) } + fn0?.apply { append("fn0", fn0) } + fn1?.apply { append("fn1", fn1) } + fn2?.apply { append("fn2", fn2) } + fn3?.apply { append("fn3", fn3) } + fn4?.onEach { + append("fn4[]", it) + } + } + + val localVariableQuery = mutableMapOf>() + qi0?.apply { localVariableQuery["qi0"] = listOf("$qi0") } + qi1?.apply { localVariableQuery["qi1"] = listOf("$qi1") } + qi2?.apply { localVariableQuery["qi2"] = listOf("$qi2") } + qi3?.apply { localVariableQuery["qi3"] = listOf("$qi3") } + qn0?.apply { localVariableQuery["qn0"] = listOf("$qn0") } + qn1?.apply { localVariableQuery["qn1"] = listOf("$qn1") } + qn2?.apply { localVariableQuery["qn2"] = listOf("$qn2") } + qn3?.apply { localVariableQuery["qn3"] = listOf("$qn3") } + val localVariableHeaders = mutableMapOf() + hi0?.apply { localVariableHeaders["hi0"] = this.toString() } + hi1?.apply { localVariableHeaders["hi1"] = this.toString() } + hi2?.apply { localVariableHeaders["hi2"] = this.toString() } + hi3?.apply { localVariableHeaders["hi3"] = this.toString() } + hn0?.apply { localVariableHeaders["hn0"] = this.toString() } + hn1?.apply { localVariableHeaders["hn1"] = this.toString() } + hn2?.apply { localVariableHeaders["hn2"] = this.toString() } + hn3?.apply { localVariableHeaders["hn3"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/test".replace("{" + "pi0" + "}", "$pi0").replace("{" + "pi1" + "}", "$pi1").replace("{" + "pn0" + "}", "$pn0").replace("{" + "pn1" + "}", "$pn1"), + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + ) + + return multipartFormRequest( + localVariableConfig, + localVariableBody, + localVariableAuthNames + ).wrap() + } + + +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt new file mode 100644 index 00000000000..8bd8b59a8f8 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.auth + +class ApiKeyAuth(private val location: String, val paramName: String) : Authentication { + var apiKey: String? = null + var apiKeyPrefix: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val key: String = apiKey ?: return + val prefix: String? = apiKeyPrefix + val value: String = if (prefix != null) "$prefix $key" else key + when (location) { + "query" -> query[paramName] = listOf(value) + "header" -> headers[paramName] = value + } + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/Authentication.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/Authentication.kt new file mode 100644 index 00000000000..2c5dfb4acc5 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/Authentication.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.auth + +interface Authentication { + + /** + * Apply authentication settings to header and query params. + * + * @param query Query parameters. + * @param headers Header parameters. + */ + fun apply(query: MutableMap>, headers: MutableMap) + +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt new file mode 100644 index 00000000000..40276dbb985 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.auth + +import io.ktor.util.InternalAPI +import io.ktor.util.encodeBase64 + +class HttpBasicAuth : Authentication { + var username: String? = null + var password: String? = null + + @OptIn(InternalAPI::class) + override fun apply(query: MutableMap>, headers: MutableMap) { + if (username == null && password == null) return + val str = (username ?: "") + ":" + (password ?: "") + val auth = str.encodeBase64() + headers["Authorization"] = "Basic $auth" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt new file mode 100644 index 00000000000..a6fb285af5c --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.auth + +class HttpBearerAuth(private val scheme: String?) : Authentication { + var bearerToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = bearerToken ?: return + headers["Authorization"] = (if (scheme != null) upperCaseBearer(scheme)!! + " " else "") + token + } + + private fun upperCaseBearer(scheme: String): String? { + return if ("bearer".equals(scheme, ignoreCase = true)) "Bearer" else scheme + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/OAuth.kt new file mode 100644 index 00000000000..0e8f30f3938 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/OAuth.kt @@ -0,0 +1,10 @@ +package org.openapitools.client.auth + +class OAuth : Authentication { + var accessToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = accessToken ?: return + headers["Authorization"] = "Bearer $token" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..a4a4491eac0 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..70d03d97b87 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,183 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.plugins.contentnegotiation.ContentNegotiation +import io.ktor.client.request.* +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json +import io.ktor.http.* +import io.ktor.http.content.PartData +import kotlin.Unit +import kotlinx.serialization.json.Json + +import org.openapitools.client.auth.* + +open class ApiClient( + private val baseUrl: String +) { + + private lateinit var client: HttpClient + + constructor( + baseUrl: String, + httpClientEngine: HttpClientEngine?, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + jsonBlock: Json, + ) : this(baseUrl = baseUrl) { + val clientConfig: (HttpClientConfig<*>) -> Unit by lazy { + { + it.install(ContentNegotiation) { json(jsonBlock) } + httpClientConfig?.invoke(it) + } + } + + client = httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + constructor( + baseUrl: String, + httpClient: HttpClient + ): this(baseUrl = baseUrl) { + this.client = httpClient + } + + private val authentications: kotlin.collections.Map? = null + + companion object { + const val BASE_URL = "http://localhost" + val JSON_DEFAULT = Json { + ignoreUnknownKeys = true + prettyPrint = true + isLenient = true + } + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + } + + /** + * Set the username for the first HTTP basic authentication. + * + * @param username Username + */ + fun setUsername(username: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.username = username + } + + /** + * Set the password for the first HTTP basic authentication. + * + * @param password Password + */ + fun setPassword(password: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.password = password + } + + /** + * Set the API key value for the first API key authentication. + * + * @param apiKey API key + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKey(apiKey: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKey = apiKey + } + + /** + * Set the API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKeyPrefix = apiKeyPrefix + } + + /** + * Set the access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + fun setAccessToken(accessToken: String) { + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? + ?: throw Exception("No OAuth2 authentication configured") + auth.accessToken = accessToken + } + + /** + * Set the access token for the first Bearer authentication. + * + * @param bearerToken The bearer token. + */ + fun setBearerToken(bearerToken: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + ?: throw Exception("No Bearer authentication configured") + auth.bearerToken = bearerToken + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: kotlin.collections.List?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf()), authNames) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty), authNames) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse = request(requestConfig, body, authNames) + + protected suspend fun request(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse { + requestConfig.updateForAuth(authNames) + val headers = requestConfig.headers + + return client.request { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { + this.setBody(body) + } + } + } + + private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { + for (authName in authNames) { + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") + auth.apply(query, headers) + } + } + + private fun URLBuilder.appendPath(components: kotlin.collections.List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt new file mode 100644 index 00000000000..5aeea089489 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class Base64ByteArray(val value: ByteArray) { + @Serializer(Base64ByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64()) + override fun deserialize(decoder: Decoder) = Base64ByteArray(decoder.decodeString().decodeBase64Bytes()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as Base64ByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "Base64ByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt new file mode 100644 index 00000000000..af8caa633cc --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt @@ -0,0 +1,100 @@ +package org.openapitools.client.infrastructure + +import io.ktor.utils.io.core.* +import kotlin.experimental.and + +private val digits = "0123456789abcdef".toCharArray() +private const val BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +private const val BASE64_MASK: Byte = 0x3f +private const val BASE64_PAD = '=' +private val BASE64_INVERSE_ALPHABET = IntArray(256) { BASE64_ALPHABET.indexOf(it.toChar()) } + +private fun String.toCharArray(): CharArray = CharArray(length) { get(it) } +private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it] = 0 } +private fun Int.toBase64(): Char = BASE64_ALPHABET[this] +private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK +internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64() +internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes() + +/** + * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(bytes: ByteArray): String { + val result = CharArray(bytes.size * 2) + var resultIndex = 0 + val digits = digits + + for (element in bytes) { + val b = element.toInt() and 0xff + result[resultIndex++] = digits[b shr 4] + result[resultIndex++] = digits[b and 0x0f] + } + + return result.concatToString() +} + +/** + * Decode bytes from HEX string. It should be no spaces and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(s: String): ByteArray { + val result = ByteArray(s.length / 2) + for (idx in result.indices) { + val srcIdx = idx * 2 + val high = s[srcIdx].toString().toInt(16) shl 4 + val low = s[srcIdx + 1].toString().toInt(16) + result[idx] = (high or low).toByte() + } + + return result +} + +/** + * Encode [ByteReadPacket] in base64 format. + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.encodeBase64(): String = buildString { + val data = ByteArray(3) + while (remaining > 0) { + val read = readAvailable(data) + data.clearFrom(read) + + val padSize = (data.size - read) * 8 / 6 + val chunk = ((data[0].toInt() and 0xFF) shl 16) or + ((data[1].toInt() and 0xFF) shl 8) or + (data[2].toInt() and 0xFF) + + for (index in data.size downTo padSize) { + val char = (chunk shr (6 * index)) and BASE64_MASK.toInt() + append(char.toBase64()) + } + + repeat(padSize) { append(BASE64_PAD) } + } +} + +/** + * Decode [ByteReadPacket] from base64 format + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket { + val data = ByteArray(4) + + while (remaining > 0) { + val read = readAvailable(data) + + val chunk = data.foldIndexed(0) { index, result, current -> + result or (current.fromBase64().toInt() shl ((3 - index) * 6)) + } + + for (index in data.size - 2 downTo (data.size - read)) { + val origin = (chunk shr (8 * index)) and 0xff + writeByte(origin.toByte()) + } + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt new file mode 100644 index 00000000000..4285d605ea6 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt @@ -0,0 +1,51 @@ +package org.openapitools.client.infrastructure + +import io.ktor.http.Headers +import io.ktor.http.isSuccess +import io.ktor.util.reflect.TypeInfo +import io.ktor.util.reflect.typeInfo + +open class HttpResponse(val response: io.ktor.client.statement.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.statement.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + response.call.body(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + response.call.body(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.statement.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt new file mode 100644 index 00000000000..d10d7c50652 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class OctetByteArray(val value: ByteArray) { + @Serializer(OctetByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value)) + override fun deserialize(decoder: Decoder) = OctetByteArray(hex(decoder.decodeString())) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as OctetByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "OctetByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 00000000000..be00e38fbae --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..c3518a2d173 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..beb56f07cdd --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt new file mode 100644 index 00000000000..339fa40ec1b --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -0,0 +1,44 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +/** + * + * + * @param i0 + * @param n0 + * @param i1 + * @param n1 + */ +@Serializable + +data class Apa ( + + @SerialName(value = "i0") @Required val i0: kotlin.Int, + + @SerialName(value = "n0") @Required val n0: kotlin.Double, + + @SerialName(value = "i1") val i1: kotlin.Int? = null, + + @SerialName(value = "n1") val n1: kotlin.Double? = null + +) + diff --git a/samples/client/petstore/kotlin-enum-default-value/build.gradle b/samples/client/petstore/kotlin-enum-default-value/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-enum-default-value/build.gradle +++ b/samples/client/petstore/kotlin-enum-default-value/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-enum-default-value/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-enum-default-value/gradlew b/samples/client/petstore/kotlin-enum-default-value/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-enum-default-value/gradlew +++ b/samples/client/petstore/kotlin-enum-default-value/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-enum-default-value/gradlew.bat b/samples/client/petstore/kotlin-enum-default-value/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-enum-default-value/gradlew.bat +++ b/samples/client/petstore/kotlin-enum-default-value/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-enum-default-value/settings.gradle b/samples/client/petstore/kotlin-enum-default-value/settings.gradle index c52ee030424..a0f6905b4bf 100644 --- a/samples/client/petstore/kotlin-enum-default-value/settings.gradle +++ b/samples/client/petstore/kotlin-enum-default-value/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-enum-default-value' diff --git a/samples/client/petstore/kotlin-gson/build.gradle b/samples/client/petstore/kotlin-gson/build.gradle index 7c93f2774a1..ed4098e1373 100644 --- a/samples/client/petstore/kotlin-gson/build.gradle +++ b/samples/client/petstore/kotlin-gson/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-gson/gradlew b/samples/client/petstore/kotlin-gson/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin-gson/gradlew +++ b/samples/client/petstore/kotlin-gson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-gson/gradlew.bat b/samples/client/petstore/kotlin-gson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-gson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-gson/settings.gradle b/samples/client/petstore/kotlin-gson/settings.gradle index 36ee7cb153f..a36725d2cb6 100644 --- a/samples/client/petstore/kotlin-gson/settings.gradle +++ b/samples/client/petstore/kotlin-gson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-gson' diff --git a/samples/client/petstore/kotlin-jackson/build.gradle b/samples/client/petstore/kotlin-jackson/build.gradle index 2ac5000f7bf..13cac8bc447 100644 --- a/samples/client/petstore/kotlin-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jackson/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jackson/gradlew b/samples/client/petstore/kotlin-jackson/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin-jackson/gradlew +++ b/samples/client/petstore/kotlin-jackson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jackson/gradlew.bat b/samples/client/petstore/kotlin-jackson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jackson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jackson/settings.gradle b/samples/client/petstore/kotlin-jackson/settings.gradle index cda75f599e8..ef91c4caa68 100644 --- a/samples/client/petstore/kotlin-jackson/settings.gradle +++ b/samples/client/petstore/kotlin-jackson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jackson' diff --git a/samples/client/petstore/kotlin-json-request-string/build.gradle b/samples/client/petstore/kotlin-json-request-string/build.gradle index 719b51b142b..821fd5bfdc3 100644 --- a/samples/client/petstore/kotlin-json-request-string/build.gradle +++ b/samples/client/petstore/kotlin-json-request-string/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-json-request-string/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-json-request-string/gradlew b/samples/client/petstore/kotlin-json-request-string/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-json-request-string/gradlew +++ b/samples/client/petstore/kotlin-json-request-string/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-json-request-string/gradlew.bat b/samples/client/petstore/kotlin-json-request-string/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-json-request-string/gradlew.bat +++ b/samples/client/petstore/kotlin-json-request-string/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-json-request-string/settings.gradle b/samples/client/petstore/kotlin-json-request-string/settings.gradle index 384b256a817..dedd56bdccd 100644 --- a/samples/client/petstore/kotlin-json-request-string/settings.gradle +++ b/samples/client/petstore/kotlin-json-request-string/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-json-request-string' diff --git a/samples/client/petstore/kotlin-jvm-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-jackson/build.gradle index 79ca18b68f6..ad7aa14b2af 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-jackson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-jackson/gradlew b/samples/client/petstore/kotlin-jvm-jackson/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/gradlew +++ b/samples/client/petstore/kotlin-jvm-jackson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-jackson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-jackson/settings.gradle b/samples/client/petstore/kotlin-jvm-jackson/settings.gradle index bf58268be5f..eb4136f80d1 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-jackson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-jackson' diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle index 4409d7f200e..21819e84790 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.ktor_version = '2.3.9' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/settings.gradle b/samples/client/petstore/kotlin-jvm-ktor-gson/settings.gradle index 94597111ee8..17883546e2e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-ktor-gson' diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle index eed298966bc..02e7419ed59 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.ktor_version = '2.3.9' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/settings.gradle b/samples/client/petstore/kotlin-jvm-ktor-jackson/settings.gradle index 4253fe68194..3160b58d6f9 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-ktor-jackson' diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/build.gradle b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/build.gradle index bc9239e129c..126b859fb7b 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/build.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.ktor_version = '2.3.9' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/settings.gradle b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/settings.gradle index 58699853396..b6e26153f0e 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-ktor-kotlinx_serialization' diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle index c6c3de9957f..05954224125 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle index 7d37a50279f..47dee9b1180 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-okhttp4-coroutines-client' diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle b/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle index 76eb16802b9..06cdabfd2e5 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/build.gradle @@ -2,16 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.spring_boot_version = "2.7.18" - ext.reactor_version = "3.6.4" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } @@ -61,6 +59,6 @@ dependencies { implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" - implementation "io.projectreactor:reactor-core:$reactor_version" + implementation "io.projectreactor:reactor-core:3.6.5" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/settings.gradle b/samples/client/petstore/kotlin-jvm-spring-2-webclient/settings.gradle index f87f6dfa146..81234fc57f2 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-spring-webclient' diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle b/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle index 2e7658f2f33..2fc16aeeb5c 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - ext.spring_boot_version = "3.2.4" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spring_boot_version = "3.2.5" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/settings.gradle b/samples/client/petstore/kotlin-jvm-spring-3-restclient/settings.gradle index df5429b3bbe..ff7d6487a27 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-spring-restclient' diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a1555520b2c..4f5441e98e5 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -77,7 +77,7 @@ class PetApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit { - val result = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) + deletePetWithHttpInfo(petId = petId, apiKey = apiKey) } @Throws(RestClientResponseException::class) @@ -273,7 +273,7 @@ class PetApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit { - val result = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) + updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e16a1593944..777a6f9f5e4 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -39,7 +39,7 @@ class StoreApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deleteOrder(orderId: kotlin.String): Unit { - val result = deleteOrderWithHttpInfo(orderId = orderId) + deleteOrderWithHttpInfo(orderId = orderId) } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index caa0f6729b6..8d7967a0d70 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -39,7 +39,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUser(user: User): Unit { - val result = createUserWithHttpInfo(user = user) + createUserWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -73,7 +73,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUsersWithArrayInput(user: kotlin.collections.List): Unit { - val result = createUsersWithArrayInputWithHttpInfo(user = user) + createUsersWithArrayInputWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -107,7 +107,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun createUsersWithListInput(user: kotlin.collections.List): Unit { - val result = createUsersWithListInputWithHttpInfo(user = user) + createUsersWithListInputWithHttpInfo(user = user) } @Throws(RestClientResponseException::class) @@ -141,7 +141,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun deleteUser(username: kotlin.String): Unit { - val result = deleteUserWithHttpInfo(username = username) + deleteUserWithHttpInfo(username = username) } @Throws(RestClientResponseException::class) @@ -250,7 +250,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun logoutUser(): Unit { - val result = logoutUserWithHttpInfo() + logoutUserWithHttpInfo() } @Throws(RestClientResponseException::class) @@ -283,7 +283,7 @@ class UserApi(client: RestClient) : ApiClient(client) { @Throws(RestClientResponseException::class) fun updateUser(username: kotlin.String, user: User): Unit { - val result = updateUserWithHttpInfo(username = username, user = user) + updateUserWithHttpInfo(username = username, user = user) } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle b/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle index 81441fc10fa..99192219a9d 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/build.gradle @@ -2,16 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - ext.spring_boot_version = "3.2.4" - ext.reactor_version = "3.6.4" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spring_boot_version = "3.2.5" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } @@ -67,6 +65,6 @@ dependencies { implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.0" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.0" implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version" - implementation "io.projectreactor:reactor-core:$reactor_version" + implementation "io.projectreactor:reactor-core:3.6.5" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/settings.gradle b/samples/client/petstore/kotlin-jvm-spring-3-webclient/settings.gradle index f87f6dfa146..81234fc57f2 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-spring-webclient' diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle index 75b60d0fae2..b905eef5d54 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.vertx_version = "4.5.6" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle index d8a62b9a59b..956ff72ba57 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-vertx' diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle index d9310aeaa31..554df629ee2 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.vertx_version = "4.5.6" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle index d8a62b9a59b..956ff72ba57 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-vertx' diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle index 9ade4e61c2d..4fa9b2de93e 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.vertx_version = "4.5.6" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle index d8a62b9a59b..956ff72ba57 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-vertx' diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle b/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle index 1ca32210bdb..86537ceecdf 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.vertx_version = "4.5.6" - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle b/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle index d8a62b9a59b..956ff72ba57 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-vertx' diff --git a/samples/client/petstore/kotlin-jvm-volley/build.gradle b/samples/client/petstore/kotlin-jvm-volley/build.gradle index e1597d417fe..ccbdf66f37e 100644 --- a/samples/client/petstore/kotlin-jvm-volley/build.gradle +++ b/samples/client/petstore/kotlin-jvm-volley/build.gradle @@ -1,7 +1,7 @@ buildscript { - ext.kotlin_version = '1.5.10' + ext.kotlin_version = '1.5.20' ext.swagger_annotations_version = "1.6.2" ext.gson_version = "2.8.6" ext.volley_version = "1.2.0" @@ -19,7 +19,7 @@ buildscript { } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:4.0.2' + classpath 'com.android.tools.build:gradle:7.4.2' } } diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..4b01038305d 100644 --- a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew b/samples/client/petstore/kotlin-jvm-volley/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-volley/gradlew +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-jvm-volley/settings.gradle index a265a220084..32bad6657a2 100644 --- a/samples/client/petstore/kotlin-jvm-volley/settings.gradle +++ b/samples/client/petstore/kotlin-jvm-volley/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-jvm-volley' diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/build.gradle b/samples/client/petstore/kotlin-kotlinx-datetime/build.gradle index 77f977911c1..361efdaa3b9 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/build.gradle +++ b/samples/client/petstore/kotlin-kotlinx-datetime/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew +++ b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat +++ b/samples/client/petstore/kotlin-kotlinx-datetime/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/settings.gradle b/samples/client/petstore/kotlin-kotlinx-datetime/settings.gradle index e5cd54b824d..307a3980c2e 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/settings.gradle +++ b/samples/client/petstore/kotlin-kotlinx-datetime/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-threetenbp' diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/build.gradle b/samples/client/petstore/kotlin-model-prefix-type-mappings/build.gradle index 7f1c4a578d0..52b6635987d 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/build.gradle +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/settings.gradle b/samples/client/petstore/kotlin-model-prefix-type-mappings/settings.gradle index 4b38a2a52a3..e9557672dc8 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/settings.gradle +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-client-prefix-mapping' diff --git a/samples/client/petstore/kotlin-modelMutable/build.gradle b/samples/client/petstore/kotlin-modelMutable/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-modelMutable/build.gradle +++ b/samples/client/petstore/kotlin-modelMutable/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-modelMutable/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-modelMutable/gradlew b/samples/client/petstore/kotlin-modelMutable/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin-modelMutable/gradlew +++ b/samples/client/petstore/kotlin-modelMutable/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-modelMutable/gradlew.bat b/samples/client/petstore/kotlin-modelMutable/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-modelMutable/gradlew.bat +++ b/samples/client/petstore/kotlin-modelMutable/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-modelMutable/settings.gradle b/samples/client/petstore/kotlin-modelMutable/settings.gradle index 0c14ef9e807..b9814e3459a 100644 --- a/samples/client/petstore/kotlin-modelMutable/settings.gradle +++ b/samples/client/petstore/kotlin-modelMutable/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-modelMutable' diff --git a/samples/client/petstore/kotlin-moshi-codegen/build.gradle b/samples/client/petstore/kotlin-moshi-codegen/build.gradle index c051d7f1d90..4a0aa606cdd 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/build.gradle +++ b/samples/client/petstore/kotlin-moshi-codegen/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-moshi-codegen/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-moshi-codegen/gradlew b/samples/client/petstore/kotlin-moshi-codegen/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/gradlew +++ b/samples/client/petstore/kotlin-moshi-codegen/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat b/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat +++ b/samples/client/petstore/kotlin-moshi-codegen/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-moshi-codegen/settings.gradle b/samples/client/petstore/kotlin-moshi-codegen/settings.gradle index 8964919a841..a49864cc295 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/settings.gradle +++ b/samples/client/petstore/kotlin-moshi-codegen/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-moshi-codegen' diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/build.gradle b/samples/client/petstore/kotlin-name-parameter-mappings/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/build.gradle +++ b/samples/client/petstore/kotlin-name-parameter-mappings/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-name-parameter-mappings/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew +++ b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat +++ b/samples/client/petstore/kotlin-name-parameter-mappings/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/settings.gradle b/samples/client/petstore/kotlin-name-parameter-mappings/settings.gradle index dcfbe72dd03..5a53369817d 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/settings.gradle +++ b/samples/client/petstore/kotlin-name-parameter-mappings/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-client' diff --git a/samples/client/petstore/kotlin-nonpublic/build.gradle b/samples/client/petstore/kotlin-nonpublic/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-nonpublic/build.gradle +++ b/samples/client/petstore/kotlin-nonpublic/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-nonpublic/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-nonpublic/gradlew b/samples/client/petstore/kotlin-nonpublic/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-nonpublic/gradlew +++ b/samples/client/petstore/kotlin-nonpublic/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-nonpublic/gradlew.bat b/samples/client/petstore/kotlin-nonpublic/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-nonpublic/gradlew.bat +++ b/samples/client/petstore/kotlin-nonpublic/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-nonpublic/settings.gradle b/samples/client/petstore/kotlin-nonpublic/settings.gradle index 4247dff770f..b12e60cec24 100644 --- a/samples/client/petstore/kotlin-nonpublic/settings.gradle +++ b/samples/client/petstore/kotlin-nonpublic/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-nonpublic' diff --git a/samples/client/petstore/kotlin-nullable/build.gradle b/samples/client/petstore/kotlin-nullable/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-nullable/build.gradle +++ b/samples/client/petstore/kotlin-nullable/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-nullable/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-nullable/gradlew b/samples/client/petstore/kotlin-nullable/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-nullable/gradlew +++ b/samples/client/petstore/kotlin-nullable/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-nullable/gradlew.bat b/samples/client/petstore/kotlin-nullable/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-nullable/gradlew.bat +++ b/samples/client/petstore/kotlin-nullable/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-nullable/settings.gradle b/samples/client/petstore/kotlin-nullable/settings.gradle index 8ce2d0f6b27..229267927ec 100644 --- a/samples/client/petstore/kotlin-nullable/settings.gradle +++ b/samples/client/petstore/kotlin-nullable/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-nullable' diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle b/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle index 79ca18b68f6..ad7aa14b2af 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2-jackson/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-retrofit2-jackson/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew +++ b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-jackson/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/settings.gradle b/samples/client/petstore/kotlin-retrofit2-jackson/settings.gradle index 113e1aafbe5..e2b3193cca3 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/settings.gradle +++ b/samples/client/petstore/kotlin-retrofit2-jackson/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-retrofit2-jackson' diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/build.gradle b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/build.gradle index b820c085984..89fac530a5c 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } @@ -62,7 +61,7 @@ dependencies { implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2" implementation "com.squareup.okhttp3:logging-interceptor:4.12.0" implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" - implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" + implementation "com.squareup.retrofit2:converter-kotlinx-serialization:$retrofitVersion" implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion" testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/settings.gradle b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/settings.gradle index 556f35f68de..c569ae798a5 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/settings.gradle +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-retrofit2-kotlinx_serialization' diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d2a8cf9ce38..4c3ba1e58dd 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -16,7 +16,7 @@ import retrofit2.Converter import retrofit2.CallAdapter import retrofit2.converter.scalars.ScalarsConverterFactory -import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory +import retrofit2.converter.kotlinx.serialization.asConverterFactory import org.openapitools.client.infrastructure.Serializer.kotlinxSerializationJson import okhttp3.MediaType.Companion.toMediaType diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/build.gradle b/samples/client/petstore/kotlin-retrofit2-rx3/build.gradle index efca7577c2d..b5d6c0c4d67 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2-rx3/build.gradle @@ -2,16 +2,15 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' ext.rxJava3Version = '3.1.8' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-retrofit2-rx3/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew +++ b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2-rx3/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/settings.gradle b/samples/client/petstore/kotlin-retrofit2-rx3/settings.gradle index 18baad5eaec..b24c7c5b8e4 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/settings.gradle +++ b/samples/client/petstore/kotlin-retrofit2-rx3/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-retrofit2-rx3' diff --git a/samples/client/petstore/kotlin-retrofit2/build.gradle b/samples/client/petstore/kotlin-retrofit2/build.gradle index 3ad1cc27609..c7f6c8755de 100644 --- a/samples/client/petstore/kotlin-retrofit2/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2/build.gradle @@ -2,15 +2,14 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.23' ext.retrofitVersion = '2.10.0' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-retrofit2/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-retrofit2/gradlew b/samples/client/petstore/kotlin-retrofit2/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2/gradlew +++ b/samples/client/petstore/kotlin-retrofit2/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2/gradlew.bat b/samples/client/petstore/kotlin-retrofit2/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-retrofit2/gradlew.bat +++ b/samples/client/petstore/kotlin-retrofit2/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-retrofit2/settings.gradle b/samples/client/petstore/kotlin-retrofit2/settings.gradle index 756030cbf49..01c60542d30 100644 --- a/samples/client/petstore/kotlin-retrofit2/settings.gradle +++ b/samples/client/petstore/kotlin-retrofit2/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-retrofit2' diff --git a/samples/client/petstore/kotlin-string/build.gradle b/samples/client/petstore/kotlin-string/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin-string/build.gradle +++ b/samples/client/petstore/kotlin-string/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-string/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-string/gradlew b/samples/client/petstore/kotlin-string/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-string/gradlew +++ b/samples/client/petstore/kotlin-string/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-string/gradlew.bat b/samples/client/petstore/kotlin-string/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-string/gradlew.bat +++ b/samples/client/petstore/kotlin-string/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-string/settings.gradle b/samples/client/petstore/kotlin-string/settings.gradle index d7f65164093..9742263a6a2 100644 --- a/samples/client/petstore/kotlin-string/settings.gradle +++ b/samples/client/petstore/kotlin-string/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-string' diff --git a/samples/client/petstore/kotlin-threetenbp/build.gradle b/samples/client/petstore/kotlin-threetenbp/build.gradle index 453be26b7cf..0942ac6f4f9 100644 --- a/samples/client/petstore/kotlin-threetenbp/build.gradle +++ b/samples/client/petstore/kotlin-threetenbp/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-threetenbp/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-threetenbp/gradlew b/samples/client/petstore/kotlin-threetenbp/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-threetenbp/gradlew +++ b/samples/client/petstore/kotlin-threetenbp/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-threetenbp/gradlew.bat b/samples/client/petstore/kotlin-threetenbp/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-threetenbp/gradlew.bat +++ b/samples/client/petstore/kotlin-threetenbp/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-threetenbp/settings.gradle b/samples/client/petstore/kotlin-threetenbp/settings.gradle index e5cd54b824d..307a3980c2e 100644 --- a/samples/client/petstore/kotlin-threetenbp/settings.gradle +++ b/samples/client/petstore/kotlin-threetenbp/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-threetenbp' diff --git a/samples/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle index 3e9802ed336..4f06acff349 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/build.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin-uppercase-enum/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-uppercase-enum/gradlew b/samples/client/petstore/kotlin-uppercase-enum/gradlew index aeb74cbb43e..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/gradlew +++ b/samples/client/petstore/kotlin-uppercase-enum/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat b/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat +++ b/samples/client/petstore/kotlin-uppercase-enum/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-uppercase-enum/settings.gradle b/samples/client/petstore/kotlin-uppercase-enum/settings.gradle index 874f5b0c03e..10ea523a2a1 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/settings.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-uppercase-enum' diff --git a/samples/client/petstore/kotlin/build.gradle b/samples/client/petstore/kotlin/build.gradle index a3aaa60ac43..ae12ac6e144 100644 --- a/samples/client/petstore/kotlin/build.gradle +++ b/samples/client/petstore/kotlin/build.gradle @@ -2,14 +2,13 @@ group 'org.openapitools' version '1.0.0' wrapper { - gradleVersion = '7.5' + gradleVersion = '8.7' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.8.10' - // 6.13.0 is the latest stable release that supports JDK8 - ext.spotless_version = "6.13.0" + ext.kotlin_version = '1.9.23' + ext.spotless_version = "6.25.0" repositories { maven { url "https://repo1.maven.org/maven2" } diff --git a/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar index c1962a79e29..d64cd491770 100644 Binary files a/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties index 8707e8b5067..e7646dead06 100644 --- a/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin/gradlew b/samples/client/petstore/kotlin/gradlew index aeb74cbb43e..9d0ce634cb1 100755 --- a/samples/client/petstore/kotlin/gradlew +++ b/samples/client/petstore/kotlin/gradlew @@ -69,34 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -105,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -116,43 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -165,55 +169,55 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" # Stop when "xargs" is not available. if ! command -v xargs >/dev/null 2>&1 then - die "xargs is not available" +die "xargs is not available" fi # Use "xargs" to parse quoted args. @@ -236,10 +240,10 @@ fi # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin/gradlew.bat b/samples/client/petstore/kotlin/gradlew.bat index 93e3f59f135..9d0ce634cb1 100644 --- a/samples/client/petstore/kotlin/gradlew.bat +++ b/samples/client/petstore/kotlin/gradlew.bat @@ -1,92 +1,249 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem +#!/bin/sh -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% +# Attempt to set APP_HOME -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi +# Resolve links: $0 may be a link +app_path=$0 -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +warn () { +echo "$*" +} >&2 -goto fail +die () { +echo +echo "$*" +echo +exit 1 +} >&2 -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi -:mainEnd -if "%OS%"=="Windows_NT" endlocal +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi -:omega +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin/settings.gradle b/samples/client/petstore/kotlin/settings.gradle index dcfbe72dd03..5a53369817d 100644 --- a/samples/client/petstore/kotlin/settings.gradle +++ b/samples/client/petstore/kotlin/settings.gradle @@ -1,2 +1 @@ - rootProject.name = 'kotlin-petstore-client' diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/FormatTest.md b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/FormatTest.md index 81f6387a2ed..91e1f56e6b1 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/FormatTest.md +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/docs/Model/FormatTest.md @@ -20,5 +20,6 @@ Name | Type | Description | Notes **password** | **string** | | **pattern_with_digits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **pattern_with_digits_and_delimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] +**array_ref** | **string[]** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ObjectSerializer.php index e3e49406733..510540985d3 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/lib/ObjectSerializer.php @@ -30,6 +30,12 @@ namespace OpenAPI\Client; use GuzzleHttp\Psr7\Utils; use OpenAPI\Client\Model\ModelInterface; +use function GuzzleHttp\Psr7\; +use function is_array; +use function is_bool; +use function substr; +use const PHP_QUERY_RFC1738; +use const PHP_QUERY_RFC3986; /** * ObjectSerializer Class Doc Comment @@ -545,22 +551,66 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query + * Build a query string from an array of key value pairs. * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). * - * @return string + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * @param bool $treatBooleansAsInts When `true` values are cast to int (e.g. ['foo' => false] gives `foo=0`). + * When `false` values are cast to strings (e.g. ['foo' => false] gives `foo=false`). */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986, bool $treatBooleansAsInts = true): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = $treatBooleansAsInts + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FormatTest.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FormatTest.php index 0aaf0a89fd9..8d2f860bf37 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FormatTest.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Model/FormatTest.php @@ -73,7 +73,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => 'string', 'password' => 'string', 'pattern_with_digits' => 'string', - 'pattern_with_digits_and_delimiter' => 'string' + 'pattern_with_digits_and_delimiter' => 'string', + 'array_ref' => 'string[]' ]; /** @@ -97,7 +98,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => 'uuid', 'password' => 'password', 'pattern_with_digits' => null, - 'pattern_with_digits_and_delimiter' => null + 'pattern_with_digits_and_delimiter' => null, + 'array_ref' => null ]; /** @@ -121,7 +123,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => false, 'password' => false, 'pattern_with_digits' => false, - 'pattern_with_digits_and_delimiter' => false + 'pattern_with_digits_and_delimiter' => false, + 'array_ref' => false ]; /** @@ -225,7 +228,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => 'uuid', 'password' => 'password', 'pattern_with_digits' => 'pattern_with_digits', - 'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter' + 'pattern_with_digits_and_delimiter' => 'pattern_with_digits_and_delimiter', + 'array_ref' => 'array_ref' ]; /** @@ -249,7 +253,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => 'setUuid', 'password' => 'setPassword', 'pattern_with_digits' => 'setPatternWithDigits', - 'pattern_with_digits_and_delimiter' => 'setPatternWithDigitsAndDelimiter' + 'pattern_with_digits_and_delimiter' => 'setPatternWithDigitsAndDelimiter', + 'array_ref' => 'setArrayRef' ]; /** @@ -273,7 +278,8 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable 'uuid' => 'getUuid', 'password' => 'getPassword', 'pattern_with_digits' => 'getPatternWithDigits', - 'pattern_with_digits_and_delimiter' => 'getPatternWithDigitsAndDelimiter' + 'pattern_with_digits_and_delimiter' => 'getPatternWithDigitsAndDelimiter', + 'array_ref' => 'getArrayRef' ]; /** @@ -348,6 +354,7 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable $this->setIfExists('password', $data ?? [], null); $this->setIfExists('pattern_with_digits', $data ?? [], null); $this->setIfExists('pattern_with_digits_and_delimiter', $data ?? [], null); + $this->setIfExists('array_ref', $data ?? [], null); } /** @@ -957,6 +964,33 @@ class FormatTest implements ModelInterface, ArrayAccess, JsonSerializable return $this; } + + /** + * Gets array_ref + * + * @return string[]|null + */ + public function getArrayRef(): ?array + { + return $this->container['array_ref']; + } + + /** + * Sets array_ref + * + * @param string[]|null $array_ref array_ref + * + * @return $this + */ + public function setArrayRef(?array $array_ref): static + { + if (is_null($array_ref)) { + throw new InvalidArgumentException('non-nullable array_ref cannot be null'); + } + $this->container['array_ref'] = $array_ref; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php index d218cc86bb5..0217e15f425 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/ObjectSerializer.php @@ -538,22 +538,61 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - array|object $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/test/ObjectSerializerTest.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/test/ObjectSerializerTest.php index 84f59c95134..aa1357161ac 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/test/ObjectSerializerTest.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/test/ObjectSerializerTest.php @@ -3,6 +3,7 @@ namespace OpenAPI\Client; use DateTime; +use Generator; use GuzzleHttp\Psr7\Utils; use OpenAPI\Client\Model\Pet; use OpenAPI\Client\Model\Tag; @@ -571,6 +572,37 @@ class ObjectSerializerTest extends TestCase ]; } + /** + * @covers ObjectSerializer::buildQuery + * @dataProvider provideBuildQuery + */ + public function testToBuildQuery( + string $expected, + array $data, + string|null $booleanFormatString = null, + ): void + { + $config = new Configuration(); + if ($booleanFormatString !== null) { + $config->setBooleanFormatForQueryString($booleanFormatString); + } + $config::setDefaultConfiguration($config); + + $query = ObjectSerializer::buildQuery($data); + $this->assertEquals($expected, $query); + } + + /** @return Generator, 2?: Configuration::BOOLEAN_FORMAT_*}> */ + public function provideBuildQuery(): Generator + { + yield 'true as int' => ['foo=1', ['foo' => true]]; + yield 'true as int as default' => ['foo=1', ['foo' => true], Configuration::BOOLEAN_FORMAT_INT]; + yield 'false as int' => ['foo=0', ['foo' => false]]; + yield 'false as int as default' => ['foo=0', ['foo' => false], Configuration::BOOLEAN_FORMAT_INT]; + yield 'true as string' => ['foo=true', ['foo' => true], Configuration::BOOLEAN_FORMAT_STRING]; + yield 'false as string' => ['foo=false', ['foo' => false], Configuration::BOOLEAN_FORMAT_STRING]; + } + /** * Test array to class deserialization. * diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 38dc5a154ca..d47d1caf2fd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -545,22 +545,64 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php index 84f59c95134..aa1357161ac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php @@ -3,6 +3,7 @@ namespace OpenAPI\Client; use DateTime; +use Generator; use GuzzleHttp\Psr7\Utils; use OpenAPI\Client\Model\Pet; use OpenAPI\Client\Model\Tag; @@ -571,6 +572,37 @@ class ObjectSerializerTest extends TestCase ]; } + /** + * @covers ObjectSerializer::buildQuery + * @dataProvider provideBuildQuery + */ + public function testToBuildQuery( + string $expected, + array $data, + string|null $booleanFormatString = null, + ): void + { + $config = new Configuration(); + if ($booleanFormatString !== null) { + $config->setBooleanFormatForQueryString($booleanFormatString); + } + $config::setDefaultConfiguration($config); + + $query = ObjectSerializer::buildQuery($data); + $this->assertEquals($expected, $query); + } + + /** @return Generator, 2?: Configuration::BOOLEAN_FORMAT_*}> */ + public function provideBuildQuery(): Generator + { + yield 'true as int' => ['foo=1', ['foo' => true]]; + yield 'true as int as default' => ['foo=1', ['foo' => true], Configuration::BOOLEAN_FORMAT_INT]; + yield 'false as int' => ['foo=0', ['foo' => false]]; + yield 'false as int as default' => ['foo=0', ['foo' => false], Configuration::BOOLEAN_FORMAT_INT]; + yield 'true as string' => ['foo=true', ['foo' => true], Configuration::BOOLEAN_FORMAT_STRING]; + yield 'false as string' => ['foo=false', ['foo' => false], Configuration::BOOLEAN_FORMAT_STRING]; + } + /** * Test array to class deserialization. * diff --git a/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php index c9e466fa56e..40743664dde 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/AnotherFakeApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -402,7 +401,7 @@ class AnotherFakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -482,7 +481,7 @@ class AnotherFakeApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php b/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php index 3b1c1ab3473..a72273e9169 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/DefaultApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -377,7 +376,7 @@ class DefaultApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -457,7 +456,7 @@ class DefaultApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php index 008ec4e7d6c..1a8cf411409 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -377,7 +376,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -612,7 +611,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -844,7 +843,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1082,7 +1081,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1320,7 +1319,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1558,7 +1557,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1796,7 +1795,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2040,7 +2039,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2319,7 +2318,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2526,7 +2525,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2725,7 +2724,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2924,7 +2923,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3145,7 +3144,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3397,7 +3396,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3792,7 +3791,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4105,7 +4104,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4413,7 +4412,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4624,7 +4623,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4831,7 +4830,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5051,7 +5050,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5365,7 +5364,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5572,7 +5571,7 @@ class FakeApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5652,7 +5651,7 @@ class FakeApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php index 33cfe8876c7..9293ead8c52 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/psr-18/lib/Api/FakeClassnameTags123Api.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -402,7 +401,7 @@ class FakeClassnameTags123Api } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -487,7 +486,7 @@ class FakeClassnameTags123Api ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/PetApi.php b/samples/client/petstore/php/psr-18/lib/Api/PetApi.php index ca5f4be3db9..d16fd05ae71 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/PetApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/PetApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -382,7 +381,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -608,7 +607,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -865,7 +864,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1123,7 +1122,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1381,7 +1380,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1618,7 +1617,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1853,7 +1852,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2137,7 +2136,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2427,7 +2426,7 @@ class PetApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2511,7 +2510,7 @@ class PetApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php b/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php index ecdb72a188e..50652be86c8 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/StoreApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -359,7 +358,7 @@ class StoreApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -594,7 +593,7 @@ class StoreApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -860,7 +859,7 @@ class StoreApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1112,7 +1111,7 @@ class StoreApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1192,7 +1191,7 @@ class StoreApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/Api/UserApi.php b/samples/client/petstore/php/psr-18/lib/Api/UserApi.php index d6f78b087b6..0001ad825ff 100644 --- a/samples/client/petstore/php/psr-18/lib/Api/UserApi.php +++ b/samples/client/petstore/php/psr-18/lib/Api/UserApi.php @@ -28,7 +28,6 @@ namespace OpenAPI\Client\Api; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Query; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\Plugin\RedirectPlugin; use Http\Client\Common\PluginClient; @@ -357,7 +356,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -564,7 +563,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -771,7 +770,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -980,7 +979,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1234,7 +1233,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1513,7 +1512,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1703,7 +1702,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1929,7 +1928,7 @@ class UserApi } else { // for HTTP post (form) - $httpBody = Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2009,7 +2008,7 @@ class UserApi ->withHost($host) ->withScheme($scheme) ->withPort($port) - ->withQuery(Query::build($queryParams)); + ->withQuery(ObjectSerializer::buildQuery($queryParams)); if ($user) { $uri = $uri->withUserInfo($user, $password); diff --git a/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php b/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php index 38dc5a154ca..d47d1caf2fd 100644 --- a/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/psr-18/lib/ObjectSerializer.php @@ -545,22 +545,64 @@ class ObjectSerializer } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } } diff --git a/samples/client/petstore/ruby-autoload/Gemfile.lock b/samples/client/petstore/ruby-autoload/Gemfile.lock new file mode 100644 index 00000000000..8e2a9aaea67 --- /dev/null +++ b/samples/client/petstore/ruby-autoload/Gemfile.lock @@ -0,0 +1,73 @@ +PATH + remote: . + specs: + petstore (1.0.0) + typhoeus (~> 1.0, >= 1.0.1) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + byebug (11.1.3) + coderay (1.1.3) + diff-lcs (1.5.1) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.16.3) + jaro_winkler (1.5.6) + method_source (1.1.0) + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + psych (5.1.2) + stringio + racc (1.7.3) + rainbow (3.1.1) + rake (13.0.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (0.66.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.6) + ruby-progressbar (1.13.0) + stringio (3.1.0) + typhoeus (1.4.1) + ethon (>= 0.9.0) + unicode-display_width (1.5.0) + +PLATFORMS + arm64-darwin-23 + ruby + +DEPENDENCIES + petstore! + pry-byebug + rake (~> 13.0.1) + rspec (~> 3.6, >= 3.6.0) + rubocop (~> 0.66.0) + +BUNDLED WITH + 2.5.9 diff --git a/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb b/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb index edc5d301337..7b2140e37ba 100644 --- a/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-autoload/lib/petstore/api_client.rb @@ -212,7 +212,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -291,7 +291,7 @@ module Petstore # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/petstore/ruby-faraday/Gemfile.lock b/samples/client/petstore/ruby-faraday/Gemfile.lock new file mode 100644 index 00000000000..87c9dc2135a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/Gemfile.lock @@ -0,0 +1,81 @@ +PATH + remote: . + specs: + petstore (1.0.0) + faraday (>= 1.0.1, < 3.0) + faraday-multipart + marcel + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + byebug (11.1.3) + coderay (1.1.3) + diff-lcs (1.5.1) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (3.1.0) + net-http + jaro_winkler (1.5.6) + marcel (1.0.4) + method_source (1.1.0) + multipart-post (2.4.0) + net-http (0.4.1) + uri + parallel (1.24.0) + parser (3.3.0.5) + ast (~> 2.4.1) + racc + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + psych (5.1.2) + stringio + racc (1.7.3) + rainbow (3.1.1) + rake (13.0.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (0.66.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.6) + ruby-progressbar (1.13.0) + stringio (3.1.0) + unicode-display_width (1.5.0) + uri (0.13.0) + +PLATFORMS + arm64-darwin-23 + ruby + +DEPENDENCIES + petstore! + pry-byebug + rake (~> 13.0.1) + rspec (~> 3.6, >= 3.6.0) + rubocop (~> 0.66.0) + +BUNDLED WITH + 2.5.9 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index d0fe4c9faa5..517f5f5604f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -249,7 +249,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -328,7 +328,7 @@ module Petstore # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/petstore/ruby-httpx/Gemfile.lock b/samples/client/petstore/ruby-httpx/Gemfile.lock index 3093f407a24..147d4d99ef1 100644 --- a/samples/client/petstore/ruby-httpx/Gemfile.lock +++ b/samples/client/petstore/ruby-httpx/Gemfile.lock @@ -7,40 +7,43 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.1) + ast (2.4.2) byebug (11.1.3) coderay (1.1.3) - diff-lcs (1.4.4) - http-2-next (1.0.0) - httpx (1.0.1) - http-2-next (>= 1.0.0) - jaro_winkler (1.5.4) - method_source (1.0.0) - parallel (1.19.2) - parser (2.7.1.5) + diff-lcs (1.5.1) + http-2-next (1.0.3) + httpx (1.2.4) + http-2-next (>= 1.0.3) + jaro_winkler (1.5.6) + method_source (1.1.0) + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) - pry (0.13.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.9.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.13.0) - psych (3.2.0) - rainbow (3.0.0) - rake (13.0.1) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) + pry (>= 0.13, < 0.15) + psych (5.1.2) + stringio + racc (1.7.3) + rainbow (3.1.1) + rake (13.0.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.3) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) rubocop (0.66.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) @@ -49,10 +52,12 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.6) - ruby-progressbar (1.10.1) + ruby-progressbar (1.13.0) + stringio (3.1.0) unicode-display_width (1.5.0) PLATFORMS + arm64-darwin-23 ruby DEPENDENCIES @@ -63,4 +68,4 @@ DEPENDENCIES rubocop (~> 0.66.0) BUNDLED WITH - 1.17.2 + 2.5.9 diff --git a/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb b/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb index 28b8f66ba7f..32532a8ef2a 100644 --- a/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-httpx/lib/petstore/api_client.rb @@ -188,7 +188,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -267,7 +267,7 @@ module Petstore # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/petstore/ruby/Gemfile.lock b/samples/client/petstore/ruby/Gemfile.lock index f6aa4f5abfe..8e2a9aaea67 100644 --- a/samples/client/petstore/ruby/Gemfile.lock +++ b/samples/client/petstore/ruby/Gemfile.lock @@ -7,40 +7,43 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.1) + ast (2.4.2) byebug (11.1.3) coderay (1.1.3) - diff-lcs (1.4.4) - ethon (0.12.0) - ffi (>= 1.3.0) - ffi (1.13.1) - jaro_winkler (1.5.4) - method_source (1.0.0) - parallel (1.19.2) - parser (2.7.1.5) + diff-lcs (1.5.1) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.16.3) + jaro_winkler (1.5.6) + method_source (1.1.0) + parallel (1.24.0) + parser (3.3.0.5) ast (~> 2.4.1) - pry (0.13.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.9.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.13.0) - psych (3.2.0) - rainbow (3.0.0) - rake (13.0.1) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) + pry (>= 0.13, < 0.15) + psych (5.1.2) + stringio + racc (1.7.3) + rainbow (3.1.1) + rake (13.0.6) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.3) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) rubocop (0.66.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) @@ -49,12 +52,14 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.6) - ruby-progressbar (1.10.1) - typhoeus (1.4.0) + ruby-progressbar (1.13.0) + stringio (3.1.0) + typhoeus (1.4.1) ethon (>= 0.9.0) unicode-display_width (1.5.0) PLATFORMS + arm64-darwin-23 ruby DEPENDENCIES @@ -65,4 +70,4 @@ DEPENDENCIES rubocop (~> 0.66.0) BUNDLED WITH - 1.17.2 + 2.5.9 diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index edc5d301337..7b2140e37ba 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -212,7 +212,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -291,7 +291,7 @@ module Petstore # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/client/petstore/rust/Cargo.toml b/samples/client/petstore/rust/Cargo.toml index 46b06cf9bbe..90aec2be42a 100644 --- a/samples/client/petstore/rust/Cargo.toml +++ b/samples/client/petstore/rust/Cargo.toml @@ -1,2 +1,3 @@ [workspace] members = ["hyper/*", "reqwest/*"] +resolver = "2" diff --git a/samples/client/petstore/rust/hyper/petstore/Cargo.toml b/samples/client/petstore/rust/hyper/petstore/Cargo.toml index 7edd302b89e..d8b82608d37 100644 --- a/samples/client/petstore/rust/hyper/petstore/Cargo.toml +++ b/samples/client/petstore/rust/hyper/petstore/Cargo.toml @@ -4,15 +4,14 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" diff --git a/samples/client/petstore/rust/hyper/petstore/docs/TypeTesting.md b/samples/client/petstore/rust/hyper/petstore/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/hyper/petstore/docs/TypeTesting.md +++ b/samples/client/petstore/rust/hyper/petstore/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs index 2abfb5a4e60..df848ad3c6b 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/apis/mod.rs @@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error { impl From for Error { fn from(e: http::Error) -> Self { - return Error::Http(e) + Error::Http(e) } } impl From for Error { fn from(e: hyper::Error) -> Self { - return Error::Hyper(e) + Error::Hyper(e) } } impl From for Error { fn from(e: serde_json::Error) -> Self { - return Error::Serde(e) + Error::Serde(e) } } diff --git a/samples/client/petstore/rust/hyper/petstore/src/lib.rs b/samples/client/petstore/rust/hyper/petstore/src/lib.rs index b49043ca040..1de74d07cff 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/lib.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs index 81cca99e8ac..11d2f0b8712 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/model_ref.rs b/samples/client/petstore/rust/hyper/petstore/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/model_ref.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs index 5d16df143aa..e81f64a2980 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs index 59d9a9f1158..785fb5390be 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/hyper/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/hyper/petstore/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml b/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml index d7c5df28fbf..120ba16c882 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/name-mapping/Cargo.toml @@ -4,14 +4,11 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "rust name mapping test" license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" +serde = { version = "^1.0", features = ["derive"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs index e40fc8b66c4..e7f8c27a8f0 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs index e420ed1280c..caf948339e0 100644 --- a/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs +++ b/samples/client/petstore/rust/reqwest/name-mapping/src/models/property_name_mapping.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PropertyNameMapping { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml index 1c262d99332..cd7d83abaa6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/Cargo.toml @@ -4,16 +4,13 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -reqwest-middleware = "0.2.0" -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } +reqwest-middleware = { version = "^0.3", features = ["json", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TypeTesting.md +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs index 78d3ba30ec0..3f10b5b6c2a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs index ccdefa44be1..0a44b19a32d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/pet_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs index d08b7b74e46..67fd03a80f5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/store_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs index 86f87242fcc..83d1a00fb4c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/testing_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs index 32594255a63..4f28c21c1cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/apis/user_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs index 81cca99e8ac..11d2f0b8712 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_ref.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_ref.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs index 5d16df143aa..e81f64a2980 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs index 59d9a9f1158..785fb5390be 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-middleware/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml index a9086df17e0..8fa64e90a2f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-async/Cargo.toml @@ -4,15 +4,12 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/petstore-async/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/docs/TypeTesting.md +++ b/samples/client/petstore/rust/reqwest/petstore-async/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs index 78d3ba30ec0..3f10b5b6c2a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index ccdefa44be1..0a44b19a32d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs index d08b7b74e46..67fd03a80f5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/store_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs index 86f87242fcc..83d1a00fb4c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/testing_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs index 32594255a63..4f28c21c1cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/user_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs index 81cca99e8ac..11d2f0b8712 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_ref.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_ref.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs index 5d16df143aa..e81f64a2980 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs index 59d9a9f1158..785fb5390be 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml index 43415aac8e5..99fe8589bc8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/Cargo.toml @@ -4,15 +4,12 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TypeTesting.md +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs index 78d3ba30ec0..3f10b5b6c2a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs index ccdefa44be1..0a44b19a32d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/pet_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs index d08b7b74e46..67fd03a80f5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/store_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs index 86f87242fcc..83d1a00fb4c 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/testing_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs index 32594255a63..4f28c21c1cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/apis/user_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/action_container.rs index 870b2e3c68b..0dd27c0e5c8 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_ref.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_ref.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/order.rs index 5d16df143aa..e81f64a2980 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/pet.rs index 1cbe779e1ea..9d5606d017f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-avoid-box/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml index a390b57fa5b..31b50f4eed1 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/Cargo.toml @@ -4,18 +4,15 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } aws-sigv4 = "0.3.0" http = "0.2.5" secrecy = "0.8.0" -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TypeTesting.md +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/configuration.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/configuration.rs index e8b030ae01b..f401dc38637 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/configuration.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/configuration.rs @@ -68,7 +68,7 @@ impl AWSv4Key { value.to_str().expect("header value should be a string").to_string())); } } - return Ok(additional_headers); + Ok(additional_headers) } } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs index af7818dd030..d14a0f233be 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs index ff120978fc7..c48cfb3b2f9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/pet_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; @@ -140,7 +140,7 @@ pub fn delete_pet(configuration: &configuration::Configuration, pet_id: i64, api let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "DELETE", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -191,7 +191,7 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "GET", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -239,7 +239,7 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "GET", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -283,7 +283,7 @@ pub fn get_pet_by_id(configuration: &configuration::Configuration, pet_id: i64) let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "GET", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -377,7 +377,7 @@ pub fn update_pet_with_form(configuration: &configuration::Configuration, pet_id let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "POST", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -429,7 +429,7 @@ pub fn upload_file(configuration: &configuration::Configuration, pet_id: i64, ad let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "POST", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs index 3f42d04d3ec..fd42617f4c7 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/store_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; @@ -90,7 +90,7 @@ pub fn get_inventory(configuration: &configuration::Configuration, ) -> Result new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs index f6bca74913e..c53219078f0 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/testing_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs index b1f475f2a04..0eedaddc2e4 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/apis/user_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; @@ -246,7 +246,7 @@ pub fn delete_user(configuration: &configuration::Configuration, username: &str) let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "DELETE", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), @@ -353,7 +353,7 @@ pub fn logout_user(configuration: &configuration::Configuration, ) -> Result<(), let local_var_new_headers = match local_var_aws_v4_key.sign( &local_var_uri_str, "GET", - &"", + "", ) { Ok(new_headers) => new_headers, Err(err) => return Err(Error::AWSV4SignatureError(err)), diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs index 81cca99e8ac..11d2f0b8712 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_ref.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_ref.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs index 5d16df143aa..e81f64a2980 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs index 59d9a9f1158..785fb5390be 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore-awsv4signature/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml index ac96d24a7db..5e0e14f5120 100644 --- a/samples/client/petstore/rust/reqwest/petstore/Cargo.toml +++ b/samples/client/petstore/rust/reqwest/petstore/Cargo.toml @@ -4,15 +4,12 @@ version = "1.0.0" authors = ["OpenAPI Generator team and contributors"] description = "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters." license = "Apache-2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "blocking", "multipart"] +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] } diff --git a/samples/client/petstore/rust/reqwest/petstore/docs/TypeTesting.md b/samples/client/petstore/rust/reqwest/petstore/docs/TypeTesting.md index 6beca6dbac1..4f650eb1aa2 100644 --- a/samples/client/petstore/rust/reqwest/petstore/docs/TypeTesting.md +++ b/samples/client/petstore/rust/reqwest/petstore/docs/TypeTesting.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **string** | **String** | | **boolean** | **bool** | | **uuid** | [**uuid::Uuid**](uuid::Uuid.md) | | +**bytes** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs index af7818dd030..d14a0f233be 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/fake_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index 70dec4dca24..ebff8f8dde9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs index a29eba98354..98c889e0e55 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/store_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs index f6bca74913e..c53219078f0 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/testing_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs index ec400432aae..2f328ace605 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/user_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs index 1ac114198fd..a1837b966dc 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/lib.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_imports)] - -#[macro_use] -extern crate serde_derive; +#![allow(clippy::too_many_arguments)] extern crate serde; extern crate serde_json; diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs index 81cca99e8ac..11d2f0b8712 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/action_container.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionContainer { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs index 4814a31da53..0a60da0f477 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/api_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ApiResponse : Describes the result of uploading an image resource #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs index 5948b180912..4ac1e8a2fe9 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/array_item_ref_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// ArrayItemRefTest : Test handling of object reference in arrays #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs index d2a840a2d67..17b42c0bd4f 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/baz.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Baz : Test handling of empty variants /// Test handling of empty variants @@ -23,12 +24,12 @@ pub enum Baz { } -impl ToString for Baz { - fn to_string(&self) -> String { +impl std::fmt::Display for Baz { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::A => String::from("A"), - Self::B => String::from("B"), - Self::Empty => String::from(""), + Self::A => write!(f, "A"), + Self::B => write!(f, "B"), + Self::Empty => write!(f, ""), } } } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs index 2d2b29334de..9ecf89d354d 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/category.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Category : A category for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs index 499c3359513..2ac40c30775 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/enum_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// EnumArrayTesting : Test of enum array #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/model_ref.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/model_ref.rs index cd0928bf9c2..9862cb1a48e 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/model_ref.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Ref : using reserved word as model name #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs index 933b644a7f3..07d9268e6e6 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/model_return.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Return : Test using keywords #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs index 6ddbb5c0ece..a155ea1176a 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/nullable_array.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct NullableArray { diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs index 57d224f831d..72e5a009a62 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/optional_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// OptionalTesting : Test handling of optional and nullable fields #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs index d27d4f8893e..a66e7dbb568 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/order.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Order : An order for a pets from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs index 59d9a9f1158..785fb5390be 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/pet.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Pet : A pet for sale in the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs index 1b92525f28b..c98e7c762b5 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/property_test.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// PropertyTest : A model to test various formats, e.g. UUID #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs index 151840c8856..8fe4eebd723 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/tag.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// Tag : A tag for a pet #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs index 2a821fb24d5..dba87bdb3cf 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/type_testing.rs @@ -9,8 +9,12 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; + +use serde_with::serde_as; /// TypeTesting : Test handling of different field data types +#[serde_as] #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TypeTesting { #[serde(rename = "int32")] @@ -27,11 +31,14 @@ pub struct TypeTesting { pub boolean: bool, #[serde(rename = "uuid")] pub uuid: uuid::Uuid, + #[serde_as(as = "serde_with::base64::Base64")] + #[serde(rename = "bytes")] + pub bytes: Vec, } impl TypeTesting { /// Test handling of different field data types - pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid) -> TypeTesting { + pub fn new(int32: i32, int64: i64, float: f32, double: f64, string: String, boolean: bool, uuid: uuid::Uuid, bytes: Vec) -> TypeTesting { TypeTesting { int32, int64, @@ -40,6 +47,7 @@ impl TypeTesting { string, boolean, uuid, + bytes, } } } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs index a40f77afc0e..2a1f18ca9ce 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/unique_item_array_testing.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// UniqueItemArrayTesting : Test handling of enum array with unique items #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs index f16b7f785f7..c88c469a4eb 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// User : A User who is purchasing from the pet store #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/FakeApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/FakeApi.scala index a7006555fe4..84ce29a85bc 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/FakeApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/FakeApi.scala @@ -16,8 +16,7 @@ import sttp.client3._ import sttp.model.Method object FakeApi { - -def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new FakeApi(baseUrl) + def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new FakeApi(baseUrl) } class FakeApi(baseUrl: String) { @@ -38,6 +37,6 @@ class FakeApi(baseUrl: String) { .contentType("application/json") .header("_type", underscoreType.toString) .header("type_", typeWithUnderscore.toString) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) } diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala index e4897aa2416..a412877580d 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -19,8 +19,7 @@ import sttp.client3._ import sttp.model.Method object PetApi { - -def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new PetApi(baseUrl) + def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new PetApi(baseUrl) } class PetApi(baseUrl: String) { @@ -57,7 +56,7 @@ class PetApi(baseUrl: String) { .method(Method.DELETE, uri"$baseUrl/pet/${petId}") .contentType("application/json") .header("api_key", apiKey.toString) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * Multiple status values can be provided with comma separated strings @@ -150,7 +149,7 @@ class PetApi(baseUrl: String) { "name" -> name, "status" -> status )) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala index 10699532398..1cecc3117fe 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -17,8 +17,7 @@ import sttp.client3._ import sttp.model.Method object StoreApi { - -def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new StoreApi(baseUrl) + def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new StoreApi(baseUrl) } class StoreApi(baseUrl: String) { @@ -37,7 +36,7 @@ class StoreApi(baseUrl: String) { basicRequest .method(Method.DELETE, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * Returns a map of status codes to quantities diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 6f035512fc2..d8eb054688c 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -18,8 +18,7 @@ import sttp.client3._ import sttp.model.Method object UserApi { - -def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new UserApi(baseUrl) + def apply(baseUrl: String = "http://petstore.swagger.io/v2") = new UserApi(baseUrl) } class UserApi(baseUrl: String) { @@ -36,13 +35,13 @@ class UserApi(baseUrl: String) { * @param user Created user object */ def createUser(apiKey: String)(user: User -): Request[Either[Either[String, String], Unit], Any] = +): Request[Either[ResponseException[String, Exception], Unit], Any] = basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -56,13 +55,13 @@ class UserApi(baseUrl: String) { * @param user List of user object */ def createUsersWithArrayInput(apiKey: String)(user: Seq[User] -): Request[Either[Either[String, String], Unit], Any] = +): Request[Either[ResponseException[String, Exception], Unit], Any] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -76,13 +75,13 @@ class UserApi(baseUrl: String) { * @param user List of user object */ def createUsersWithListInput(apiKey: String)(user: Seq[User] -): Request[Either[Either[String, String], Unit], Any] = +): Request[Either[ResponseException[String, Exception], Unit], Any] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * This can only be done by the logged in user. @@ -102,7 +101,7 @@ class UserApi(baseUrl: String) { .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") .header("api_key", apiKey) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -152,12 +151,12 @@ class UserApi(baseUrl: String) { * api_key (apiKey) */ def logoutUser(apiKey: String)( -): Request[Either[Either[String, String], Unit], Any] = +): Request[Either[ResponseException[String, Exception], Unit], Any] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") .header("api_key", apiKey) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * This can only be done by the logged in user. @@ -179,6 +178,6 @@ class UserApi(baseUrl: String) { .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) } diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala index 7c483930db1..3aefc3d3215 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/PetApi.scala @@ -54,7 +54,7 @@ class PetApi(baseUrl: String) { .method(Method.DELETE, uri"$baseUrl/pet/${petId}") .contentType("application/json") .header("api_key", apiKey.toString) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * Multiple status values can be provided with comma separated strings @@ -142,7 +142,7 @@ class PetApi(baseUrl: String) { "name" -> name, "status" -> status )) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala index d4d14232b39..0cee41f9145 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/StoreApi.scala @@ -35,7 +35,7 @@ class StoreApi(baseUrl: String) { basicRequest .method(Method.DELETE, uri"$baseUrl/store/order/${orderId}") .contentType("application/json") - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * Returns a map of status codes to quantities diff --git a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala index c86bc67d21c..47f5ad106b3 100644 --- a/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp4/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -34,13 +34,13 @@ class UserApi(baseUrl: String) { * * @param user Created user object */ - def createUser(apiKey: String)(user: User): Request[Either[Either[String, String], Unit]] = + def createUser(apiKey: String)(user: User): Request[Either[ResponseException[String, Exception], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -53,13 +53,13 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithArrayInput(apiKey: String)(user: Seq[User]): Request[Either[Either[String, String], Unit]] = + def createUsersWithArrayInput(apiKey: String)(user: Seq[User]): Request[Either[ResponseException[String, Exception], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -72,13 +72,13 @@ class UserApi(baseUrl: String) { * * @param user List of user object */ - def createUsersWithListInput(apiKey: String)(user: Seq[User]): Request[Either[Either[String, String], Unit]] = + def createUsersWithListInput(apiKey: String)(user: Seq[User]): Request[Either[ResponseException[String, Exception], Unit]] = basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * This can only be done by the logged in user. @@ -97,7 +97,7 @@ class UserApi(baseUrl: String) { .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") .header("api_key", apiKey) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * @@ -144,12 +144,12 @@ class UserApi(baseUrl: String) { * Available security schemes: * api_key (apiKey) */ - def logoutUser(apiKey: String)(): Request[Either[Either[String, String], Unit]] = + def logoutUser(apiKey: String)(): Request[Either[ResponseException[String, Exception], Unit]] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") .header("api_key", apiKey) - .response(asEither(asString, ignore)) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) /** * This can only be done by the logged in user. @@ -170,6 +170,6 @@ class UserApi(baseUrl: String) { .contentType("application/json") .header("api_key", apiKey) .body(user) - .response(asJson[Unit]) + .response(asString.mapWithMetadata(ResponseAs.deserializeRightWithError(_ => Right(())))) } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index 9ac2b5b0d5d..36ccc937fe5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -39,7 +39,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java index b7eaefd7609..6b281ab9992 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AnimalDto.java @@ -38,6 +38,10 @@ public class AnimalDto { private String color = "red"; + public AnimalDto() { + super(); + } + public AnimalDto className(String className) { this.className = className; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java index d3405afedfb..a177673856d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/BigCatDto.java @@ -68,6 +68,10 @@ public class BigCatDto extends CatDto { private KindEnum kind; + public BigCatDto() { + super(); + } + public BigCatDto kind(KindEnum kind) { this.kind = kind; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java index f6cf541eb8f..384aa7450d5 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CatDto.java @@ -35,6 +35,10 @@ public class CatDto extends AnimalDto { private Boolean declawed; + public CatDto() { + super(); + } + public CatDto declawed(Boolean declawed) { this.declawed = declawed; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java index e789d7b8f1e..a617ced8cf9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/CategoryDto.java @@ -25,6 +25,10 @@ public class CategoryDto { private String name = "default-name"; + public CategoryDto() { + super(); + } + public CategoryDto id(Long id) { this.id = id; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 4c241d5994a..59fab041ed6 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -38,6 +38,10 @@ public class ContainerDefaultValueDto { private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); + public ContainerDefaultValueDto() { + super(); + } + public ContainerDefaultValueDto nullableArray(List nullableArray) { this.nullableArray = JsonNullable.of(nullableArray); return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java index c4f33abaa08..88a62768f4c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java @@ -28,6 +28,10 @@ public class DogDto extends AnimalDto { private String breed; + public DogDto() { + super(); + } + public DogDto breed(String breed) { this.breed = breed; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java index aab23c2dbcf..c048ba67384 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java @@ -177,6 +177,10 @@ public class EnumTestDto { private OuterEnumDto outerEnum; + public EnumTestDto() { + super(); + } + public EnumTestDto enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java index 4b90a16d335..7cef7c76cd0 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java @@ -57,6 +57,10 @@ public class FormatTestDto { private BigDecimal bigDecimal; + public FormatTestDto() { + super(); + } + public FormatTestDto integer(Integer integer) { this.integer = integer; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java index 06aa9912374..5771894fdad 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java @@ -29,6 +29,10 @@ public class NameDto { private Integer _123number; + public NameDto() { + super(); + } + public NameDto name(Integer name) { this.name = name; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java index e36928aca29..b255f28b18e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -40,7 +40,7 @@ public class ParentWithNullableDto { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 0b1c7999a97..0706d7a2748 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -82,6 +82,10 @@ public class PetDto { @Deprecated private StatusEnum status; + public PetDto() { + super(); + } + public PetDto id(Long id) { this.id = id; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 5ce14f41875..ffea7b9edae 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -36,6 +36,10 @@ public class TypeHolderDefaultDto { private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + public TypeHolderDefaultDto() { + super(); + } + public TypeHolderDefaultDto stringItem(String stringItem) { this.stringItem = stringItem; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index d3ede2a7b56..8426a0a632f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -38,6 +38,10 @@ public class TypeHolderExampleDto { private List arrayItem = new ArrayList<>(); + public TypeHolderExampleDto() { + super(); + } + public TypeHolderExampleDto stringItem(String stringItem) { this.stringItem = stringItem; return this; diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 3ed8fe080f3..0d0e06ee91b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -96,7 +96,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = nil diff --git a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/anycodableLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index a32cdd64a8b..c2151380976 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask: @unchecked Sendable { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 8411465a495..e719b886753 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ internal class Response { internal final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ce6e6927f0b..ede5a95feba 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -internal protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +internal protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +internal protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + internal func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 7094040c9f3..3d9e25e3638 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -112,9 +112,9 @@ open class Response { public final class RequestTask { private var lock = NSRecursiveLock() - private var task: URLSessionTask? + private var task: URLSessionDataTaskProtocol? - internal func set(task: URLSessionTask) { + internal func set(task: URLSessionDataTaskProtocol) { lock.lock() defer { lock.unlock() } self.task = task diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ec201fa0995..e7bbc538c18 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -12,11 +12,33 @@ import MobileCoreServices import UniformTypeIdentifiers #endif -public protocol URLSessionProtocol { - func dataTask(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask +// Protocol defined for a session data task. This allows mocking out the URLSessionProtocol below since +// you may not want to create or return a real URLSessionDataTask. +public protocol URLSessionDataTaskProtocol { + func resume() + + var taskIdentifier: Int { get } + + var progress: Progress { get } + + func cancel() } -extension URLSession: URLSessionProtocol {} +// Protocol allowing implementations to alter what is returned or to test their implementations. +public protocol URLSessionProtocol { + // Task which performs the network fetch. Expected to be from URLSession.dataTask(with:completionHandler:) such that a network request + // is sent off when `.resume()` is called. + func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTaskProtocol +} + +extension URLSession: URLSessionProtocol { + // Passthrough to URLSession.dataTask(with:completionHandler) since URLSessionDataTask conforms to URLSessionDataTaskProtocol and fetches the network data. + public func dataTaskFromProtocol(with request: URLRequest, completionHandler: @escaping @Sendable (Data?, URLResponse?, (any Error)?) -> Void) -> any URLSessionDataTaskProtocol { + return dataTask(with: request, completionHandler: completionHandler) + } +} + +extension URLSessionDataTask: URLSessionDataTaskProtocol {} class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { @@ -112,7 +134,7 @@ open class URLSessionRequestBuilder: RequestBuilder { case .options, .post, .put, .patch, .delete, .trace, .connect: let contentType = headers["Content-Type"] ?? "application/json" - if contentType.hasPrefix("application/json") { + if contentType.hasPrefix("application/") && contentType.contains("json") { encoding = JSONDataEncoding() } else if contentType.hasPrefix("multipart/form-data") { encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -136,7 +158,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - let dataTask = urlSession.dataTask(with: request) { data, response, error in + let dataTask = urlSession.dataTaskFromProtocol(with: request) { data, response, error in apiResponseQueue.async { self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) cleanupRequest() diff --git a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts index d3616f85e38..8ef8b356076 100644 --- a/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v12-oneOf/builds/default/api/default.service.ts @@ -42,8 +42,9 @@ export class DefaultService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts index 1ae22faa555..1c9e3dfdeb4 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts index 6cbca642375..bdfd5912cd0 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts index a907ae063df..37db4c39a58 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts index 8087e194df5..37e99580d9d 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts index b9b57010552..bd0209428e5 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts index 8fb4cf1140a..80cde7e0ec8 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts index 8087e194df5..37e99580d9d 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts index b9b57010552..bd0209428e5 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts index 8fb4cf1140a..80cde7e0ec8 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts index d3616f85e38..8ef8b356076 100644 --- a/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v13-oneOf/builds/default/api/default.service.ts @@ -42,8 +42,9 @@ export class DefaultService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts index 1ae22faa555..1c9e3dfdeb4 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts index 6cbca642375..bdfd5912cd0 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts index a907ae063df..37db4c39a58 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts index 23e50e004ec..ffb70253eaf 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts index 4ed6aad2797..c81fb3d27b9 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts index 55744455ab6..f0251c55d36 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts index 23e50e004ec..ffb70253eaf 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts index 4ed6aad2797..c81fb3d27b9 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts index 55744455ab6..f0251c55d36 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts index 23e50e004ec..ffb70253eaf 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts index 4ed6aad2797..c81fb3d27b9 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts index 55744455ab6..f0251c55d36 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v14-provided-in-root/builds/default/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts index bb24ea5bcca..6fd8ec5eed9 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts index f2cd4b844fc..5eaf447f54b 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts index fcd474cf958..7aa74420016 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v14-query-param-object-format/model/pet.ts b/samples/client/petstore/typescript-angular-v14-query-param-object-format/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v14-query-param-object-format/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v14-query-param-object-format/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts index 23e50e004ec..ffb70253eaf 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts index 4ed6aad2797..c81fb3d27b9 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts index 55744455ab6..f0251c55d36 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v15-provided-in-root/builds/default/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts index 23e50e004ec..ffb70253eaf 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts index 4ed6aad2797..c81fb3d27b9 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts index 55744455ab6..f0251c55d36 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts index bd9b9427f05..f4659b9300a 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/pet.service.ts @@ -44,8 +44,9 @@ export class PetService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts index a7cf0a83713..043bb8efa12 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts @@ -42,8 +42,9 @@ export class StoreService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts index 33ea990881e..2f3945435db 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/user.service.ts @@ -42,8 +42,9 @@ export class UserService { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; } if (typeof basePath !== 'string') { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts index e0404395f91..c6c02b01f16 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts @@ -24,6 +24,7 @@ export interface Pet { tags?: Array; /** * pet status in the store + * @deprecated */ status?: Pet.StatusEnum; } diff --git a/samples/client/petstore/typescript-aurelia/default/package.json b/samples/client/petstore/typescript-aurelia/default/package.json index 2d613cc2661..eeffe305847 100644 --- a/samples/client/petstore/typescript-aurelia/default/package.json +++ b/samples/client/petstore/typescript-aurelia/default/package.json @@ -22,6 +22,6 @@ }, "devDependencies": { "tslint": "^3.15.1", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" } } diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts index 259040a2b38..d629dec4427 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/default/common.ts b/samples/client/petstore/typescript-axios/builds/default/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/default/common.ts +++ b/samples/client/petstore/typescript-axios/builds/default/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/common.ts b/samples/client/petstore/typescript-axios/builds/es6-target/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/common.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/package.json b/samples/client/petstore/typescript-axios/builds/es6-target/package.json index 07a92ace734..2c6217f2d80 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-axios/builds/es6-target/package.json @@ -27,8 +27,8 @@ "axios": "^1.6.1" }, "devDependencies": { - "@types/node": "^12.11.5", - "typescript": "^4.0" + "@types/node": "12.11.5 - 12.20.42", + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/common.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/common.ts index e1b019a3150..c0f62a7b6df 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/common.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/common.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/common.ts index e1b019a3150..c0f62a7b6df 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts index 25f8cc331dc..a88b9756578 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts @@ -127,50 +127,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index e4857e7e7c9..eba8f3d2937 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -20,11 +20,11 @@ import globalAxios from 'axios'; // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; // @ts-ignore -import { ApiResponse } from '../../../model/some/levels/deep'; +import type { ApiResponse } from '../../../model/some/levels/deep'; // @ts-ignore -import { Pet } from '../../../model/some/levels/deep'; +import type { Pet } from '../../../model/some/levels/deep'; /** * PetApi - axios parameter creator * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index 48f2e4f89fd..9671779d135 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -20,9 +20,9 @@ import globalAxios from 'axios'; // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; // @ts-ignore -import { Order } from '../../../model/some/levels/deep'; +import type { Order } from '../../../model/some/levels/deep'; /** * StoreApi - axios parameter creator * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index 091ce85df27..ca169877a3a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -20,9 +20,9 @@ import globalAxios from 'axios'; // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../../../base'; // @ts-ignore -import { User } from '../../../model/some/levels/deep'; +import type { User } from '../../../model/some/levels/deep'; /** * UserApi - axios parameter creator * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts index bb1cab2e56d..e0378b94c28 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts @@ -15,10 +15,10 @@ // May contain unused imports in some cases // @ts-ignore -import { Category } from './category'; +import type { Category } from './category'; // May contain unused imports in some cases // @ts-ignore -import { Tag } from './tag'; +import type { Tag } from './tag'; /** * A pet for sale in the pet store diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json index 81cacb21724..aa938d8bf65 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json @@ -25,8 +25,8 @@ "axios": "^1.6.1" }, "devDependencies": { - "@types/node": "^12.11.5", - "typescript": "^4.0" + "@types/node": "12.11.5 - 12.20.42", + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json index 81cacb21724..aa938d8bf65 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json @@ -25,8 +25,8 @@ "axios": "^1.6.1" }, "devDependencies": { - "@types/node": "^12.11.5", - "typescript": "^4.0" + "@types/node": "12.11.5 - 12.20.42", + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts index c58729d6aaf..d5b9e4718ae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/common.ts @@ -126,50 +126,10 @@ export const serializeDataIfNeeded = function (value: any, requestOptions: any, ? configuration.isJsonMime(requestOptions.headers['Content-Type']) : nonString; return needsSerialization - ? JSON.stringify(value !== undefined ? convertMapsAndSetsToPlain(value) : {}) + ? JSON.stringify(value !== undefined ? value : {}) : (value || ""); } -function convertMapsAndSetsToPlain(value: any): any { - if (typeof Set === "undefined") return value; - if (typeof Map === "undefined") return value; - if (typeof value !== "object" || !value) { - return value; - } - if (value instanceof Set) { - return Array.from(value).map(item => convertMapsAndSetsToPlain(item)); - } - if (value instanceof Map) { - const entries: Array<[string, any]> = []; - value.forEach((value: any, key: any) => { - entries.push([key, convertMapsAndSetsToPlain(value)]) - }); - return objectFromEntries(entries); - } - if (Array.isArray(value)) { - return value.map(it => convertMapsAndSetsToPlain(it)); - } - return objectFromEntries(objectEntries(value) - .map(([k, v]) => [k, convertMapsAndSetsToPlain(v)])); -} - -/** - * Ponyfill for Object.entries - */ -function objectEntries(object: Record): Array<[string, any]> { - return Object.keys(object).map(key => [key, object[key]]); -} - -/** - * Ponyfill for Object.fromEntries - */ -function objectFromEntries(entries: any): Record { - return [...entries].reduce((object, [key, val]) => { - object[key] = val; - return object; - }, {}); -} - /** * * @export diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Club.ts b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Club.ts index 5e7c7f7f972..6f935b2048d 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Club.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Club.ts @@ -37,7 +37,7 @@ export interface Club { /** * Check if a given object implements the Club interface. */ -export function instanceOfClub(value: object): boolean { +export function instanceOfClub(value: object): value is Club { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Owner.ts b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Owner.ts index 50e770a7d3f..58df8cbac49 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Owner.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/models/Owner.ts @@ -30,7 +30,7 @@ export interface Owner { /** * Check if a given object implements the Owner interface. */ -export function instanceOfOwner(value: object): boolean { +export function instanceOfOwner(value: object): value is Owner { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Club.ts b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Club.ts index d61b559fea2..c35b4f285e3 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Club.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Club.ts @@ -37,7 +37,7 @@ export interface Club { /** * Check if a given object implements the Club interface. */ -export function instanceOfClub(value: object): boolean { +export function instanceOfClub(value: object): value is Club { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Owner.ts b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Owner.ts index 50e770a7d3f..58df8cbac49 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Owner.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/models/Owner.ts @@ -30,7 +30,7 @@ export interface Owner { /** * Check if a given object implements the Owner interface. */ -export function instanceOfOwner(value: object): boolean { +export function instanceOfOwner(value: object): value is Owner { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts index f0c934a942c..a83efbc1155 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts @@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass { /** * Check if a given object implements the AdditionalPropertiesClass interface. */ -export function instanceOfAdditionalPropertiesClass(value: object): boolean { +export function instanceOfAdditionalPropertiesClass(value: object): value is AdditionalPropertiesClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AllOfWithSingleRef.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AllOfWithSingleRef.ts index 8f9802529e4..2b247b983ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AllOfWithSingleRef.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AllOfWithSingleRef.ts @@ -43,7 +43,7 @@ export interface AllOfWithSingleRef { /** * Check if a given object implements the AllOfWithSingleRef interface. */ -export function instanceOfAllOfWithSingleRef(value: object): boolean { +export function instanceOfAllOfWithSingleRef(value: object): value is AllOfWithSingleRef { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts index a1b091662a1..236ba544d0d 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Animal.ts @@ -13,11 +13,8 @@ */ import { mapValues } from '../runtime'; -import { - CatFromJSONTyped, - DogFromJSONTyped -} from './index'; - +import { CatFromJSONTyped } from './Cat'; +import { DogFromJSONTyped } from './Dog'; /** * * @export @@ -41,8 +38,8 @@ export interface Animal { /** * Check if a given object implements the Animal interface. */ -export function instanceOfAnimal(value: object): boolean { - if (!('className' in value)) return false; +export function instanceOfAnimal(value: object): value is Animal { + if (!('className' in value) || value['className'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfArrayOfNumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfArrayOfNumberOnly.ts index 6e4c4ac139c..dbffd74a572 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfArrayOfNumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfArrayOfNumberOnly.ts @@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly { /** * Check if a given object implements the ArrayOfArrayOfNumberOnly interface. */ -export function instanceOfArrayOfArrayOfNumberOnly(value: object): boolean { +export function instanceOfArrayOfArrayOfNumberOnly(value: object): value is ArrayOfArrayOfNumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfNumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfNumberOnly.ts index 4c0e2e98805..8029e9dd15b 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfNumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayOfNumberOnly.ts @@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly { /** * Check if a given object implements the ArrayOfNumberOnly interface. */ -export function instanceOfArrayOfNumberOnly(value: object): boolean { +export function instanceOfArrayOfNumberOnly(value: object): value is ArrayOfNumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts index 2cdb8f33fa6..fefc0e842b6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ArrayTest.ts @@ -49,7 +49,7 @@ export interface ArrayTest { /** * Check if a given object implements the ArrayTest interface. */ -export function instanceOfArrayTest(value: object): boolean { +export function instanceOfArrayTest(value: object): value is ArrayTest { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Capitalization.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Capitalization.ts index 1d7e59d6099..f9f38b2ed71 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Capitalization.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Capitalization.ts @@ -61,7 +61,7 @@ export interface Capitalization { /** * Check if a given object implements the Capitalization interface. */ -export function instanceOfCapitalization(value: object): boolean { +export function instanceOfCapitalization(value: object): value is Capitalization { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts index 3bc2bd8cdb1..05ffd9e8fab 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Cat.ts @@ -37,7 +37,7 @@ export interface Cat extends Animal { /** * Check if a given object implements the Cat interface. */ -export function instanceOfCat(value: object): boolean { +export function instanceOfCat(value: object): value is Cat { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Category.ts index e571880c8e1..640b1883c52 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Category.ts @@ -36,8 +36,8 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { - if (!('name' in value)) return false; +export function instanceOfCategory(value: object): value is Category { + if (!('name' in value) || value['name'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ChildWithNullable.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ChildWithNullable.ts index 2ed247a4541..24167b77a66 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ChildWithNullable.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ChildWithNullable.ts @@ -39,7 +39,7 @@ export interface ChildWithNullable extends ParentWithNullable { /** * Check if a given object implements the ChildWithNullable interface. */ -export function instanceOfChildWithNullable(value: object): boolean { +export function instanceOfChildWithNullable(value: object): value is ChildWithNullable { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ClassModel.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ClassModel.ts index 6d9ad88c1c5..1789763aaec 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ClassModel.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ClassModel.ts @@ -30,7 +30,7 @@ export interface ClassModel { /** * Check if a given object implements the ClassModel interface. */ -export function instanceOfClassModel(value: object): boolean { +export function instanceOfClassModel(value: object): value is ClassModel { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Client.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Client.ts index 807cd077730..21c3a1f3b79 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Client.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Client.ts @@ -30,7 +30,7 @@ export interface Client { /** * Check if a given object implements the Client interface. */ -export function instanceOfClient(value: object): boolean { +export function instanceOfClient(value: object): value is Client { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/DeprecatedObject.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/DeprecatedObject.ts index 8eab3767306..38ae523f5b9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/DeprecatedObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/DeprecatedObject.ts @@ -30,7 +30,7 @@ export interface DeprecatedObject { /** * Check if a given object implements the DeprecatedObject interface. */ -export function instanceOfDeprecatedObject(value: object): boolean { +export function instanceOfDeprecatedObject(value: object): value is DeprecatedObject { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts index 921e17cb803..5df4d5123a8 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Dog.ts @@ -37,7 +37,7 @@ export interface Dog extends Animal { /** * Check if a given object implements the Dog interface. */ -export function instanceOfDog(value: object): boolean { +export function instanceOfDog(value: object): value is Dog { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts index aa7200c9254..ddff5eeb796 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumArrays.ts @@ -56,7 +56,7 @@ export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeo /** * Check if a given object implements the EnumArrays interface. */ -export function instanceOfEnumArrays(value: object): boolean { +export function instanceOfEnumArrays(value: object): value is EnumArrays { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts index 2642db80899..d83d77aa5f5 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumClass.ts @@ -26,7 +26,14 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { - return Object.values(EnumClass).includes(value); + for (const key in EnumClass) { + if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { + if (EnumClass[key] === value) { + return true; + } + } + } + return false; } export function EnumClassFromJSON(json: any): EnumClass { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts index dbe67a7cf1f..b4ef265fd2d 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/EnumTest.ts @@ -19,24 +19,24 @@ import { OuterEnumFromJSONTyped, OuterEnumToJSON, } from './OuterEnum'; -import type { OuterEnumDefaultValue } from './OuterEnumDefaultValue'; -import { - OuterEnumDefaultValueFromJSON, - OuterEnumDefaultValueFromJSONTyped, - OuterEnumDefaultValueToJSON, -} from './OuterEnumDefaultValue'; -import type { OuterEnumInteger } from './OuterEnumInteger'; -import { - OuterEnumIntegerFromJSON, - OuterEnumIntegerFromJSONTyped, - OuterEnumIntegerToJSON, -} from './OuterEnumInteger'; import type { OuterEnumIntegerDefaultValue } from './OuterEnumIntegerDefaultValue'; import { OuterEnumIntegerDefaultValueFromJSON, OuterEnumIntegerDefaultValueFromJSONTyped, OuterEnumIntegerDefaultValueToJSON, } from './OuterEnumIntegerDefaultValue'; +import type { OuterEnumInteger } from './OuterEnumInteger'; +import { + OuterEnumIntegerFromJSON, + OuterEnumIntegerFromJSONTyped, + OuterEnumIntegerToJSON, +} from './OuterEnumInteger'; +import type { OuterEnumDefaultValue } from './OuterEnumDefaultValue'; +import { + OuterEnumDefaultValueFromJSON, + OuterEnumDefaultValueFromJSONTyped, + OuterEnumDefaultValueToJSON, +} from './OuterEnumDefaultValue'; /** * @@ -137,8 +137,8 @@ export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof /** * Check if a given object implements the EnumTest interface. */ -export function instanceOfEnumTest(value: object): boolean { - if (!('enumStringRequired' in value)) return false; +export function instanceOfEnumTest(value: object): value is EnumTest { + if (!('enumStringRequired' in value) || value['enumStringRequired'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts index 732ed05b62a..dc65ebf50f7 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts @@ -36,7 +36,7 @@ export interface FakeBigDecimalMap200Response { /** * Check if a given object implements the FakeBigDecimalMap200Response interface. */ -export function instanceOfFakeBigDecimalMap200Response(value: object): boolean { +export function instanceOfFakeBigDecimalMap200Response(value: object): value is FakeBigDecimalMap200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FileSchemaTestClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FileSchemaTestClass.ts index 25bf3ba4dbf..9da5b93a1a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FileSchemaTestClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FileSchemaTestClass.ts @@ -36,7 +36,7 @@ export interface FileSchemaTestClass { /** * Check if a given object implements the FileSchemaTestClass interface. */ -export function instanceOfFileSchemaTestClass(value: object): boolean { +export function instanceOfFileSchemaTestClass(value: object): value is FileSchemaTestClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Foo.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Foo.ts index feb5e47da04..94845a52698 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Foo.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Foo.ts @@ -30,7 +30,7 @@ export interface Foo { /** * Check if a given object implements the Foo interface. */ -export function instanceOfFoo(value: object): boolean { +export function instanceOfFoo(value: object): value is Foo { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FooGetDefaultResponse.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FooGetDefaultResponse.ts index b834ab550db..86af8d7e7cc 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FooGetDefaultResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FooGetDefaultResponse.ts @@ -37,7 +37,7 @@ export interface FooGetDefaultResponse { /** * Check if a given object implements the FooGetDefaultResponse interface. */ -export function instanceOfFooGetDefaultResponse(value: object): boolean { +export function instanceOfFooGetDefaultResponse(value: object): value is FooGetDefaultResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts index f2113709741..328ec809ee9 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FormatTest.ts @@ -127,11 +127,11 @@ export interface FormatTest { /** * Check if a given object implements the FormatTest interface. */ -export function instanceOfFormatTest(value: object): boolean { - if (!('number' in value)) return false; - if (!('_byte' in value)) return false; - if (!('date' in value)) return false; - if (!('password' in value)) return false; +export function instanceOfFormatTest(value: object): value is FormatTest { + if (!('number' in value) || value['number'] === undefined) return false; + if (!('_byte' in value) || value['_byte'] === undefined) return false; + if (!('date' in value) || value['date'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HasOnlyReadOnly.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HasOnlyReadOnly.ts index 82e1d7235e1..db19db8f72c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HasOnlyReadOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HasOnlyReadOnly.ts @@ -36,7 +36,7 @@ export interface HasOnlyReadOnly { /** * Check if a given object implements the HasOnlyReadOnly interface. */ -export function instanceOfHasOnlyReadOnly(value: object): boolean { +export function instanceOfHasOnlyReadOnly(value: object): value is HasOnlyReadOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HealthCheckResult.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HealthCheckResult.ts index 83a0cf52ee1..450b2c25043 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HealthCheckResult.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/HealthCheckResult.ts @@ -30,7 +30,7 @@ export interface HealthCheckResult { /** * Check if a given object implements the HealthCheckResult interface. */ -export function instanceOfHealthCheckResult(value: object): boolean { +export function instanceOfHealthCheckResult(value: object): value is HealthCheckResult { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/List.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/List.ts index 5513deda079..2b979862b76 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/List.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/List.ts @@ -30,7 +30,7 @@ export interface List { /** * Check if a given object implements the List interface. */ -export function instanceOfList(value: object): boolean { +export function instanceOfList(value: object): value is List { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts index 0ba03f9a901..7a2a4b27fef 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts @@ -59,7 +59,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof /** * Check if a given object implements the MapTest interface. */ -export function instanceOfMapTest(value: object): boolean { +export function instanceOfMapTest(value: object): value is MapTest { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts index 156ccc8a342..599422a3417 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts @@ -49,7 +49,7 @@ export interface MixedPropertiesAndAdditionalPropertiesClass { /** * Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface. */ -export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): boolean { +export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): value is MixedPropertiesAndAdditionalPropertiesClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Model200Response.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Model200Response.ts index 22570495bd6..31254e14b76 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Model200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Model200Response.ts @@ -36,7 +36,7 @@ export interface Model200Response { /** * Check if a given object implements the Model200Response interface. */ -export function instanceOfModel200Response(value: object): boolean { +export function instanceOfModel200Response(value: object): value is Model200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelApiResponse.ts index 7116a59f8d2..bf92ceff548 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelFile.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelFile.ts index dc08a2f1474..c54577e4fc0 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelFile.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ModelFile.ts @@ -30,7 +30,7 @@ export interface ModelFile { /** * Check if a given object implements the ModelFile interface. */ -export function instanceOfModelFile(value: object): boolean { +export function instanceOfModelFile(value: object): value is ModelFile { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts index 9b861d6d4d1..dbcf899e854 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Name.ts @@ -48,8 +48,8 @@ export interface Name { /** * Check if a given object implements the Name interface. */ -export function instanceOfName(value: object): boolean { - if (!('name' in value)) return false; +export function instanceOfName(value: object): value is Name { + if (!('name' in value) || value['name'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts index b64cd7d8f45..2fbcea7c6ea 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts @@ -97,7 +97,7 @@ export interface NullableClass { /** * Check if a given object implements the NullableClass interface. */ -export function instanceOfNullableClass(value: object): boolean { +export function instanceOfNullableClass(value: object): value is NullableClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NumberOnly.ts index 155afb118e4..c778f996c1a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NumberOnly.ts @@ -30,7 +30,7 @@ export interface NumberOnly { /** * Check if a given object implements the NumberOnly interface. */ -export function instanceOfNumberOnly(value: object): boolean { +export function instanceOfNumberOnly(value: object): value is NumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts index d24ea8fc197..99c4b488c48 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ObjectWithDeprecatedFields.ts @@ -58,7 +58,7 @@ export interface ObjectWithDeprecatedFields { /** * Check if a given object implements the ObjectWithDeprecatedFields interface. */ -export function instanceOfObjectWithDeprecatedFields(value: object): boolean { +export function instanceOfObjectWithDeprecatedFields(value: object): value is ObjectWithDeprecatedFields { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts index 8921894971d..7b83e804baa 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterComposite.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterComposite.ts index 49d8ad5cc5b..c965a360d04 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterComposite.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterComposite.ts @@ -42,7 +42,7 @@ export interface OuterComposite { /** * Check if a given object implements the OuterComposite interface. */ -export function instanceOfOuterComposite(value: object): boolean { +export function instanceOfOuterComposite(value: object): value is OuterComposite { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts index 1e1bb96977f..a35b7561819 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnum.ts @@ -26,7 +26,14 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { - return Object.values(OuterEnum).includes(value); + for (const key in OuterEnum) { + if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { + if (OuterEnum[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumFromJSON(json: any): OuterEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts index 93a84658c1c..08c50c71d68 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumDefaultValue.ts @@ -26,7 +26,14 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { - return Object.values(OuterEnumDefaultValue).includes(value); + for (const key in OuterEnumDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { + if (OuterEnumDefaultValue[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumDefaultValueFromJSON(json: any): OuterEnumDefaultValue { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts index 9ca8643211c..4c017a1ceb5 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumInteger.ts @@ -26,7 +26,14 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { - return Object.values(OuterEnumInteger).includes(value); + for (const key in OuterEnumInteger) { + if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { + if (OuterEnumInteger[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumIntegerFromJSON(json: any): OuterEnumInteger { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts index 7daa71a99ec..8e16b56eeda 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterEnumIntegerDefaultValue.ts @@ -26,7 +26,14 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { - return Object.values(OuterEnumIntegerDefaultValue).includes(value); + for (const key in OuterEnumIntegerDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { + if (OuterEnumIntegerDefaultValue[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumIntegerDefaultValueFromJSON(json: any): OuterEnumIntegerDefaultValue { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts index 3990064c348..c8ca1734039 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/OuterObjectWithEnumProperty.ts @@ -37,8 +37,8 @@ export interface OuterObjectWithEnumProperty { /** * Check if a given object implements the OuterObjectWithEnumProperty interface. */ -export function instanceOfOuterObjectWithEnumProperty(value: object): boolean { - if (!('value' in value)) return false; +export function instanceOfOuterObjectWithEnumProperty(value: object): value is OuterObjectWithEnumProperty { + if (!('value' in value) || value['value'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts index a593c5a384f..81195930614 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts @@ -13,10 +13,7 @@ */ import { mapValues } from '../runtime'; -import { - ChildWithNullableFromJSONTyped -} from './index'; - +import { ChildWithNullableFromJSONTyped } from './ChildWithNullable'; /** * * @export @@ -50,7 +47,7 @@ export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof /** * Check if a given object implements the ParentWithNullable interface. */ -export function instanceOfParentWithNullable(value: object): boolean { +export function instanceOfParentWithNullable(value: object): value is ParentWithNullable { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts index 1f29621cb3b..f2ad3c1ee46 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ReadOnlyFirst.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ReadOnlyFirst.ts index f1f5a01a89b..9bd46c432fc 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ReadOnlyFirst.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ReadOnlyFirst.ts @@ -36,7 +36,7 @@ export interface ReadOnlyFirst { /** * Check if a given object implements the ReadOnlyFirst interface. */ -export function instanceOfReadOnlyFirst(value: object): boolean { +export function instanceOfReadOnlyFirst(value: object): value is ReadOnlyFirst { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Return.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Return.ts index 68b15542cbb..3de8fb2d62b 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Return.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Return.ts @@ -30,7 +30,7 @@ export interface Return { /** * Check if a given object implements the Return interface. */ -export function instanceOfReturn(value: object): boolean { +export function instanceOfReturn(value: object): value is Return { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts index 60d49d6f22a..7dbee0a8e95 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SingleRefType.ts @@ -25,7 +25,14 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { - return Object.values(SingleRefType).includes(value); + for (const key in SingleRefType) { + if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { + if (SingleRefType[key] === value) { + return true; + } + } + } + return false; } export function SingleRefTypeFromJSON(json: any): SingleRefType { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialModelName.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialModelName.ts index b302e6f0362..34edcaa2f00 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialModelName.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/SpecialModelName.ts @@ -30,7 +30,7 @@ export interface SpecialModelName { /** * Check if a given object implements the SpecialModelName interface. */ -export function instanceOfSpecialModelName(value: object): boolean { +export function instanceOfSpecialModelName(value: object): value is SpecialModelName { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Tag.ts index 4ae4af399fd..f0ecd59d5ba 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts index acc16c94f49..cfe6fac4f43 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/TestInlineFreeformAdditionalPropertiesRequest.ts @@ -31,7 +31,7 @@ export interface TestInlineFreeformAdditionalPropertiesRequest { /** * Check if a given object implements the TestInlineFreeformAdditionalPropertiesRequest interface. */ -export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): boolean { +export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): value is TestInlineFreeformAdditionalPropertiesRequest { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/User.ts index c85ea3d6ed6..2028044d626 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts index a902fb9c9af..8f61f66faaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/EnumPatternObject.ts @@ -61,7 +61,7 @@ export interface EnumPatternObject { /** * Check if a given object implements the EnumPatternObject interface. */ -export function instanceOfEnumPatternObject(value: object): boolean { +export function instanceOfEnumPatternObject(value: object): value is EnumPatternObject { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts index 0e53bcfd09d..644637105ce 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/FakeEnumRequestGetInline200Response.ts @@ -90,7 +90,7 @@ export type FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum = typeof F /** * Check if a given object implements the FakeEnumRequestGetInline200Response interface. */ -export function instanceOfFakeEnumRequestGetInline200Response(value: object): boolean { +export function instanceOfFakeEnumRequestGetInline200Response(value: object): value is FakeEnumRequestGetInline200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts index a884536c2cc..a0c1b58a29e 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/NumberEnum.ts @@ -26,7 +26,14 @@ export type NumberEnum = typeof NumberEnum[keyof typeof NumberEnum]; export function instanceOfNumberEnum(value: any): boolean { - return Object.values(NumberEnum).includes(value); + for (const key in NumberEnum) { + if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { + if (NumberEnum[key] === value) { + return true; + } + } + } + return false; } export function NumberEnumFromJSON(json: any): NumberEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts index 503619ddd8a..c59850ed4b6 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/models/StringEnum.ts @@ -26,7 +26,14 @@ export type StringEnum = typeof StringEnum[keyof typeof StringEnum]; export function instanceOfStringEnum(value: any): boolean { - return Object.values(StringEnum).includes(value); + for (const key in StringEnum) { + if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { + if (StringEnum[key] === value) { + return true; + } + } + } + return false; } export function StringEnumFromJSON(json: any): StringEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 7c6d9667c05..6f92876c3bd 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -16,7 +16,7 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json index 0587300c451..ad4947a9d3e 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/package.json @@ -14,7 +14,7 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/package.json b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/package.json index ce3b2931d9d..502c6c06d2a 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/package.json +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/package.json @@ -20,7 +20,7 @@ "redux-saga": "^1.1.3", "redux-ts-simple": "^3.2.0", "reselect": "^4.0.0", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts index b2ce4c035d5..481793ab0bd 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/BehaviorType.ts @@ -26,7 +26,14 @@ export type BehaviorType = typeof BehaviorType[keyof typeof BehaviorType]; export function instanceOfBehaviorType(value: any): boolean { - return Object.values(BehaviorType).includes(value); + for (const key in BehaviorType) { + if (Object.prototype.hasOwnProperty.call(BehaviorType, key)) { + if (BehaviorType[key] === value) { + return true; + } + } + } + return false; } export function BehaviorTypeFromJSON(json: any): BehaviorType { diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts index 72d0569f4cc..9e3a2d63c54 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DefaultMetaOnlyResponse.ts @@ -37,8 +37,8 @@ export interface DefaultMetaOnlyResponse { /** * Check if a given object implements the DefaultMetaOnlyResponse interface. */ -export function instanceOfDefaultMetaOnlyResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfDefaultMetaOnlyResponse(value: object): value is DefaultMetaOnlyResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts index ee1f52f20a2..f04bfb6e45b 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/DeploymentRequestStatus.ts @@ -35,7 +35,14 @@ export type DeploymentRequestStatus = typeof DeploymentRequestStatus[keyof typeo export function instanceOfDeploymentRequestStatus(value: any): boolean { - return Object.values(DeploymentRequestStatus).includes(value); + for (const key in DeploymentRequestStatus) { + if (Object.prototype.hasOwnProperty.call(DeploymentRequestStatus, key)) { + if (DeploymentRequestStatus[key] === value) { + return true; + } + } + } + return false; } export function DeploymentRequestStatusFromJSON(json: any): DeploymentRequestStatus { diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts index a562973d268..13fe193a73f 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ErrorCode.ts @@ -41,7 +41,14 @@ export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode]; export function instanceOfErrorCode(value: any): boolean { - return Object.values(ErrorCode).includes(value); + for (const key in ErrorCode) { + if (Object.prototype.hasOwnProperty.call(ErrorCode, key)) { + if (ErrorCode[key] === value) { + return true; + } + } + } + return false; } export function ErrorCodeFromJSON(json: any): ErrorCode { diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts index 358b81b7f08..7f4307dbd77 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByStatusResponse.ts @@ -13,18 +13,18 @@ */ import { mapValues } from '../runtime'; -import type { Pet } from './Pet'; -import { - PetFromJSON, - PetFromJSONTyped, - PetToJSON, -} from './Pet'; import type { ResponseMeta } from './ResponseMeta'; import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, } from './ResponseMeta'; +import type { Pet } from './Pet'; +import { + PetFromJSON, + PetFromJSONTyped, + PetToJSON, +} from './Pet'; /** * @@ -49,8 +49,8 @@ export interface FindPetsByStatusResponse { /** * Check if a given object implements the FindPetsByStatusResponse interface. */ -export function instanceOfFindPetsByStatusResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfFindPetsByStatusResponse(value: object): value is FindPetsByStatusResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts index bfbe7a34cd9..31e86f68d60 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/FindPetsByUserResponse.ts @@ -13,18 +13,18 @@ */ import { mapValues } from '../runtime'; -import type { ResponseMeta } from './ResponseMeta'; -import { - ResponseMetaFromJSON, - ResponseMetaFromJSONTyped, - ResponseMetaToJSON, -} from './ResponseMeta'; import type { User } from './User'; import { UserFromJSON, UserFromJSONTyped, UserToJSON, } from './User'; +import type { ResponseMeta } from './ResponseMeta'; +import { + ResponseMetaFromJSON, + ResponseMetaFromJSONTyped, + ResponseMetaToJSON, +} from './ResponseMeta'; /** * @@ -49,8 +49,8 @@ export interface FindPetsByUserResponse { /** * Check if a given object implements the FindPetsByUserResponse interface. */ -export function instanceOfFindPetsByUserResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfFindPetsByUserResponse(value: object): value is FindPetsByUserResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts index e25682be1f5..c001a843b0e 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts @@ -43,8 +43,8 @@ export interface GetBehaviorPermissionsResponse { /** * Check if a given object implements the GetBehaviorPermissionsResponse interface. */ -export function instanceOfGetBehaviorPermissionsResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfGetBehaviorPermissionsResponse(value: object): value is GetBehaviorPermissionsResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts index 4f00ef27893..5de27f58461 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorTypeResponse.ts @@ -49,8 +49,8 @@ export interface GetBehaviorTypeResponse { /** * Check if a given object implements the GetBehaviorTypeResponse interface. */ -export function instanceOfGetBehaviorTypeResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfGetBehaviorTypeResponse(value: object): value is GetBehaviorTypeResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts index 1db258479c3..af60c4b351a 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetMatchingPartsResponse.ts @@ -13,18 +13,18 @@ */ import { mapValues } from '../runtime'; -import type { MatchingParts } from './MatchingParts'; -import { - MatchingPartsFromJSON, - MatchingPartsFromJSONTyped, - MatchingPartsToJSON, -} from './MatchingParts'; import type { ResponseMeta } from './ResponseMeta'; import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, } from './ResponseMeta'; +import type { MatchingParts } from './MatchingParts'; +import { + MatchingPartsFromJSON, + MatchingPartsFromJSONTyped, + MatchingPartsToJSON, +} from './MatchingParts'; /** * @@ -49,8 +49,8 @@ export interface GetMatchingPartsResponse { /** * Check if a given object implements the GetMatchingPartsResponse interface. */ -export function instanceOfGetMatchingPartsResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfGetMatchingPartsResponse(value: object): value is GetMatchingPartsResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts index 44815da1ca7..16ec3947673 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetPetPartTypeResponse.ts @@ -13,18 +13,18 @@ */ import { mapValues } from '../runtime'; -import type { PetPartType } from './PetPartType'; -import { - PetPartTypeFromJSON, - PetPartTypeFromJSONTyped, - PetPartTypeToJSON, -} from './PetPartType'; import type { ResponseMeta } from './ResponseMeta'; import { ResponseMetaFromJSON, ResponseMetaFromJSONTyped, ResponseMetaToJSON, } from './ResponseMeta'; +import type { PetPartType } from './PetPartType'; +import { + PetPartTypeFromJSON, + PetPartTypeFromJSONTyped, + PetPartTypeToJSON, +} from './PetPartType'; /** * @@ -49,8 +49,8 @@ export interface GetPetPartTypeResponse { /** * Check if a given object implements the GetPetPartTypeResponse interface. */ -export function instanceOfGetPetPartTypeResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfGetPetPartTypeResponse(value: object): value is GetPetPartTypeResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ItemId.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ItemId.ts index 5c2c2635242..bad63a3c68c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ItemId.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ItemId.ts @@ -36,9 +36,9 @@ export interface ItemId { /** * Check if a given object implements the ItemId interface. */ -export function instanceOfItemId(value: object): boolean { - if (!('id' in value)) return false; - if (!('type' in value)) return false; +export function instanceOfItemId(value: object): value is ItemId { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts index 6c27dd2e801..7f501316a40 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/MatchingParts.ts @@ -43,9 +43,9 @@ export interface MatchingParts { /** * Check if a given object implements the MatchingParts interface. */ -export function instanceOfMatchingParts(value: object): boolean { - if (!('connected' in value)) return false; - if (!('related' in value)) return false; +export function instanceOfMatchingParts(value: object): value is MatchingParts { + if (!('connected' in value) || value['connected'] === undefined) return false; + if (!('related' in value) || value['related'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts index 75714ef92cc..d5b17c2160c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ModelError.ts @@ -55,8 +55,8 @@ export interface ModelError { /** * Check if a given object implements the ModelError interface. */ -export function instanceOfModelError(value: object): boolean { - if (!('type' in value)) return false; +export function instanceOfModelError(value: object): value is ModelError { + if (!('type' in value) || value['type'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Part.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Part.ts index 9d7ae422213..07f345d28df 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Part.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Part.ts @@ -36,9 +36,9 @@ export interface Part { /** * Check if a given object implements the Part interface. */ -export function instanceOfPart(value: object): boolean { - if (!('id' in value)) return false; - if (!('name' in value)) return false; +export function instanceOfPart(value: object): value is Part { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts index bc567b49436..35c173b55b3 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Pet.ts @@ -187,21 +187,21 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('id' in value)) return false; - if (!('otherFriendIds' in value)) return false; - if (!('friendAge' in value)) return false; - if (!('age' in value)) return false; - if (!('isHappy' in value)) return false; - if (!('isTall' in value)) return false; - if (!('category' in value)) return false; - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; - if (!('warningStatus' in value)) return false; - if (!('alternateStatus' in value)) return false; - if (!('otherDepStatuses' in value)) return false; - if (!('tags' in value)) return false; - if (!('status' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('otherFriendIds' in value) || value['otherFriendIds'] === undefined) return false; + if (!('friendAge' in value) || value['friendAge'] === undefined) return false; + if (!('age' in value) || value['age'] === undefined) return false; + if (!('isHappy' in value) || value['isHappy'] === undefined) return false; + if (!('isTall' in value) || value['isTall'] === undefined) return false; + if (!('category' in value) || value['category'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; + if (!('warningStatus' in value) || value['warningStatus'] === undefined) return false; + if (!('alternateStatus' in value) || value['alternateStatus'] === undefined) return false; + if (!('otherDepStatuses' in value) || value['otherDepStatuses'] === undefined) return false; + if (!('tags' in value) || value['tags'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts index bf2426212c3..1aa5863611e 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetPartType.ts @@ -26,7 +26,14 @@ export type PetPartType = typeof PetPartType[keyof typeof PetPartType]; export function instanceOfPetPartType(value: any): boolean { - return Object.values(PetPartType).includes(value); + for (const key in PetPartType) { + if (Object.prototype.hasOwnProperty.call(PetPartType, key)) { + if (PetPartType[key] === value) { + return true; + } + } + } + return false; } export function PetPartTypeFromJSON(json: any): PetPartType { diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts index 400a5fa83e8..8430854a46c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/PetRegionsResponse.ts @@ -43,8 +43,8 @@ export interface PetRegionsResponse { /** * Check if a given object implements the PetRegionsResponse interface. */ -export function instanceOfPetRegionsResponse(value: object): boolean { - if (!('meta' in value)) return false; +export function instanceOfPetRegionsResponse(value: object): value is PetRegionsResponse { + if (!('meta' in value) || value['meta'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts index 6b17720e996..4584d592e7c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/ResponseMeta.ts @@ -99,8 +99,8 @@ export type ResponseMetaCodeEnum = typeof ResponseMetaCodeEnum[keyof typeof Resp /** * Check if a given object implements the ResponseMeta interface. */ -export function instanceOfResponseMeta(value: object): boolean { - if (!('code' in value)) return false; +export function instanceOfResponseMeta(value: object): value is ResponseMeta { + if (!('code' in value) || value['code'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/User.ts index c6cb145be14..17092c2c580 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/User.ts @@ -84,9 +84,9 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { - if (!('id' in value)) return false; - if (!('subUser2' in value)) return false; +export function instanceOfUser(value: object): value is User { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('subUser2' in value) || value['subUser2'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts index 8906f49dd92..4554cb6dff0 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/WarningCode.ts @@ -26,7 +26,14 @@ export type WarningCode = typeof WarningCode[keyof typeof WarningCode]; export function instanceOfWarningCode(value: any): boolean { - return Object.values(WarningCode).includes(value); + for (const key in WarningCode) { + if (Object.prototype.hasOwnProperty.call(WarningCode, key)) { + if (WarningCode[key] === value) { + return true; + } + } + } + return false; } export function WarningCodeFromJSON(json: any): WarningCode { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts index f0c934a942c..a83efbc1155 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts @@ -36,7 +36,7 @@ export interface AdditionalPropertiesClass { /** * Check if a given object implements the AdditionalPropertiesClass interface. */ -export function instanceOfAdditionalPropertiesClass(value: object): boolean { +export function instanceOfAdditionalPropertiesClass(value: object): value is AdditionalPropertiesClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AllOfWithSingleRef.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AllOfWithSingleRef.ts index 8f9802529e4..2b247b983ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AllOfWithSingleRef.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AllOfWithSingleRef.ts @@ -43,7 +43,7 @@ export interface AllOfWithSingleRef { /** * Check if a given object implements the AllOfWithSingleRef interface. */ -export function instanceOfAllOfWithSingleRef(value: object): boolean { +export function instanceOfAllOfWithSingleRef(value: object): value is AllOfWithSingleRef { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts index c2394952c9d..a49466dfac6 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts @@ -13,11 +13,8 @@ */ import { mapValues } from '../runtime'; -import { - CatFromJSONTyped, - DogFromJSONTyped -} from './index'; - +import { CatFromJSONTyped } from './Cat'; +import { DogFromJSONTyped } from './Dog'; /** * * @export @@ -41,8 +38,8 @@ export interface Animal { /** * Check if a given object implements the Animal interface. */ -export function instanceOfAnimal(value: object): boolean { - if (!('className' in value)) return false; +export function instanceOfAnimal(value: object): value is Animal { + if (!('className' in value) || value['className'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfArrayOfNumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfArrayOfNumberOnly.ts index 6e4c4ac139c..dbffd74a572 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfArrayOfNumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfArrayOfNumberOnly.ts @@ -30,7 +30,7 @@ export interface ArrayOfArrayOfNumberOnly { /** * Check if a given object implements the ArrayOfArrayOfNumberOnly interface. */ -export function instanceOfArrayOfArrayOfNumberOnly(value: object): boolean { +export function instanceOfArrayOfArrayOfNumberOnly(value: object): value is ArrayOfArrayOfNumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfNumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfNumberOnly.ts index 4c0e2e98805..8029e9dd15b 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfNumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayOfNumberOnly.ts @@ -30,7 +30,7 @@ export interface ArrayOfNumberOnly { /** * Check if a given object implements the ArrayOfNumberOnly interface. */ -export function instanceOfArrayOfNumberOnly(value: object): boolean { +export function instanceOfArrayOfNumberOnly(value: object): value is ArrayOfNumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayTest.ts index 2cdb8f33fa6..fefc0e842b6 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ArrayTest.ts @@ -49,7 +49,7 @@ export interface ArrayTest { /** * Check if a given object implements the ArrayTest interface. */ -export function instanceOfArrayTest(value: object): boolean { +export function instanceOfArrayTest(value: object): value is ArrayTest { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Capitalization.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Capitalization.ts index 1d7e59d6099..f9f38b2ed71 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Capitalization.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Capitalization.ts @@ -61,7 +61,7 @@ export interface Capitalization { /** * Check if a given object implements the Capitalization interface. */ -export function instanceOfCapitalization(value: object): boolean { +export function instanceOfCapitalization(value: object): value is Capitalization { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Cat.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Cat.ts index 3bc2bd8cdb1..05ffd9e8fab 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Cat.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Cat.ts @@ -37,7 +37,7 @@ export interface Cat extends Animal { /** * Check if a given object implements the Cat interface. */ -export function instanceOfCat(value: object): boolean { +export function instanceOfCat(value: object): value is Cat { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Category.ts index e571880c8e1..640b1883c52 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Category.ts @@ -36,8 +36,8 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { - if (!('name' in value)) return false; +export function instanceOfCategory(value: object): value is Category { + if (!('name' in value) || value['name'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ClassModel.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ClassModel.ts index 6d9ad88c1c5..1789763aaec 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ClassModel.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ClassModel.ts @@ -30,7 +30,7 @@ export interface ClassModel { /** * Check if a given object implements the ClassModel interface. */ -export function instanceOfClassModel(value: object): boolean { +export function instanceOfClassModel(value: object): value is ClassModel { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Client.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Client.ts index 807cd077730..21c3a1f3b79 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Client.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Client.ts @@ -30,7 +30,7 @@ export interface Client { /** * Check if a given object implements the Client interface. */ -export function instanceOfClient(value: object): boolean { +export function instanceOfClient(value: object): value is Client { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/DeprecatedObject.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/DeprecatedObject.ts index 8eab3767306..38ae523f5b9 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/DeprecatedObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/DeprecatedObject.ts @@ -30,7 +30,7 @@ export interface DeprecatedObject { /** * Check if a given object implements the DeprecatedObject interface. */ -export function instanceOfDeprecatedObject(value: object): boolean { +export function instanceOfDeprecatedObject(value: object): value is DeprecatedObject { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Dog.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Dog.ts index 921e17cb803..5df4d5123a8 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Dog.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Dog.ts @@ -37,7 +37,7 @@ export interface Dog extends Animal { /** * Check if a given object implements the Dog interface. */ -export function instanceOfDog(value: object): boolean { +export function instanceOfDog(value: object): value is Dog { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts index aa7200c9254..ddff5eeb796 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumArrays.ts @@ -56,7 +56,7 @@ export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeo /** * Check if a given object implements the EnumArrays interface. */ -export function instanceOfEnumArrays(value: object): boolean { +export function instanceOfEnumArrays(value: object): value is EnumArrays { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts index 2642db80899..d83d77aa5f5 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumClass.ts @@ -26,7 +26,14 @@ export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; export function instanceOfEnumClass(value: any): boolean { - return Object.values(EnumClass).includes(value); + for (const key in EnumClass) { + if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { + if (EnumClass[key] === value) { + return true; + } + } + } + return false; } export function EnumClassFromJSON(json: any): EnumClass { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts index dbe67a7cf1f..b4ef265fd2d 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/EnumTest.ts @@ -19,24 +19,24 @@ import { OuterEnumFromJSONTyped, OuterEnumToJSON, } from './OuterEnum'; -import type { OuterEnumDefaultValue } from './OuterEnumDefaultValue'; -import { - OuterEnumDefaultValueFromJSON, - OuterEnumDefaultValueFromJSONTyped, - OuterEnumDefaultValueToJSON, -} from './OuterEnumDefaultValue'; -import type { OuterEnumInteger } from './OuterEnumInteger'; -import { - OuterEnumIntegerFromJSON, - OuterEnumIntegerFromJSONTyped, - OuterEnumIntegerToJSON, -} from './OuterEnumInteger'; import type { OuterEnumIntegerDefaultValue } from './OuterEnumIntegerDefaultValue'; import { OuterEnumIntegerDefaultValueFromJSON, OuterEnumIntegerDefaultValueFromJSONTyped, OuterEnumIntegerDefaultValueToJSON, } from './OuterEnumIntegerDefaultValue'; +import type { OuterEnumInteger } from './OuterEnumInteger'; +import { + OuterEnumIntegerFromJSON, + OuterEnumIntegerFromJSONTyped, + OuterEnumIntegerToJSON, +} from './OuterEnumInteger'; +import type { OuterEnumDefaultValue } from './OuterEnumDefaultValue'; +import { + OuterEnumDefaultValueFromJSON, + OuterEnumDefaultValueFromJSONTyped, + OuterEnumDefaultValueToJSON, +} from './OuterEnumDefaultValue'; /** * @@ -137,8 +137,8 @@ export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof /** * Check if a given object implements the EnumTest interface. */ -export function instanceOfEnumTest(value: object): boolean { - if (!('enumStringRequired' in value)) return false; +export function instanceOfEnumTest(value: object): value is EnumTest { + if (!('enumStringRequired' in value) || value['enumStringRequired'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts index 732ed05b62a..dc65ebf50f7 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts @@ -36,7 +36,7 @@ export interface FakeBigDecimalMap200Response { /** * Check if a given object implements the FakeBigDecimalMap200Response interface. */ -export function instanceOfFakeBigDecimalMap200Response(value: object): boolean { +export function instanceOfFakeBigDecimalMap200Response(value: object): value is FakeBigDecimalMap200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FileSchemaTestClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FileSchemaTestClass.ts index 25bf3ba4dbf..9da5b93a1a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FileSchemaTestClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FileSchemaTestClass.ts @@ -36,7 +36,7 @@ export interface FileSchemaTestClass { /** * Check if a given object implements the FileSchemaTestClass interface. */ -export function instanceOfFileSchemaTestClass(value: object): boolean { +export function instanceOfFileSchemaTestClass(value: object): value is FileSchemaTestClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Foo.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Foo.ts index feb5e47da04..94845a52698 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Foo.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Foo.ts @@ -30,7 +30,7 @@ export interface Foo { /** * Check if a given object implements the Foo interface. */ -export function instanceOfFoo(value: object): boolean { +export function instanceOfFoo(value: object): value is Foo { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FooGetDefaultResponse.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FooGetDefaultResponse.ts index b834ab550db..86af8d7e7cc 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FooGetDefaultResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FooGetDefaultResponse.ts @@ -37,7 +37,7 @@ export interface FooGetDefaultResponse { /** * Check if a given object implements the FooGetDefaultResponse interface. */ -export function instanceOfFooGetDefaultResponse(value: object): boolean { +export function instanceOfFooGetDefaultResponse(value: object): value is FooGetDefaultResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FormatTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FormatTest.ts index f2113709741..328ec809ee9 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FormatTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FormatTest.ts @@ -127,11 +127,11 @@ export interface FormatTest { /** * Check if a given object implements the FormatTest interface. */ -export function instanceOfFormatTest(value: object): boolean { - if (!('number' in value)) return false; - if (!('_byte' in value)) return false; - if (!('date' in value)) return false; - if (!('password' in value)) return false; +export function instanceOfFormatTest(value: object): value is FormatTest { + if (!('number' in value) || value['number'] === undefined) return false; + if (!('_byte' in value) || value['_byte'] === undefined) return false; + if (!('date' in value) || value['date'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HasOnlyReadOnly.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HasOnlyReadOnly.ts index 82e1d7235e1..db19db8f72c 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HasOnlyReadOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HasOnlyReadOnly.ts @@ -36,7 +36,7 @@ export interface HasOnlyReadOnly { /** * Check if a given object implements the HasOnlyReadOnly interface. */ -export function instanceOfHasOnlyReadOnly(value: object): boolean { +export function instanceOfHasOnlyReadOnly(value: object): value is HasOnlyReadOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HealthCheckResult.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HealthCheckResult.ts index 83a0cf52ee1..450b2c25043 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HealthCheckResult.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/HealthCheckResult.ts @@ -30,7 +30,7 @@ export interface HealthCheckResult { /** * Check if a given object implements the HealthCheckResult interface. */ -export function instanceOfHealthCheckResult(value: object): boolean { +export function instanceOfHealthCheckResult(value: object): value is HealthCheckResult { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/List.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/List.ts index 5513deda079..2b979862b76 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/List.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/List.ts @@ -30,7 +30,7 @@ export interface List { /** * Check if a given object implements the List interface. */ -export function instanceOfList(value: object): boolean { +export function instanceOfList(value: object): value is List { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts index 0ba03f9a901..7a2a4b27fef 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts @@ -59,7 +59,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof /** * Check if a given object implements the MapTest interface. */ -export function instanceOfMapTest(value: object): boolean { +export function instanceOfMapTest(value: object): value is MapTest { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts index 156ccc8a342..599422a3417 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts @@ -49,7 +49,7 @@ export interface MixedPropertiesAndAdditionalPropertiesClass { /** * Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface. */ -export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): boolean { +export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): value is MixedPropertiesAndAdditionalPropertiesClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Model200Response.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Model200Response.ts index 22570495bd6..31254e14b76 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Model200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Model200Response.ts @@ -36,7 +36,7 @@ export interface Model200Response { /** * Check if a given object implements the Model200Response interface. */ -export function instanceOfModel200Response(value: object): boolean { +export function instanceOfModel200Response(value: object): value is Model200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelApiResponse.ts index 7116a59f8d2..bf92ceff548 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelFile.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelFile.ts index dc08a2f1474..c54577e4fc0 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelFile.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ModelFile.ts @@ -30,7 +30,7 @@ export interface ModelFile { /** * Check if a given object implements the ModelFile interface. */ -export function instanceOfModelFile(value: object): boolean { +export function instanceOfModelFile(value: object): value is ModelFile { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Name.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Name.ts index 9b861d6d4d1..dbcf899e854 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Name.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Name.ts @@ -48,8 +48,8 @@ export interface Name { /** * Check if a given object implements the Name interface. */ -export function instanceOfName(value: object): boolean { - if (!('name' in value)) return false; +export function instanceOfName(value: object): value is Name { + if (!('name' in value) || value['name'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts index b64cd7d8f45..2fbcea7c6ea 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts @@ -97,7 +97,7 @@ export interface NullableClass { /** * Check if a given object implements the NullableClass interface. */ -export function instanceOfNullableClass(value: object): boolean { +export function instanceOfNullableClass(value: object): value is NullableClass { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NumberOnly.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NumberOnly.ts index 155afb118e4..c778f996c1a 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NumberOnly.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NumberOnly.ts @@ -30,7 +30,7 @@ export interface NumberOnly { /** * Check if a given object implements the NumberOnly interface. */ -export function instanceOfNumberOnly(value: object): boolean { +export function instanceOfNumberOnly(value: object): value is NumberOnly { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ObjectWithDeprecatedFields.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ObjectWithDeprecatedFields.ts index d24ea8fc197..99c4b488c48 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ObjectWithDeprecatedFields.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ObjectWithDeprecatedFields.ts @@ -58,7 +58,7 @@ export interface ObjectWithDeprecatedFields { /** * Check if a given object implements the ObjectWithDeprecatedFields interface. */ -export function instanceOfObjectWithDeprecatedFields(value: object): boolean { +export function instanceOfObjectWithDeprecatedFields(value: object): value is ObjectWithDeprecatedFields { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts index 8921894971d..7b83e804baa 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterComposite.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterComposite.ts index 49d8ad5cc5b..c965a360d04 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterComposite.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterComposite.ts @@ -42,7 +42,7 @@ export interface OuterComposite { /** * Check if a given object implements the OuterComposite interface. */ -export function instanceOfOuterComposite(value: object): boolean { +export function instanceOfOuterComposite(value: object): value is OuterComposite { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts index 1e1bb96977f..a35b7561819 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnum.ts @@ -26,7 +26,14 @@ export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; export function instanceOfOuterEnum(value: any): boolean { - return Object.values(OuterEnum).includes(value); + for (const key in OuterEnum) { + if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { + if (OuterEnum[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumFromJSON(json: any): OuterEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts index 93a84658c1c..08c50c71d68 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumDefaultValue.ts @@ -26,7 +26,14 @@ export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof Ou export function instanceOfOuterEnumDefaultValue(value: any): boolean { - return Object.values(OuterEnumDefaultValue).includes(value); + for (const key in OuterEnumDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { + if (OuterEnumDefaultValue[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumDefaultValueFromJSON(json: any): OuterEnumDefaultValue { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts index 9ca8643211c..4c017a1ceb5 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumInteger.ts @@ -26,7 +26,14 @@ export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInt export function instanceOfOuterEnumInteger(value: any): boolean { - return Object.values(OuterEnumInteger).includes(value); + for (const key in OuterEnumInteger) { + if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { + if (OuterEnumInteger[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumIntegerFromJSON(json: any): OuterEnumInteger { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts index 7daa71a99ec..8e16b56eeda 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterEnumIntegerDefaultValue.ts @@ -26,7 +26,14 @@ export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[k export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { - return Object.values(OuterEnumIntegerDefaultValue).includes(value); + for (const key in OuterEnumIntegerDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { + if (OuterEnumIntegerDefaultValue[key] === value) { + return true; + } + } + } + return false; } export function OuterEnumIntegerDefaultValueFromJSON(json: any): OuterEnumIntegerDefaultValue { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterObjectWithEnumProperty.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterObjectWithEnumProperty.ts index 3990064c348..c8ca1734039 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterObjectWithEnumProperty.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/OuterObjectWithEnumProperty.ts @@ -37,8 +37,8 @@ export interface OuterObjectWithEnumProperty { /** * Check if a given object implements the OuterObjectWithEnumProperty interface. */ -export function instanceOfOuterObjectWithEnumProperty(value: object): boolean { - if (!('value' in value)) return false; +export function instanceOfOuterObjectWithEnumProperty(value: object): value is OuterObjectWithEnumProperty { + if (!('value' in value) || value['value'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts index 1f29621cb3b..f2ad3c1ee46 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ReadOnlyFirst.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ReadOnlyFirst.ts index f1f5a01a89b..9bd46c432fc 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ReadOnlyFirst.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/ReadOnlyFirst.ts @@ -36,7 +36,7 @@ export interface ReadOnlyFirst { /** * Check if a given object implements the ReadOnlyFirst interface. */ -export function instanceOfReadOnlyFirst(value: object): boolean { +export function instanceOfReadOnlyFirst(value: object): value is ReadOnlyFirst { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Return.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Return.ts index 68b15542cbb..3de8fb2d62b 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Return.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Return.ts @@ -30,7 +30,7 @@ export interface Return { /** * Check if a given object implements the Return interface. */ -export function instanceOfReturn(value: object): boolean { +export function instanceOfReturn(value: object): value is Return { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts index 60d49d6f22a..7dbee0a8e95 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SingleRefType.ts @@ -25,7 +25,14 @@ export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; export function instanceOfSingleRefType(value: any): boolean { - return Object.values(SingleRefType).includes(value); + for (const key in SingleRefType) { + if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { + if (SingleRefType[key] === value) { + return true; + } + } + } + return false; } export function SingleRefTypeFromJSON(json: any): SingleRefType { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SpecialModelName.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SpecialModelName.ts index b302e6f0362..34edcaa2f00 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SpecialModelName.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/SpecialModelName.ts @@ -30,7 +30,7 @@ export interface SpecialModelName { /** * Check if a given object implements the SpecialModelName interface. */ -export function instanceOfSpecialModelName(value: object): boolean { +export function instanceOfSpecialModelName(value: object): value is SpecialModelName { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Tag.ts index 4ae4af399fd..f0ecd59d5ba 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/User.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/User.ts index c85ea3d6ed6..2028044d626 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json index 22549c6b3a7..76f814ff6bf 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json @@ -1,36 +1,28 @@ { "name": "@openapitools/typescript-fetch-petstore", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openapitools/typescript-fetch-petstore", "version": "1.0.0", "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" } }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } } - }, - "dependencies": { - "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", - "dev": true - } } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 0587300c451..ad4947a9d3e 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -14,7 +14,7 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts index 19e40eaf4b8..54f256e339f 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts @@ -36,7 +36,7 @@ export interface Category { /** * Check if a given object implements the Category interface. */ -export function instanceOfCategory(value: object): boolean { +export function instanceOfCategory(value: object): value is Category { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts index 4496efe73f0..bc250bd002c 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts @@ -42,7 +42,7 @@ export interface ModelApiResponse { /** * Check if a given object implements the ModelApiResponse interface. */ -export function instanceOfModelApiResponse(value: object): boolean { +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts index 948cda435c8..f1a3a4bb0f0 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts @@ -72,7 +72,7 @@ export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnu /** * Check if a given object implements the Order interface. */ -export function instanceOfOrder(value: object): boolean { +export function instanceOfOrder(value: object): value is Order { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts index 3c60d980598..476b11aa0ef 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts @@ -85,9 +85,9 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; /** * Check if a given object implements the Pet interface. */ -export function instanceOfPet(value: object): boolean { - if (!('name' in value)) return false; - if (!('photoUrls' in value)) return false; +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts index 0a5bdbdde07..fd877416ade 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts @@ -36,7 +36,7 @@ export interface Tag { /** * Check if a given object implements the Tag interface. */ -export function instanceOfTag(value: object): boolean { +export function instanceOfTag(value: object): value is Tag { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts index 3924497622f..149be73b9ff 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts @@ -72,7 +72,7 @@ export interface User { /** * Check if a given object implements the User interface. */ -export function instanceOfUser(value: object): boolean { +export function instanceOfUser(value: object): value is User { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/EnumPatternObject.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/EnumPatternObject.ts index a902fb9c9af..8f61f66faaa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/EnumPatternObject.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/EnumPatternObject.ts @@ -61,7 +61,7 @@ export interface EnumPatternObject { /** * Check if a given object implements the EnumPatternObject interface. */ -export function instanceOfEnumPatternObject(value: object): boolean { +export function instanceOfEnumPatternObject(value: object): value is EnumPatternObject { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestGetInline200Response.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestGetInline200Response.ts index a801fcf5ef1..fe388268b17 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestGetInline200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/FakeEnumRequestGetInline200Response.ts @@ -86,7 +86,7 @@ export enum FakeEnumRequestGetInline200ResponseNullableNumberEnumEnum { /** * Check if a given object implements the FakeEnumRequestGetInline200Response interface. */ -export function instanceOfFakeEnumRequestGetInline200Response(value: object): boolean { +export function instanceOfFakeEnumRequestGetInline200Response(value: object): value is FakeEnumRequestGetInline200Response { return true; } diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts index e65639e50eb..5b3ea298b9d 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/NumberEnum.ts @@ -25,7 +25,14 @@ export enum NumberEnum { export function instanceOfNumberEnum(value: any): boolean { - return Object.values(NumberEnum).includes(value); + for (const key in NumberEnum) { + if (Object.prototype.hasOwnProperty.call(NumberEnum, key)) { + if (NumberEnum[key] === value) { + return true; + } + } + } + return false; } export function NumberEnumFromJSON(json: any): NumberEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts index d8720fe1fe2..21f232a76a9 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/models/StringEnum.ts @@ -25,7 +25,14 @@ export enum StringEnum { export function instanceOfStringEnum(value: any): boolean { - return Object.values(StringEnum).includes(value); + for (const key in StringEnum) { + if (Object.prototype.hasOwnProperty.call(StringEnum, key)) { + if (StringEnum[key] === value) { + return true; + } + } + } + return false; } export function StringEnumFromJSON(json: any): StringEnum { diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/package.json b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/package.json index 0587300c451..ad4947a9d3e 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/package.json +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/package.json @@ -14,7 +14,7 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/tests/default/package-lock.json b/samples/client/petstore/typescript-fetch/tests/default/package-lock.json index b2049c8b249..609de4bb9fb 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/package-lock.json +++ b/samples/client/petstore/typescript-fetch/tests/default/package-lock.json @@ -1,7 +1,7 @@ { "name": "typescript-fetch-test", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -27,7 +27,7 @@ "node-fetch": "^2.2.0", "ts-loader": "^2.3.0", "tsify": "^3.0.4", - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "typings": "^2.1.1", "webpack": "^1.13.0" } @@ -36,7 +36,7 @@ "name": "@openapitools/typescript-fetch-petstore", "version": "1.0.0", "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" } }, "node_modules/@openapitools/typescript-fetch-petstore": { @@ -48,24 +48,25 @@ "link": true }, "node_modules/@types/chai": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", - "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", + "version": "4.3.16", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.16.tgz", + "integrity": "sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==", "dev": true }, "node_modules/@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.5.0.tgz", + "integrity": "sha512-23/wYiuckYYtFpL+4RPWiWmRQH2BjFuqCUi2+N3amB1a1Drv+i/byTrGvlLwRVLFNAZbwpbQ7JvTK+VCAPMbcg==", + "deprecated": "This is a stub types definition. form-data provides its own type definitions, so you do not need this installed.", "dev": true, "dependencies": { - "@types/node": "*" + "form-data": "*" } }, "node_modules/@types/isomorphic-fetch": { "version": "0.0.34", "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", - "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", + "integrity": "sha512-BmJKuPCZCR6pbYYgi5nKFJrPC4pLoBgsi/B1nFN64Ba+hLLGUcKPIh7eVlR2xG763Ap08hgQafq/Wx4RFb0omQ==", "dev": true }, "node_modules/@types/mocha": { @@ -75,18 +76,33 @@ "dev": true }, "node_modules/@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", "dev": true }, "node_modules/@types/node-fetch": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha512-XroxUzLpKuL+CVkQqXlffRkEPi4Gh3Oui/mWyS7ztKiyqVxiU+h3imCW5I2NQmde5jK+3q++36/Q96cyRWsweg==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", "dev": true, "dependencies": { - "@types/node": "*" + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/node-fetch/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" } }, "node_modules/abbrev": { @@ -96,9 +112,9 @@ "dev": true }, "node_modules/acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -108,20 +124,20 @@ } }, "node_modules/acorn-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.0.tgz", - "integrity": "sha512-ZsysjEh+Y3i14f7YXCAKJy99RXbd56wHKYBzN4FlFtICIZyFpYwK6OwNJhcz8A/FMtxoUZkJofH1v9KIfNgWmw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", "dev": true, "dependencies": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1", - "xtend": "^4.0.1" + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" } }, "node_modules/acorn-walk": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.0.tgz", - "integrity": "sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true, "engines": { "node": ">=0.4.0" @@ -130,7 +146,7 @@ "node_modules/agent-base": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", - "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "integrity": "sha512-oDtZV740o3fr5oJtPLOsgH2hl2TRPscNXIx4VzzBwVlXVkv8RHm7XXqGAYg8t20+Gwu6LNDnx8HRMGqVGPZ8Vw==", "dev": true, "dependencies": { "extend": "~3.0.0", @@ -139,8 +155,8 @@ }, "node_modules/agent-base/node_modules/semver": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/semver/-/semver-5.0.3.tgz", - "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha512-5OkOBiw69xqmxOFIXwXsiY1HlE+om8nNptg1ZIf95fzcnfgOv2fLm7pmmGbRJsjJIqPpW5Kwy4wpDBTz5wQlUw==", "dev": true, "bin": { "semver": "bin/semver" @@ -149,7 +165,7 @@ "node_modules/align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", "dev": true, "dependencies": { "kind-of": "^3.0.2", @@ -163,7 +179,7 @@ "node_modules/amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", "dev": true, "engines": { "node": ">=0.4.2" @@ -172,7 +188,7 @@ "node_modules/ansi-align": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "integrity": "sha512-TdlOggdA/zURfMYa7ABC66j+oqfMew58KpJMbUlH3bcZP1b+cBHIHDDn5uH9INsxrHBPjsqM0tDB4jPTF/vgJA==", "dev": true, "dependencies": { "string-width": "^2.0.0" @@ -181,19 +197,19 @@ "node_modules/ansi-escapes": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "integrity": "sha512-wiXutNjDUlNEDWHcYH3jtZUhd3c4/VojassD8zHdHCY13xbZy2XbW+NKQwA0tWGBVzDA9qEzYwfoSsWmviidhw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -210,7 +226,7 @@ "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true }, "node_modules/anymatch": { @@ -226,13 +242,13 @@ "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "node_modules/arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "integrity": "sha512-dtXTVMkh6VkEEA7OhXnN1Ecb8aAGFdZ1LFxtOCoqj4qkyOJMt7+qs6Ahdy6p/NQCPYsRSXXivhSB/J5E9jmYKA==", "dev": true, "dependencies": { "arr-flatten": "^1.0.1" @@ -253,34 +269,16 @@ "node_modules/arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, - "node_modules/array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "node_modules/array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, "node_modules/array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -289,7 +287,7 @@ "node_modules/array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "integrity": "sha512-G2n5bG5fSUCpnsXz4+8FUkYsGPkNfLn9YvS66U5qbTIXI2Ynnlo4Bi42bWv+omKUCqz+ejzfClwne0alJWJPhg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -298,7 +296,7 @@ "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "engines": { "node": ">=0.10.0" } @@ -314,28 +312,20 @@ "minimalistic-assert": "^1.0.0" } }, - "node_modules/assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "dependencies": { - "util": "0.10.3" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "node_modules/assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", "dev": true, "dependencies": { - "inherits": "2.0.1" + "object.assign": "^4.1.4", + "util": "^0.10.4" } }, "node_modules/assertion-error": { @@ -349,7 +339,7 @@ "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -357,20 +347,26 @@ }, "node_modules/async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", "dev": true }, "node_modules/async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.6.tgz", + "integrity": "sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "node_modules/atob": { @@ -386,9 +382,9 @@ } }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/base": { @@ -412,7 +408,7 @@ "node_modules/base/node_modules/define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, "dependencies": { "is-descriptor": "^1.0.0" @@ -421,87 +417,64 @@ "node": ">=0.10.0" } }, - "node_modules/base/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/base/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, "engines": { "node": "*" } }, "node_modules/binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, "node_modules/bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, "node_modules/boxen": { @@ -535,7 +508,7 @@ "node_modules/braces": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "integrity": "sha512-xU7bpz2ytJl1bH9cgIurjpg/n8Gohy9GTw81heDYLJQ4RU60dlyJsa+atVF2pI0yMMvKxI9HkKwjePCj5XI1hw==", "dev": true, "dependencies": { "expand-range": "^1.8.1", @@ -549,7 +522,7 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", "dev": true }, "node_modules/browser-pack": { @@ -581,13 +554,13 @@ "node_modules/browser-resolve/node_modules/resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", "dev": true }, "node_modules/browser-stdout": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "integrity": "sha512-7Rfk377tpSM9TWBEeHs0FlDZGoAIei2V/4MdZJoFMBFAK6BqLpxAIUepGRHGdPFgGsLb02PXovC4qddyHvQqTg==", "dev": true }, "node_modules/browserify": { @@ -650,7 +623,7 @@ }, "node_modules/browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "dependencies": { @@ -686,28 +659,34 @@ } }, "node_modules/browserify-rsa": { - "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", "dev": true, "dependencies": { - "bn.js": "^4.1.0", + "bn.js": "^5.0.0", "randombytes": "^2.0.1" } }, "node_modules/browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", "dev": true, "dependencies": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" } }, "node_modules/browserify-zlib": { @@ -720,31 +699,45 @@ } }, "node_modules/buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", "dev": true }, "node_modules/builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", "dev": true }, "node_modules/cache-base": { @@ -768,33 +761,55 @@ } }, "node_modules/cached-path-relative": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", + "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==", "dev": true }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.2.tgz", + "integrity": "sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==", "dev": true, "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/center-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", "dev": true, "dependencies": { "align-text": "^0.1.3", @@ -805,25 +820,26 @@ } }, "node_modules/chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" } }, "node_modules/chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -833,10 +849,32 @@ "node": ">=4" } }, + "node_modules/chalk/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -844,7 +882,7 @@ "node_modules/chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "integrity": "sha512-mk8fAWcRUOxY7btlLtitj3A45jOwSAxH4tOFOoEGbVsl6cL6pPMWUy7dwZ/canfj3QEdP6FHSnf/l1c6/WkzVg==", "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", "dev": true, "dependencies": { @@ -895,7 +933,7 @@ "node_modules/class-utils/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { "is-descriptor": "^0.1.0" @@ -904,10 +942,23 @@ "node": ">=0.10.0" } }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", + "integrity": "sha512-3Fo5wu8Ytle8q9iCzS4D2MWVL2X7JVWRiS1BnXbTFDhS9c/REkM9vd1AmabsoZoY5/dGi5TT9iKL8Kb6DeBRQg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -916,7 +967,7 @@ "node_modules/cli-cursor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "integrity": "sha512-25tABq090YNKkF6JH7lcwO0zFJTRke4Jcq9iX2nr/Sz0Cjjv4gckmwlW6Ty/aoyFd6z3ysR2hMGC2GFugmBo6A==", "dev": true, "dependencies": { "restore-cursor": "^1.0.1" @@ -941,7 +992,7 @@ "node_modules/cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "integrity": "sha512-GIOYRizG+TGoc7Wgc1LiOTLare95R3mzKgoln+Q/lE4ceiYH19gUpl0l0Ffq4lJDEf3FxujMe6IBfOCs7pfqNA==", "dev": true, "dependencies": { "center-align": "^0.1.1", @@ -952,7 +1003,7 @@ "node_modules/cliui/node_modules/wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "integrity": "sha512-xSBsCeh+g+dinoBv3GAOWM4LcVVO68wLXRanibtBSdUvkGWQRGeE9P7IwU9EmDDi4jA6L44lz15CGMwdw9N5+Q==", "dev": true, "engines": { "node": ">=0.4.0" @@ -961,7 +1012,7 @@ "node_modules/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "dev": true, "engines": { "node": ">=0.8" @@ -970,7 +1021,7 @@ "node_modules/collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", "dev": true, "dependencies": { "map-visit": "^1.0.0", @@ -991,22 +1042,25 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/columnify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", - "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz", + "integrity": "sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q==", "dev": true, "dependencies": { - "strip-ansi": "^3.0.0", + "strip-ansi": "^6.0.1", "wcwidth": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" } }, "node_modules/combine-source-map": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", "dev": true, "dependencies": { "convert-source-map": "~1.1.0", @@ -1016,9 +1070,9 @@ } }, "node_modules/combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "dependencies": { "delayed-stream": "~1.0.0" @@ -1029,8 +1083,8 @@ }, "node_modules/commander": { "version": "2.9.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A==", "dev": true, "dependencies": { "graceful-readlink": ">= 1.0.0" @@ -1040,21 +1094,24 @@ } }, "node_modules/component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/concat-stream": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "integrity": "sha512-H6xsIBfQ94aESBG8jGHXQ7i5AEpy5ZeVaLDOisDICiTCKpqEfr34/KmTrspKQNoLKNu9gTkovlpQcUi630AKiQ==", "dev": true, "engines": [ "node >= 0.8" @@ -1068,13 +1125,13 @@ "node_modules/concat-stream/node_modules/process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==", "dev": true }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "2.0.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha512-TXcFfb63BQe1+ySzsHZI/5v1aJPCShfqvWJ64ayNImXMsN1Cd0YGk/wm8KB7/OeessgPc9QvS9Zou8QTkFzsLw==", "dev": true, "dependencies": { "core-util-is": "~1.0.0", @@ -1088,16 +1145,16 @@ "node_modules/concat-stream/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, "node_modules/configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.5.tgz", + "integrity": "sha512-nlOhI4+fdzoK5xmJ+NY+1gZK56bwEaWZr8fYuXohZ9Vkc1o3a4T/R3M+yE/w7x/ZVJ1zF8c+oaOvF0dztdUgmA==", "dev": true, "dependencies": { - "dot-prop": "^4.1.0", + "dot-prop": "^4.2.1", "graceful-fs": "^4.1.2", "make-dir": "^1.0.0", "unique-string": "^1.0.0", @@ -1109,55 +1166,58 @@ } }, "node_modules/console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "dependencies": { - "date-now": "^0.1.4" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true }, "node_modules/constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", "dev": true }, "node_modules/convert-source-map": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==", "dev": true }, "node_modules/copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "node_modules/create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dev": true, "dependencies": { "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "elliptic": "^6.5.3" } }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/create-error-class": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "integrity": "sha512-gYTKKexFO3kh200H1Nit76sRwRtOY32vQd3jpAQKpLtZqyNsSQNfI4N7o3eP2wUjV35pTWKRYqFUDBvUha/Pkw==", "dev": true, "dependencies": { "capture-stack-trace": "^1.0.0" @@ -1168,7 +1228,7 @@ }, "node_modules/create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "dependencies": { @@ -1181,7 +1241,7 @@ }, "node_modules/create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "dependencies": { @@ -1196,7 +1256,7 @@ "node_modules/cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dev": true, "dependencies": { "lru-cache": "^4.0.1", @@ -1229,22 +1289,22 @@ "node_modules/crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "integrity": "sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==", "dev": true, "engines": { "node": ">=4" } }, - "node_modules/date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "node_modules/dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", "dev": true }, "node_modules/debug": { "version": "2.6.8", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "integrity": "sha512-E22fsyWPt/lr4/UgQLt/pXqerGMDsanhbnmqIS3VAXuDi1v3IpiwXe2oncEIondHSBuPDWRoK/pMjlvi8FuOXQ==", "dev": true, "dependencies": { "ms": "2.0.0" @@ -1253,30 +1313,30 @@ "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "engines": { "node": ">=0.10" } }, "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", "dependencies": { "type-detect": "^4.0.0" }, "engines": { - "node": ">=0.12" + "node": ">=6" } }, "node_modules/deep-extend": { @@ -1289,12 +1349,49 @@ } }, "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "dependencies": { "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-property": { @@ -1310,76 +1407,32 @@ "node": ">=0.10.0" } }, - "node_modules/define-property/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-property/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/deps-sort": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", "dev": true, "dependencies": { "JSONStream": "^1.0.3", - "shasum": "^1.0.0", + "shasum-object": "^1.0.0", "subarg": "^1.0.0", "through2": "^2.0.0" }, @@ -1388,9 +1441,9 @@ } }, "node_modules/des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", "dev": true, "dependencies": { "inherits": "^2.0.1", @@ -1400,7 +1453,7 @@ "node_modules/detect-indent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", + "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", "dev": true, "engines": { "node": ">=4" @@ -1417,9 +1470,9 @@ } }, "node_modules/detective/node_modules/acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1429,16 +1482,16 @@ } }, "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha512-597ykPFhtJYaXqPq6fF7Vl1fXTKgPdLOntyxpmdzUOKiYGqK7zcnbplj5088+8qJnWdzXhyeau5iVr8HVo9dgg==", "engines": { "node": ">=0.3.1" } }, "node_modules/diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "dependencies": { @@ -1447,10 +1500,16 @@ "randombytes": "^2.0.0" } }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/domain-browser": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "integrity": "sha512-fJ5MoHxe69h3E4/lJtFRhcWwLb04bhIBSfvCEMS1YDH+/9yEZTqBHTSTgch8nCP5tE5k2gdQEjodUqJzy7qJ9Q==", "dev": true, "engines": { "node": ">=0.4", @@ -1458,9 +1517,9 @@ } }, "node_modules/dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "dependencies": { "is-obj": "^1.0.0" @@ -1472,55 +1531,61 @@ "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, "dependencies": { "readable-stream": "^2.0.2" } }, "node_modules/duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", + "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", "dev": true }, "node_modules/elegant-spinner": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", - "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", + "integrity": "sha512-B+ZM+RXvRqQaAmkMlO/oSe5nMUOaUnyfGYCEHoR8wrXsZR2mA0XVibsxV1bvTwxdRWah1PkQqso2EzhILGHtEQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", "dev": true, "dependencies": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">= 4" } }, "node_modules/enhanced-resolve": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", - "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "integrity": "sha512-ZaAux1rigq1e2nQrztHn4h2ugvpzZxs64qneNah+8Mh/K0CRqJFJc+UoXnUsq+1yX+DmQFPPdVqboKAJ89e0Iw==", "dev": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -1533,9 +1598,9 @@ } }, "node_modules/errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", "dev": true, "dependencies": { "prr": "~1.0.1" @@ -1553,18 +1618,39 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } }, "node_modules/events": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", "dev": true, "engines": { "node": ">=0.4.x" @@ -1583,7 +1669,7 @@ "node_modules/execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "integrity": "sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==", "dev": true, "dependencies": { "cross-spawn": "^5.0.1", @@ -1601,7 +1687,7 @@ "node_modules/exit-hook": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "integrity": "sha512-MsG3prOVw1WtLXAZbM3KiYtooKR1LvxHh3VHsVtIy0uiUu8usxgB/94DP2HxtD/661lLdB6yzQ09lGJSQr6nkg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1610,7 +1696,7 @@ "node_modules/expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "integrity": "sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA==", "dev": true, "dependencies": { "is-posix-bracket": "^0.1.0" @@ -1622,7 +1708,7 @@ "node_modules/expand-range": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "integrity": "sha512-AFASGfIlnIbkKPQwX1yHaDjFvh/1gyKJODme52V6IORh69uEYgZp0o9C+qsIGNVEiuuhQU0CSSl++Rlegg1qvA==", "dev": true, "dependencies": { "fill-range": "^2.1.0" @@ -1640,7 +1726,7 @@ "node_modules/extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", "dev": true, "dependencies": { "assign-symbols": "^1.0.0", @@ -1665,7 +1751,7 @@ "node_modules/extglob": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "integrity": "sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg==", "dev": true, "dependencies": { "is-extglob": "^1.0.0" @@ -1674,10 +1760,23 @@ "node": ">=0.10.0" } }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "node_modules/filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "integrity": "sha512-BTCqyBaWBTsauvnHiE8i562+EdJj+oUpkqWp2R1iCoR8f6oo8STRu3of7WJJ0TqWtxN50a5YFpzYK4Jj9esYfQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1702,7 +1801,7 @@ "node_modules/fill-range/node_modules/isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", "dev": true, "dependencies": { "isarray": "1.0.0" @@ -1714,7 +1813,7 @@ "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1723,7 +1822,7 @@ "node_modules/for-own": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "integrity": "sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw==", "dev": true, "dependencies": { "for-in": "^1.0.1" @@ -1733,13 +1832,13 @@ } }, "node_modules/form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", "dev": true, "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" }, "engines": { @@ -1749,7 +1848,7 @@ "node_modules/fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", "dev": true, "dependencies": { "map-cache": "^0.2.2" @@ -1761,17 +1860,14 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "bundleDependencies": [ - "node-pre-gyp" - ], - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2", "dev": true, "hasInstallScript": true, "optional": true, @@ -1779,699 +1875,21 @@ "darwin" ], "dependencies": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "bindings": "^1.5.0", + "nan": "^2.12.1" }, "engines": { - "node": ">=0.8.0" + "node": ">= 4.0" } }, - "node_modules/fsevents/node_modules/abbrev": { - "version": "1.1.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/ansi-regex": { - "version": "2.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/aproba": { - "version": "1.2.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/are-we-there-yet": { - "version": "1.1.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/fsevents/node_modules/balanced-match": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/brace-expansion": { - "version": "1.1.11", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/fsevents/node_modules/chownr": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/code-point-at": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/console-control-strings": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/core-util-is": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/fsevents/node_modules/deep-extend": { - "version": "0.5.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/delegates": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/detect-libc": { - "version": "1.0.3", - "dev": true, - "inBundle": true, - "license": "Apache-2.0", - "optional": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/fsevents/node_modules/fs-minipass": { - "version": "1.2.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^2.2.1" - } - }, - "node_modules/fsevents/node_modules/fs.realpath": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/gauge": { - "version": "2.7.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "node_modules/fsevents/node_modules/glob": { - "version": "7.1.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/fsevents/node_modules/has-unicode": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/iconv-lite": { - "version": "0.4.21", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/ignore-walk": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "minimatch": "^3.0.4" - } - }, - "node_modules/fsevents/node_modules/inflight": { - "version": "1.0.6", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/fsevents/node_modules/inherits": { - "version": "2.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/ini": { - "version": "1.3.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/fsevents/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/isarray": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/fsevents/node_modules/minimist": { - "version": "0.0.8", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/minipass": { - "version": "2.2.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "node_modules/fsevents/node_modules/minizlib": { - "version": "1.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "minipass": "^2.2.1" - } - }, - "node_modules/fsevents/node_modules/mkdirp": { - "version": "0.5.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "minimist": "0.0.8" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/fsevents/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/needle": { - "version": "2.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" - }, - "engines": { - "node": ">= 0.10.x" - } - }, - "node_modules/fsevents/node_modules/node-pre-gyp": { - "version": "0.10.0", - "dev": true, - "inBundle": true, - "license": "BSD-3-Clause", - "optional": true, - "dependencies": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/fsevents/node_modules/nopt": { - "version": "4.0.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/fsevents/node_modules/npm-bundled": { - "version": "1.0.3", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/npm-packlist": { - "version": "1.1.10", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "node_modules/fsevents/node_modules/npmlog": { - "version": "4.1.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "node_modules/fsevents/node_modules/number-is-nan": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/object-assign": { - "version": "4.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/once": { - "version": "1.4.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/fsevents/node_modules/os-homedir": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/os-tmpdir": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/osenv": { - "version": "0.1.5", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "node_modules/fsevents/node_modules/path-is-absolute": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/process-nextick-args": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/rc": { - "version": "1.2.7", - "dev": true, - "inBundle": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "optional": true, - "dependencies": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/fsevents/node_modules/rc/node_modules/minimist": { - "version": "1.2.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/readable-stream": { - "version": "2.3.6", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/fsevents/node_modules/rimraf": { - "version": "2.6.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "glob": "^7.0.5" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/fsevents/node_modules/safe-buffer": { - "version": "5.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/safer-buffer": { - "version": "2.1.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/sax": { - "version": "1.2.4", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/semver": { - "version": "5.5.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/fsevents/node_modules/set-blocking": { - "version": "2.0.0", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/signal-exit": { - "version": "3.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/string_decoder": { - "version": "1.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/fsevents/node_modules/string-width": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/strip-ansi": { - "version": "3.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/strip-json-comments": { - "version": "2.0.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fsevents/node_modules/tar": { - "version": "4.4.1", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/fsevents/node_modules/util-deprecate": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true - }, - "node_modules/fsevents/node_modules/wide-align": { - "version": "1.1.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true, - "dependencies": { - "string-width": "^1.0.2" - } - }, - "node_modules/fsevents/node_modules/wrappy": { - "version": "1.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, - "node_modules/fsevents/node_modules/yallist": { - "version": "3.0.2", - "dev": true, - "inBundle": true, - "license": "ISC", - "optional": true - }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-assigned-identifiers": { "version": "1.2.0", @@ -2480,17 +1898,36 @@ "dev": true }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "engines": { "node": "*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-stream": { "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", "dev": true, "engines": { "node": ">=4" @@ -2499,33 +1936,36 @@ "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-base": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "integrity": "sha512-ab1S1g1EbO7YzauaJLkgLp7DZVAqj9M/dvKlTt8DkXA2tiOIcSMrlVI2J1RZyB5iJVccEscjGn+kpOG9788MHA==", "dev": true, "dependencies": { "glob-parent": "^2.0.0", @@ -2538,7 +1978,7 @@ "node_modules/glob-parent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "integrity": "sha512-JDYOvfxio/t42HKdxkAYaCiBN7oYiuxykOxKxdaUW5Qn0zaYN3gRQWolrwdnf0shM9/EP0ebuuTmyoXNr1cC5w==", "dev": true, "dependencies": { "is-glob": "^2.0.0" @@ -2547,7 +1987,7 @@ "node_modules/global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", "dev": true, "dependencies": { "ini": "^1.3.4" @@ -2556,10 +1996,22 @@ "node": ">=4" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/got": { "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha512-Y/K3EDuiQN9rTZhBvPRWMLXIKdeD1Rj0nzunfoi0Yyn5WBEbzxXKU9Ub2X41oZBagVWOBU3MuDonFMgPWQFnwg==", "dev": true, "dependencies": { "create-error-class": "^3.0.0", @@ -2579,34 +2031,28 @@ } }, "node_modules/graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/graceful-readlink": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "integrity": "sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w==", "dev": true }, "node_modules/growl": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "integrity": "sha512-RTBwDHhNuOx4F0hqzItc/siXCasGfC4DeWcBamclWd+6jWtBaeB/SGbMkGf0eiQoW7ib8JpvOgnUsmgMHI3Mfw==", "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { "node": ">= 0.4.0" } @@ -2614,7 +2060,7 @@ "node_modules/has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", "dev": true, "dependencies": { "ansi-regex": "^2.0.0" @@ -2623,24 +2069,70 @@ "node": ">=0.10.0" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, "engines": { - "node": ">=4" + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, "node_modules/has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", "dev": true, "dependencies": { "get-value": "^2.0.6", @@ -2654,7 +2146,7 @@ "node_modules/has-values": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", "dev": true, "dependencies": { "is-number": "^3.0.0", @@ -2667,7 +2159,7 @@ "node_modules/has-values/node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -2679,7 +2171,7 @@ "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { "is-buffer": "^1.1.5" @@ -2691,7 +2183,7 @@ "node_modules/has-values/node_modules/kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", "dev": true, "dependencies": { "is-buffer": "^1.1.5" @@ -2703,7 +2195,7 @@ "node_modules/hash-base": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", "dev": true, "dependencies": { "inherits": "^2.0.1", @@ -2714,19 +2206,31 @@ } }, "node_modules/hash.js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "integrity": "sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==", "dev": true, "bin": { "he": "bin/he" @@ -2735,7 +2239,7 @@ "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "dev": true, "dependencies": { "hash.js": "^1.0.3", @@ -2744,9 +2248,9 @@ } }, "node_modules/homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dependencies": { "parse-passwd": "^1.0.0" }, @@ -2757,7 +2261,7 @@ "node_modules/htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", "dev": true, "engines": { "node": ">=0.10" @@ -2766,7 +2270,7 @@ "node_modules/http-proxy-agent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz", - "integrity": "sha1-zBzjjkU7+YSg93AtLdWcc9CBKEo=", + "integrity": "sha512-6YMslTZtuupu4irnNBi1bM6dG0UqHBHqObHQn3awavmNXe9CGkmw7KZ68EyAnJk3yBlLpbLwux5+bY1lneDFmg==", "dev": true, "dependencies": { "agent-base": "2", @@ -2777,13 +2281,13 @@ "node_modules/https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", "dev": true }, "node_modules/https-proxy-agent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", - "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", + "integrity": "sha512-OZhm7//JDnQthMVqlPAfkZyPO2fMhfHY6gY+jZcX8rLfFiGtHiIQrfD80WvCDHNMQ77Ak3r5CiPRDD2rNzo2OQ==", "dev": true, "dependencies": { "agent-base": "2", @@ -2792,15 +2296,29 @@ } }, "node_modules/ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", "dev": true, "engines": { "node": ">=4" @@ -2809,7 +2327,7 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" @@ -2818,13 +2336,13 @@ "node_modules/indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==", "dev": true }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", @@ -2832,34 +2350,30 @@ } }, "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "node_modules/ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue", - "dev": true, - "engines": { - "node": "*" - } + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.3.tgz", + "integrity": "sha512-1aVsPEsJWMJq/pdMU61CDlm1URcW702MTB4w9/zUjMus6H/Py8o7g68Pr9D4I6QluWGt/KdmswuRhaA05xVR1w==", "dev": true, "dependencies": { "source-map": "~0.5.3" } }, "node_modules/insert-module-globals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", - "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", + "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", "dev": true, "dependencies": { "acorn-node": "^1.5.2", @@ -2892,10 +2406,16 @@ "typedarray": "^0.0.6" } }, + "node_modules/insert-module-globals/node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true + }, "node_modules/interpret": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", - "integrity": "sha1-/s16GOfOXKar+5U+H4YhOknxYls=", + "integrity": "sha512-Vg6X07U0AOZb4HF6CWHa+jnJU8j71buKQ9Pc0C75qBXgvCYbxWBkGo4jnTS3O0MIc9FZtt0mB7h+uclojqdw1Q==", "dev": true }, "node_modules/invariant": { @@ -2910,7 +2430,7 @@ "node_modules/is-absolute": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", - "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "integrity": "sha512-7Kr05z5LkcOpoMvxHN1PC11WbPabdNFmMYYo0eZvWu3BfVS0T03yoqYDczoCBx17xqk2x1XAZrcKiFVL88jxlQ==", "dev": true, "dependencies": { "is-relative": "^0.2.1", @@ -2921,27 +2441,27 @@ } }, "node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "hasown": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", "dev": true, "dependencies": { "binary-extensions": "^1.0.0" @@ -2968,45 +2488,47 @@ "is-ci": "bin.js" } }, - "node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, "node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, "node_modules/is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "integrity": "sha512-9YclgOGtN/f8zx0Pr4FQYMdibBiTaH3sn52vjYip4ZSf6C4/6RfTEZ+MR4GvKhCxdPh21Bg42/WL55f6KSnKpg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3015,7 +2537,7 @@ "node_modules/is-equal-shallow": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "integrity": "sha512-0EygVC5qPvIyb+gSz7zdD5/AAoS6Qrx1e//6N4yv4oNm30kqvdmG66oZFWVlQHUWe5OjP08FuTw2IdT0EOTcYA==", "dev": true, "dependencies": { "is-primitive": "^2.0.0" @@ -3027,7 +2549,7 @@ "node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3036,7 +2558,7 @@ "node_modules/is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3045,7 +2567,7 @@ "node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, "engines": { "node": ">=4" @@ -3054,7 +2576,7 @@ "node_modules/is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", "dev": true, "dependencies": { "is-extglob": "^1.0.0" @@ -3066,7 +2588,7 @@ "node_modules/is-installed-globally": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "integrity": "sha512-ERNhMg+i/XgDwPIPF3u24qpajVreaiSuvpb1Uu0jugw7KKcxGyCX8cgp8P5fwTmAuXku6beDHHECdKArjlg7tw==", "dev": true, "dependencies": { "global-dirs": "^0.1.0", @@ -3079,7 +2601,7 @@ "node_modules/is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", + "integrity": "sha512-9r39FIr3d+KD9SbX0sfMsHzb5PP3uimOiwr3YupUaUFG4W0l1U57Rx3utpttV7qz5U3jmrO5auUa04LU9pyHsg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3088,7 +2610,7 @@ "node_modules/is-number": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "integrity": "sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -3099,8 +2621,8 @@ }, "node_modules/is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3109,7 +2631,7 @@ "node_modules/is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "integrity": "sha512-qhsCR/Esx4U4hg/9I19OVUAJkGWtjRYHMRgUMZE2TDdj+Ag+kttZanLupfddNyglzz50cUlmWzUaI37GDfNx/g==", "dev": true, "dependencies": { "path-is-inside": "^1.0.1" @@ -3121,7 +2643,7 @@ "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3142,7 +2664,7 @@ "node_modules/is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "integrity": "sha512-Yu68oeXJ7LeWNmZ3Zov/xg/oDBnBK2RNxwYY1ilNJX+tKKZqgPK+qOn/Gs9jEu66KDY9Netf5XLKNGzas/vPfQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3151,7 +2673,7 @@ "node_modules/is-primitive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "integrity": "sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3160,7 +2682,7 @@ "node_modules/is-redirect": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", + "integrity": "sha512-cr/SlUEe5zOGmzvj9bUyC4LVvkNVAXu4GytXLNMr1pny+a65MpQ9IJzFHD5vi7FyJgb4qt27+eS3TuQnqB+RQw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3169,7 +2691,7 @@ "node_modules/is-relative": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", - "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "integrity": "sha512-9AMzjRmLqcue629b4ezEVSK6kJsYJlUIhMcygmYORUgwUNJiavHcC3HkaGx0XYpyVKQSOqFbMEZmW42cY87sYw==", "dev": true, "dependencies": { "is-unc-path": "^0.1.1" @@ -3179,9 +2701,9 @@ } }, "node_modules/is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3190,7 +2712,7 @@ "node_modules/is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3199,7 +2721,7 @@ "node_modules/is-unc-path": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", - "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "integrity": "sha512-HhLc5VDMH4pu3oMtIuunz/DFQUIoR561kMME3U3Afhj8b7vH085vkIkemrz1kLXCEIuoMAmO3yVmafWdSbGW8w==", "dev": true, "dependencies": { "unc-path-regex": "^0.1.0" @@ -3211,13 +2733,13 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true }, "node_modules/is-windows": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "integrity": "sha512-n67eJYmXbniZB7RF4I/FTjK1s6RPOCTxhYrVYLRaCt3lF0mpWZPKr3T2LSZAqyjQsxR2qMmGYXXzK0YWwcPM1Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3226,19 +2748,19 @@ "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3253,7 +2775,7 @@ "node_modules/json-stable-stringify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "integrity": "sha512-nKtD/Qxm7tWdZqJoldEC7fF0S41v0mWbeaXG3637stOWfyGxTgWTYE2wtfKmjzpvxv2MA2xzxsXOIiwUpkX6Qw==", "dev": true, "dependencies": { "jsonify": "~0.0.0" @@ -3262,32 +2784,44 @@ "node_modules/json3": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "integrity": "sha512-I5YLeauH3rIaE99EE++UeH2M2gSYo8/2TqDac7oZEH6D/DSQ4Woa628Qrfj1X9/OY5Mk5VvIDQaKCDchXaKrmA==", "deprecated": "Please use the native JSON object instead of JSON 3", "dev": true }, "node_modules/json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, "bin": { "json5": "lib/cli.js" } }, - "node_modules/jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "node_modules/json5/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "engines": { - "node": "*" + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" @@ -3312,7 +2846,7 @@ "node_modules/jspm-config": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/jspm-config/-/jspm-config-0.3.4.tgz", - "integrity": "sha1-RMJpAuSujs4jZs7cn/FrEKXzkcY=", + "integrity": "sha512-NuRJyYXOKLNoSPy+jYVt7LUbGmss/wgw2OjmtWrLx5bFxlIQ7Bvbeeo3U2tNHhzbewOikU5YZYS7uYNY/u651w==", "dev": true, "dependencies": { "any-promise": "^1.3.0", @@ -3329,7 +2863,7 @@ "node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { "is-buffer": "^1.1.5" @@ -3339,26 +2873,19 @@ } }, "node_modules/labeled-stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", - "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", + "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", "dev": true, "dependencies": { "inherits": "^2.0.1", - "isarray": "^2.0.4", "stream-splicer": "^2.0.0" } }, - "node_modules/labeled-stream-splicer/node_modules/isarray": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", - "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", - "dev": true - }, "node_modules/latest-version": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "integrity": "sha512-Be1YRHWWlZaSsrz2U+VInk+tO0EwLIyV+23RhWLINJYwg/UIikxjlj3MhH37/6/EDCAusjajvMkMMUXRaMWl/w==", "dev": true, "dependencies": { "package-json": "^4.0.0" @@ -3370,30 +2897,33 @@ "node_modules/lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/listify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/listify/-/listify-1.0.0.tgz", - "integrity": "sha1-A8p7otFQ1CZ3c/dOV1WNEFPSvuM=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/listify/-/listify-1.0.3.tgz", + "integrity": "sha512-083swF7iH7bx8666zdzBColpgEuy46HjN3r1isD4zV6Ix7FuHfb/2/WVnl4CH8hjuoWeFF7P5KkKNXUnJCFEJg==", "dev": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, "dependencies": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" }, "engines": { "node": ">=4.0.0" @@ -3411,7 +2941,7 @@ "node_modules/lodash._baseassign": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "integrity": "sha512-t3N26QR2IdSN+gqSy9Ds9pBu/J1EAFEshKlUHpJG3rvyJOYgcELIxcIeKKfZk7sjOz11cFfzJRsyFry/JyabJQ==", "dev": true, "dependencies": { "lodash._basecopy": "^3.0.0", @@ -3421,31 +2951,31 @@ "node_modules/lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "integrity": "sha512-rFR6Vpm4HeCK1WPGvjZSJ+7yik8d8PVUdCJx5rT2pogG4Ve/2ZS7kfmO5l5T2o5V2mqlNIfSF5MZlr1+xOoYQQ==", "dev": true }, "node_modules/lodash._basecreate": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "integrity": "sha512-EDem6C9iQpn7fxnGdmhXmqYGjCkStmDXT4AeyB2Ph8WKbglg4aJZczNkQglj+zWXcOEEkViK8THuV2JvugW47g==", "dev": true }, "node_modules/lodash._getnative": { "version": "3.9.1", "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "integrity": "sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA==", "dev": true }, "node_modules/lodash._isiterateecall": { "version": "3.0.9", "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "integrity": "sha512-De+ZbrMu6eThFti/CSzhRvTKMgQToLxbij58LMfM8JnYDNSOjkjTCIaa8ixglOeGh2nyPlakbt5bJWJ7gvpYlQ==", "dev": true }, "node_modules/lodash.create": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "integrity": "sha512-IUfOYwDEbI8JbhW6psW+Ig01BOVK67dTSCUAbS58M0HBkPcAv/jHuxD+oJVP2tUCo3H9L6f/8GM6rxwY+oc7/w==", "dev": true, "dependencies": { "lodash._baseassign": "^3.0.0", @@ -3456,19 +2986,19 @@ "node_modules/lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "dev": true }, "node_modules/lodash.isarray": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "integrity": "sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ==", "dev": true }, "node_modules/lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "integrity": "sha512-CuBsapFjcubOGMn3VD+24HOAPxM79tH+V6ivJL3CHYjtrawauDJHUk//Yew9Hvc6e9rbCrURGk8z6PC+8WJBfQ==", "dev": true, "dependencies": { "lodash._getnative": "^3.0.0", @@ -3479,13 +3009,13 @@ "node_modules/lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==", "dev": true }, "node_modules/log-update": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", - "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", + "integrity": "sha512-4vSow8gbiGnwdDNrpy1dyNaXWKSCIPop0EHdE8GrnngHoJujM3QhvHUN/igsYCgPoHo7pFOezlJ61Hlln0KHyA==", "dev": true, "dependencies": { "ansi-escapes": "^1.0.0", @@ -3498,7 +3028,7 @@ "node_modules/longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "integrity": "sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3516,6 +3046,14 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -3526,9 +3064,9 @@ } }, "node_modules/lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "dependencies": { "pseudomap": "^1.0.2", @@ -3548,14 +3086,14 @@ } }, "node_modules/make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==" + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" }, "node_modules/make-error-cause": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", - "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", + "integrity": "sha512-4TO2Y3HkBnis4c0dxhAgD/jprySYLACf7nwN6V0HAHDx59g12WlRpUmFy1bRHamjGUEEBrEvCq6SUpsEE2lhUg==", "dev": true, "dependencies": { "make-error": "^1.2.0" @@ -3564,7 +3102,7 @@ "node_modules/map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3573,7 +3111,7 @@ "node_modules/map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", "dev": true, "dependencies": { "object-visit": "^1.0.0" @@ -3583,9 +3121,9 @@ } }, "node_modules/math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", "dev": true }, "node_modules/md5.js": { @@ -3602,7 +3140,7 @@ "node_modules/memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "integrity": "sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ==", "dev": true, "dependencies": { "errno": "^0.1.3", @@ -3612,7 +3150,7 @@ "node_modules/micromatch": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "integrity": "sha512-LnU2XFEk9xxSJ6rfgAry/ty5qwUTyHYOBU0g4R6tIw5ljwgGIBmiKhRWLw5NpMOnrgUNcDJ4WMp8rl3sYVHLNA==", "dev": true, "dependencies": { "arr-diff": "^2.0.0", @@ -3646,22 +3184,28 @@ "miller-rabin": "bin/miller-rabin" } }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { - "mime-db": "~1.36.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -3676,13 +3220,13 @@ "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", "dev": true }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -3692,15 +3236,14 @@ } }, "node_modules/minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==" }, "node_modules/mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "deprecated": "Critical bug fixed in v2.0.1, please upgrade to the latest version.", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "dependencies": { "for-in": "^1.0.2", @@ -3724,8 +3267,8 @@ }, "node_modules/mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "dependencies": { "minimist": "0.0.8" @@ -3734,11 +3277,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mkdirp/node_modules/minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, "node_modules/mocha": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", @@ -3767,19 +3305,10 @@ "npm": ">= 1.4.x" } }, - "node_modules/mocha/node_modules/diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/mocha/node_modules/glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "integrity": "sha512-mRyN/EsN2SyNhKWykF3eEGhDpeNplMWaW18Bmh76tnOqk5TbELAVwFAYOCmKVssOYFrYvvLMguiA+NXO3ZTuVA==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -3793,31 +3322,10 @@ "node": "*" } }, - "node_modules/mocha/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "dependencies": { - "has-flag": "^1.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/module-deps": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "integrity": "sha512-ze1e77tkYtlJI90RmlJJvTOGe91OAbtNQj34tg26GWlvdDc0dzmlxujTnh85S8feiTB3eBkKAOCD/v5p9v6wHg==", "dev": true, "dependencies": { "browser-resolve": "^1.7.0", @@ -3846,13 +3354,13 @@ "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==", "dev": true, "optional": true }, @@ -3881,7 +3389,7 @@ "node_modules/nanomatch/node_modules/arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3890,7 +3398,7 @@ "node_modules/nanomatch/node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3906,27 +3414,38 @@ } }, "node_modules/nanomatch/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/node-fetch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.2.0.tgz", - "integrity": "sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/node-libs-browser": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.7.0.tgz", - "integrity": "sha1-PicsCBnjCJNeJmdECNevDhSRuDs=", + "integrity": "sha512-V0EeBff5/nauAta4yGYMdn/CYXpn2KYcE8r6rwU9qJDXG6wMrBhtWVfoKWphSvsnX+mZk6DzaGSO+Yz/MGBAGQ==", "dev": true, "dependencies": { "assert": "^1.1.1", @@ -3956,8 +3475,8 @@ }, "node_modules/node-libs-browser/node_modules/browserify-aes": { "version": "0.4.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-0.4.0.tgz", - "integrity": "sha1-BnFJtmjfMcS1hTPgLQHoBthgjiw=", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-0.4.0.tgz", + "integrity": "sha512-hnvbMhZ/Ete34qnoKKyjikiYQfZbl89d5UZ29cz3EG13cv/8VRyM8Zs84luB/O7BRzC3qSng9dVovJ6jghcAvg==", "dev": true, "dependencies": { "inherits": "^2.0.1" @@ -3966,17 +3485,16 @@ "node_modules/node-libs-browser/node_modules/browserify-zlib": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==", "dev": true, "dependencies": { "pako": "~0.2.0" } }, "node_modules/node-libs-browser/node_modules/buffer": { - "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "deprecated": "This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", "dev": true, "dependencies": { "base64-js": "^1.0.2", @@ -3986,8 +3504,8 @@ }, "node_modules/node-libs-browser/node_modules/crypto-browserify": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz", - "integrity": "sha1-ufx1u0oO1h3PHNXa6W6zDJw+UGw=", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz", + "integrity": "sha512-9n5nGl6D8zb29Ui8Ji8pVdUIE3RUe6A9zQf2iLPjFKftnkkkJBCGb7TkYAFNjt9nfsvZTLL52CwxzS9Tw7Bujw==", "dev": true, "dependencies": { "browserify-aes": "0.4.0", @@ -4002,37 +3520,37 @@ "node_modules/node-libs-browser/node_modules/https-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "integrity": "sha512-EjDQFbgJr1vDD/175UJeSX3ncQ3+RUnCL5NkthQGHvF4VNHlzTy8ifJfTqz47qiPRqaFH58+CbuG3x51WuB1XQ==", "dev": true }, "node_modules/node-libs-browser/node_modules/os-browserify": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "integrity": "sha512-vHbnbzdqWJWvGOm7aOMDXHVUykPG0GdhfLkn5ZDmvbRI+wPj/XoB0/CRAkP9v28eZ7REIPPHJa+8ZEYixsWKmQ==", "dev": true }, "node_modules/node-libs-browser/node_modules/pako": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", "dev": true }, "node_modules/node-libs-browser/node_modules/path-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "integrity": "sha512-WA3pxi1olUQcsl82W576vkqhUSGp0uBtr/381pxx5WXLp3NC+AB99hUG3aGW7H0Kg9PFr1D8wv1iJeICe+9Mhw==", "dev": true }, "node_modules/node-libs-browser/node_modules/ripemd160": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", - "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", + "integrity": "sha512-JJsJ74Mw4sUDDisXGDnNNyN9xWmt5HcH6Kwvb/0m/IvTKjnLAtZfzeoLdpxk44AxQZki54oCCd+Kt0nPQ2AF2g==", "dev": true }, "node_modules/node-libs-browser/node_modules/sha.js": { "version": "2.2.6", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", - "integrity": "sha1-F93t3F9yL7ZlAWWIlUYZd4ZzFbo=", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", + "integrity": "sha512-GC+qN4sf/O6bDwz6CHaz8HVQfLbbNyIsXpTZLiD5c1badnWA63WVAH1msoCq+fXcV0dZ50jxTqKA8seu40845A==", "dev": true, "bin": { "sha.js": "bin.js" @@ -4041,13 +3559,13 @@ "node_modules/node-libs-browser/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, "node_modules/node-libs-browser/node_modules/timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", "dev": true, "dependencies": { "setimmediate": "^1.0.4" @@ -4059,13 +3577,13 @@ "node_modules/node-libs-browser/node_modules/tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==", "dev": true }, "node_modules/nopt": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", "dev": true, "dependencies": { "abbrev": "1" @@ -4080,7 +3598,7 @@ "node_modules/normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", "dev": true, "dependencies": { "remove-trailing-separator": "^1.0.1" @@ -4092,7 +3610,7 @@ "node_modules/npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", "dev": true, "dependencies": { "path-key": "^2.0.0" @@ -4104,7 +3622,7 @@ "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4113,7 +3631,7 @@ "node_modules/object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", "dev": true, "dependencies": { "copy-descriptor": "^0.1.0", @@ -4127,7 +3645,7 @@ "node_modules/object-copy/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { "is-descriptor": "^0.1.0" @@ -4136,10 +3654,41 @@ "node": ">=0.10.0" } }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", "dev": true, "dependencies": { "isobject": "^3.0.0" @@ -4148,10 +3697,28 @@ "node": ">=0.10.0" } }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "integrity": "sha512-UiAM5mhmIuKLsOvrL+B0U2d1hXHF3bFYWIuH1LMpuV2EJEHG1Ntz06PgLEHjm6VFd87NpH8rastvPoyv6UW2fA==", "dev": true, "dependencies": { "for-own": "^0.1.4", @@ -4164,7 +3731,7 @@ "node_modules/object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", "dev": true, "dependencies": { "isobject": "^3.0.1" @@ -4176,7 +3743,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -4184,8 +3751,8 @@ }, "node_modules/onetime": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha512-GZ+g4jayMqzCRMgB2sol7GiCLjKfS1PINkjmx8spcKce1LiVqcbQreXwqs2YAFXC6R03VIG28ZS31t8M866v6A==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4194,23 +3761,17 @@ "node_modules/optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", "dev": true, "dependencies": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" } }, - "node_modules/optimist/node_modules/minimist": { - "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, "node_modules/optimist/node_modules/wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", "dev": true, "engines": { "node": ">=0.4.0" @@ -4219,13 +3780,13 @@ "node_modules/os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", "dev": true }, "node_modules/p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, "engines": { "node": ">=4" @@ -4234,7 +3795,7 @@ "node_modules/package-json": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", + "integrity": "sha512-q/R5GrMek0vzgoomq6rm9OX+3PQve8sLwTirmK30YB3Cu0Bbt9OX9M/SIUnroN5BGJkzwGsFwDaRGD9EwBOlCA==", "dev": true, "dependencies": { "got": "^6.7.1", @@ -4247,37 +3808,41 @@ } }, "node_modules/pako": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "dev": true }, "node_modules/parents": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", "dev": true, "dependencies": { "path-platform": "~0.11.15" } }, "node_modules/parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", "dev": true, "dependencies": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "integrity": "sha512-FC5TeK0AwXzq3tUBFtH74naWkPQCEWs4K+xMxWZBlKDWu0bVHXGZa+KKqxKidd7xwhdZ19ZNuF2uO1M/r196HA==", "dev": true, "dependencies": { "glob-base": "^0.3.0", @@ -4292,7 +3857,7 @@ "node_modules/parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, "dependencies": { "error-ex": "^1.2.0" @@ -4304,7 +3869,7 @@ "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "engines": { "node": ">=0.10.0" } @@ -4312,7 +3877,7 @@ "node_modules/pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4327,7 +3892,7 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4336,45 +3901,45 @@ "node_modules/path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", "dev": true }, "node_modules/path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-platform": { "version": "0.11.15", "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "engines": { "node": "*" } }, "node_modules/pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dev": true, "dependencies": { "create-hash": "^1.1.2", @@ -4389,14 +3954,14 @@ }, "node_modules/pbkdf2-compat": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", - "integrity": "sha1-tuDI+plJTZTgURV1gCpZpcFC8og=", + "resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", + "integrity": "sha512-JYubxYhymODUUWVq9/Tmo9VQFZ8LyrD/pbXVpwmt1Npr2z29KZwp7+IBT3/PRjr1xpecX4W1EcbjFjp8nE3stQ==", "dev": true }, "node_modules/pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "engines": { "node": ">=4" @@ -4417,7 +3982,7 @@ "node_modules/popsicle-proxy-agent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/popsicle-proxy-agent/-/popsicle-proxy-agent-3.0.0.tgz", - "integrity": "sha1-uRM8VdlFdZq37mG3cRNkYg066tw=", + "integrity": "sha512-+0MhWUYhHbBWWIdKT4sO5cwgEMXPDskC3mGpgiCMLUdJt3mV3OuEFXubSjsiF4UDuiK6XNEst8oasZe9ZCUs8Q==", "deprecated": "Use `agent` option with `popsicle` directly", "dev": true, "dependencies": { @@ -4428,7 +3993,7 @@ "node_modules/popsicle-retry": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/popsicle-retry/-/popsicle-retry-3.2.1.tgz", - "integrity": "sha1-4G6GZTO0KnoSPrMwy+Y6fOvLoQw=", + "integrity": "sha512-AOKZJrHLXZMaMQtQcQW03tDZSgknkFOdoeAv5YuXuE1HqJH3D1oobHYmVIIjmdyBdHsqBnCX1inq2lRX1zocxQ==", "dev": true, "dependencies": { "any-promise": "^1.1.0", @@ -4438,19 +4003,19 @@ "node_modules/popsicle-rewrite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/popsicle-rewrite/-/popsicle-rewrite-1.0.0.tgz", - "integrity": "sha1-HdTo6pwxgjUfuCD4eTTZkvf7kAc=", + "integrity": "sha512-ySNEf50wDXcSr89LCsAb00dYItQ/Cnisb1aGleYFnc69pmSzFDB090pDvLwptgWWaokvFDiLCAjUWRWZyZku/w==", "dev": true }, "node_modules/popsicle-status": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/popsicle-status/-/popsicle-status-2.0.1.tgz", - "integrity": "sha1-jdcMT+fGlBCa3XhP/oDqysHnso0=", + "integrity": "sha512-jMzDnC9xEmyF624Fq4kfjWkFZuK4fOiCHKtr9MthCwpmQXRT+Eck1yEXbRwOEoS9qEWQGbi3THsBfC1Bzk7R/A==", "dev": true }, "node_modules/posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4459,7 +4024,7 @@ "node_modules/prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "integrity": "sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4468,7 +4033,7 @@ "node_modules/preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "integrity": "sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4477,40 +4042,40 @@ "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, "engines": { "node": ">= 0.6.0" } }, "node_modules/process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "node_modules/promise-finally": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/promise-finally/-/promise-finally-3.0.0.tgz", - "integrity": "sha1-3dXQ+JVDKxIGzrjaEnUGTRjnqiM=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/promise-finally/-/promise-finally-3.0.1.tgz", + "integrity": "sha512-hsF8r05ZnypT00IZTC71Ejiu9A7kyyVfHpdl3faasOHNJX62sNPfE8vDAz6P27RJ31i2O5ruhc6JV5xWR6GElQ==", "dev": true }, "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", "dev": true }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, "node_modules/psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, "node_modules/public-encrypt": { @@ -4527,35 +4092,46 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", "dev": true }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "node_modules/qs": { + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, "engines": { - "node": ">=0.4.x" + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/querystring-es3": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", "dev": true, "engines": { "node": ">=0.4.x" } }, "node_modules/randomatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", - "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, "dependencies": { "is-number": "^4.0.0", @@ -4576,18 +4152,18 @@ } }, "node_modules/randomatic/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { "safe-buffer": "^5.1.0" @@ -4618,19 +4194,28 @@ "rc": "cli.js" } }, + "node_modules/rc/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "integrity": "sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==", "dev": true, "dependencies": { "readable-stream": "^2.0.2" } }, "node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { "core-util-is": "~1.0.0", @@ -4642,6 +4227,12 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/readable-stream/node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -4668,7 +4259,7 @@ "node_modules/readdirp/node_modules/arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4677,7 +4268,7 @@ "node_modules/readdirp/node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4707,7 +4298,7 @@ "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -4719,7 +4310,7 @@ "node_modules/readdirp/node_modules/expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", "dev": true, "dependencies": { "debug": "^2.3.3", @@ -4737,7 +4328,7 @@ "node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { "is-descriptor": "^0.1.0" @@ -4749,7 +4340,7 @@ "node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -4758,75 +4349,17 @@ "node": ">=0.10.0" } }, - "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", "dev": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, "node_modules/readdirp/node_modules/extglob": { @@ -4851,7 +4384,7 @@ "node_modules/readdirp/node_modules/extglob/node_modules/define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, "dependencies": { "is-descriptor": "^1.0.0" @@ -4863,7 +4396,7 @@ "node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -4875,7 +4408,7 @@ "node_modules/readdirp/node_modules/fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", "dev": true, "dependencies": { "extend-shallow": "^2.0.1", @@ -4890,7 +4423,7 @@ "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -4899,48 +4432,10 @@ "node": ">=0.10.0" } }, - "node_modules/readdirp/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/readdirp/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/readdirp/node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -4952,7 +4447,7 @@ "node_modules/readdirp/node_modules/is-number/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", "dev": true, "dependencies": { "is-buffer": "^1.1.5" @@ -4962,9 +4457,9 @@ } }, "node_modules/readdirp/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5020,9 +4515,9 @@ } }, "node_modules/registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", "dev": true, "dependencies": { "rc": "^1.1.6", @@ -5032,7 +4527,7 @@ "node_modules/registry-url": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "integrity": "sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==", "dev": true, "dependencies": { "rc": "^1.0.1" @@ -5044,13 +4539,13 @@ "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", "dev": true }, "node_modules/repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5059,32 +4554,40 @@ "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", "dev": true, "engines": { "node": ">=0.10" } }, "node_modules/resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "path-parse": "^1.0.5" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", "deprecated": "https://github.com/lydell/resolve-url#deprecated", "dev": true }, "node_modules/restore-cursor": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "integrity": "sha512-reSjH4HuiFlxlaBaFCiS6O76ZGG2ygKoSlCsipKdaZuKSPx/+bt9mULkn4l0asVzbEfQQmXRg6Wp6gv6m0wElw==", "dev": true, "dependencies": { "exit-hook": "^1.0.0", @@ -5106,7 +4609,7 @@ "node_modules/right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "integrity": "sha512-yqINtL/G7vs2v+dFIZmFUDbnVyFUJFKd6gK22Kgo6R4jfJGFtisKyncWDDULgjfqf4ASQuIQyjJ7XZ+3aWpsAg==", "dev": true, "dependencies": { "align-text": "^0.1.1" @@ -5116,12 +4619,12 @@ } }, "node_modules/rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "dependencies": { - "glob": "^7.0.5" + "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" @@ -5138,24 +4641,38 @@ } }, "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", "dev": true, "dependencies": { "ret": "~0.1.10" } }, "node_modules/semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -5164,7 +4681,7 @@ "node_modules/semver-diff": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "integrity": "sha512-gL8F8L4ORwsS0+iQ34yCYv///jsOq0ZL7WP55d1HnJ32o7tyFYEFQZQA22mrLIacZdU6xecaBBZ+uEiffGNyXw==", "dev": true, "dependencies": { "semver": "^5.0.3" @@ -5173,11 +4690,27 @@ "node": ">=0.10.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "deprecated": "Critical bug fixed in v3.0.1, please upgrade to the latest version.", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "dependencies": { "extend-shallow": "^2.0.1", @@ -5192,7 +4725,7 @@ "node_modules/set-value/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -5204,12 +4737,12 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, "node_modules/sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "dependencies": { @@ -5222,18 +4755,27 @@ }, "node_modules/shasum": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha512-UTzHm/+AzKfO9RgPgRpDIuMSNie1ubXRaljjlhFMNGYoG7z+rm9AHLPMf70R7887xboDH9Q+5YQbWKObFHEAtw==", "dev": true, "dependencies": { "json-stable-stringify": "~0.0.0", "sha.js": "~2.4.4" } }, + "node_modules/shasum-object": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", + "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==", + "dev": true, + "dependencies": { + "fast-safe-stringify": "^2.0.7" + } + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "dependencies": { "shebang-regex": "^1.0.0" @@ -5245,35 +4787,64 @@ "node_modules/shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, "node_modules/simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/slice-ansi": { "version": "1.0.0", @@ -5323,7 +4894,7 @@ "node_modules/snapdragon-node/node_modules/define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", "dev": true, "dependencies": { "is-descriptor": "^1.0.0" @@ -5332,53 +4903,6 @@ "node": ">=0.10.0" } }, - "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", @@ -5394,7 +4918,7 @@ "node_modules/snapdragon/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { "is-descriptor": "^0.1.0" @@ -5406,7 +4930,7 @@ "node_modules/snapdragon/node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", "dev": true, "dependencies": { "is-extendable": "^0.1.0" @@ -5415,10 +4939,23 @@ "node": ">=0.10.0" } }, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "integrity": "sha512-vzn8aSqKgytVik0iwdBEi+zevbTYZogewTUM6dtpmGwEcdzbub/TX4bCzRhebDCRC3QzXgJsLRKB2V/Oof7HXg==", "dev": true, "dependencies": { "is-plain-obj": "^1.0.0" @@ -5430,25 +4967,25 @@ "node_modules/source-list-map": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", - "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", + "integrity": "sha512-cabwdhnSNf/tTDMh/DXZXlkeQLvdYT5xfGYBohqHG7wb3bBQrQlHQNWM9NWSOboXXK1zgwz6JzS5e4hZq9vxMw==", "dev": true }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, "dependencies": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -5464,9 +5001,9 @@ } }, "node_modules/source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, @@ -5485,7 +5022,7 @@ "node_modules/static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", "dev": true, "dependencies": { "define-property": "^0.2.5", @@ -5498,7 +5035,7 @@ "node_modules/static-extend/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", "dev": true, "dependencies": { "is-descriptor": "^0.1.0" @@ -5507,10 +5044,23 @@ "node": ">=0.10.0" } }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", "dev": true, "dependencies": { "inherits": "~2.0.1", @@ -5520,7 +5070,7 @@ "node_modules/stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", "dev": true, "dependencies": { "duplexer2": "~0.1.0", @@ -5541,9 +5091,9 @@ } }, "node_modules/stream-splicer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", - "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", + "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", "dev": true, "dependencies": { "inherits": "^2.0.1", @@ -5559,10 +5109,16 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/string-template": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", - "integrity": "sha1-np8iM9wA8hhxjsN5oopWc+zKi5Y=", + "integrity": "sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==", "dev": true }, "node_modules/string-width": { @@ -5579,9 +5135,9 @@ } }, "node_modules/string-width/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, "engines": { "node": ">=4" @@ -5590,7 +5146,7 @@ "node_modules/string-width/node_modules/strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "dev": true, "dependencies": { "ansi-regex": "^3.0.0" @@ -5600,21 +5156,21 @@ } }, "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "engines": { "node": ">=4" } @@ -5622,7 +5178,7 @@ "node_modules/strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5631,7 +5187,7 @@ "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "engines": { "node": ">=0.10.0" } @@ -5639,21 +5195,43 @@ "node_modules/subarg": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", "dev": true, "dependencies": { "minimist": "^1.1.0" } }, + "node_modules/subarg/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha512-F8dvPrZJtNzvDRX26eNXT4a7AecAvTGljmmnI39xEgSpbHKhQ7N0dO/NTxUExd0wuLHp4zbwYY7lvHq0aKpwrA==", + "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^1.0.0" }, "engines": { - "node": ">=4" + "node": ">=0.8.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/syntax-error": { @@ -5666,9 +5244,9 @@ } }, "node_modules/tapable": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", - "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.9.tgz", + "integrity": "sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A==", "dev": true, "engines": { "node": ">=0.6" @@ -5677,7 +5255,7 @@ "node_modules/term-size": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "integrity": "sha512-7dPUZQGy/+m3/wjVz3ZW5dobSoD/02NxJpoXUX0WIyjfVS3l0c+b/+9phIDFA7FHzkYtwtMFgeGZ/Y8jVTeqQQ==", "dev": true, "dependencies": { "execa": "^0.7.0" @@ -5687,9 +5265,9 @@ } }, "node_modules/thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "dependencies": { "any-promise": "^1.0.0" @@ -5703,24 +5281,24 @@ }, "node_modules/through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "dev": true }, "node_modules/through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "dependencies": { - "readable-stream": "^2.1.5", + "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, "node_modules/timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5729,7 +5307,7 @@ "node_modules/timers-browserify": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "integrity": "sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==", "dev": true, "dependencies": { "process": "~0.11.0" @@ -5741,13 +5319,13 @@ "node_modules/to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", "dev": true }, "node_modules/to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -5774,7 +5352,7 @@ "node_modules/to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", "dev": true, "dependencies": { "is-number": "^3.0.0", @@ -5787,7 +5365,7 @@ "node_modules/to-regex-range/node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", "dev": true, "dependencies": { "kind-of": "^3.0.2" @@ -5799,7 +5377,7 @@ "node_modules/touch": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", + "integrity": "sha512-7PLLVW4cfMVYXtMgX0ynJvyZDiupF2rzGzzf0yATTzgCgNK98DHjRSTm5zU1bFUtRjFdXNrEynn9+vhflVpC0A==", "dev": true, "dependencies": { "nopt": "~1.0.10" @@ -5812,18 +5390,33 @@ } }, "node_modules/tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "dependencies": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" }, "engines": { "node": ">=0.8" } }, + "node_modules/tough-cookie/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/ts-loader": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-2.3.7.tgz", @@ -5842,7 +5435,7 @@ "node_modules/ts-node": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-3.3.0.tgz", - "integrity": "sha1-wTxqMCTjC+EYDdUwOPwgkonUv2k=", + "integrity": "sha512-S87fS5QGinpnvi6I1aW8PnEEwJbkQsr2o+9C3qdAkmaYQn33PKVkXowI2/wggr8FzAwKhvCaomB0EX60LW3/Fw==", "dependencies": { "arrify": "^1.0.0", "chalk": "^2.0.0", @@ -5863,10 +5456,18 @@ "node": ">=4.2.0" } }, + "node_modules/ts-node/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tsconfig": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-6.0.0.tgz", - "integrity": "sha1-aw6DdgA9evGGT434+J3QBZ/80DI=", + "integrity": "sha512-n3i8c4BOozElBHYMVkEyF9AudHRvvq6NTc6sVRVmLBQM2A02JKjLoICxRtKkoGu3gROOnRZ85KxiTAcmhWgR0w==", "dependencies": { "strip-bom": "^3.0.0", "strip-json-comments": "^2.0.0" @@ -5896,7 +5497,7 @@ "node_modules/tsify/node_modules/strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "dependencies": { "is-utf8": "^0.2.0" @@ -5908,7 +5509,7 @@ "node_modules/tsify/node_modules/tsconfig": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-5.0.3.tgz", - "integrity": "sha1-X0J45wGACWeo/Dg/0ZZIh48qbjo=", + "integrity": "sha512-Cq65A3kVp6BbsUgg9DRHafaGmbMb9EhAc7fjWvudNWKjkbWrt43FnrtZt6awshH1R0ocfF2Z0uxock3lVqEgOg==", "dev": true, "dependencies": { "any-promise": "^1.3.0", @@ -5932,28 +5533,31 @@ } }, "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.7.tgz", + "integrity": "sha512-ueeb9YybpjhivjbHP2LdFDAjbS948fGEPj+ACAMs4xCMmh72OCOMQWBQKlaN4ZNQ04yfLSDLSx1tGRIoWimObQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/typings": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/typings/-/typings-2.1.1.tgz", - "integrity": "sha1-usxp0lWXCkeOCfdsf2iZddU1p4o=", + "integrity": "sha512-ABFg64N1Vb0qHSIyks4kq1P02bWuwRmvCoD6d03Gmha1B5tl4uuz4w/bCCITW1rzC0+IYRGZ5PI0e2G7kqXGfw==", "deprecated": "Typings is deprecated in favor of NPM @types -- see README for more information", "dev": true, "dependencies": { @@ -5980,7 +5584,7 @@ "node_modules/typings-core": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/typings-core/-/typings-core-2.3.3.tgz", - "integrity": "sha1-CexUzVsR3V8e8vwKsx03ACyita0=", + "integrity": "sha512-FI/cwKyu9t84BXf83aIhGYzitfhEdo02l09xZaqdwQo9Xj4RjWpS1m+m7vljz373zcx6rudgVuESuo/dY1N4cw==", "dev": true, "dependencies": { "array-uniq": "^1.0.2", @@ -6030,10 +5634,19 @@ "node": ">=4.2.0" } }, + "node_modules/typings/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/typings/node_modules/ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6041,8 +5654,8 @@ }, "node_modules/typings/node_modules/chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "dependencies": { "ansi-styles": "^2.2.1", @@ -6055,10 +5668,31 @@ "node": ">=0.10.0" } }, + "node_modules/typings/node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typings/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/typings/node_modules/supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, "engines": { "node": ">=0.8.0" @@ -6066,8 +5700,8 @@ }, "node_modules/uglify-js": { "version": "2.7.5", - "resolved": "http://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz", - "integrity": "sha1-RhLAx7qu4rp8SH3kkErhIgefLKg=", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz", + "integrity": "sha512-RvbIYn4DIadCg1MV7YP7OrpxnVrtEieZzbK0KSQvwWGAHojqWJxInkQhmtYGRo9PTwwkJkljIgzMyA1VitEc4Q==", "dev": true, "dependencies": { "async": "~0.2.6", @@ -6084,14 +5718,14 @@ }, "node_modules/uglify-js/node_modules/async": { "version": "0.2.10", - "resolved": "http://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==", "dev": true }, "node_modules/uglify-to-browserify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "integrity": "sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q==", "dev": true }, "node_modules/umd": { @@ -6106,19 +5740,20 @@ "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/undeclared-identifiers": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", - "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", + "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", "dev": true, "dependencies": { "acorn-node": "^1.3.0", + "dash-ast": "^1.0.0", "get-assigned-identifiers": "^1.2.0", "simple-concat": "^1.0.0", "xtend": "^4.0.1" @@ -6128,43 +5763,15 @@ } }, "node_modules/union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "dependencies": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "deprecated": "Critical bug fixed in v3.0.1, please upgrade to the latest version.", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" + "set-value": "^2.0.1" }, "engines": { "node": ">=0.10.0" @@ -6173,7 +5780,7 @@ "node_modules/unique-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "integrity": "sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==", "dev": true, "dependencies": { "crypto-random-string": "^1.0.0" @@ -6185,7 +5792,7 @@ "node_modules/unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", "dev": true, "dependencies": { "has-value": "^0.3.1", @@ -6198,7 +5805,7 @@ "node_modules/unset-value/node_modules/has-value": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", "dev": true, "dependencies": { "get-value": "^2.0.3", @@ -6212,7 +5819,7 @@ "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", "dev": true, "dependencies": { "isarray": "1.0.0" @@ -6224,7 +5831,7 @@ "node_modules/unset-value/node_modules/has-values": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6233,7 +5840,7 @@ "node_modules/unzip-response": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", + "integrity": "sha512-N0XH6lqDtFH84JxptQoZYmloF4nzrQqqrAymNj+/gW60AO2AZgOcf4O/nUXJcYfyQkqvMo9lSupBZmmgvuVXlw==", "dev": true, "engines": { "node": ">=4" @@ -6263,24 +5870,24 @@ "node_modules/urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", "deprecated": "Please see https://github.com/lydell/urix#deprecated", "dev": true }, "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", + "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", "dev": true, "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" + "punycode": "^1.4.1", + "qs": "^6.11.2" } }, "node_modules/url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "integrity": "sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA==", "dev": true, "dependencies": { "prepend-http": "^1.0.1" @@ -6289,12 +5896,6 @@ "node": ">=0.10.0" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, "node_modules/use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", @@ -6316,24 +5917,30 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", "dev": true }, "node_modules/v8flags": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.1.tgz", - "integrity": "sha512-iw/1ViSEaff8NJ3HLyEjawk/8hjJib3E7pvG4pddVXfUg1983s3VGsiClDjhK64MQVDGqc1Q8r18S4VKQZS9EQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "dependencies": { "homedir-polyfill": "^1.0.1" }, "engines": { - "node": ">= 0.10.0" + "node": ">= 0.10" } }, "node_modules/vm-browserify": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "integrity": "sha512-NyZNR3WDah+NPkjh/YmhuWSsT4a0mF0BJYgUmvrJ70zxjTXh5Y2Asobxlh0Nfs0PCFB5FVpRJft7NozAWFMwLQ==", "dev": true, "dependencies": { "indexof": "0.0.1" @@ -6342,7 +5949,7 @@ "node_modules/watchpack": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-0.2.9.tgz", - "integrity": "sha1-Yuqkq15bo1/fwBgnVibjwPXj+ws=", + "integrity": "sha512-hmLWdxNfe0Ou1xaRj+ublbOYUaZJfVz1VuHQfERLVlUrLS21gUaGa2gWRl8L5Ej1aUS3KxFN+1qoWK4kZLMvKw==", "dev": true, "dependencies": { "async": "^0.9.0", @@ -6352,23 +5959,29 @@ }, "node_modules/watchpack/node_modules/async": { "version": "0.9.2", - "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha512-l6ToIJIotphWahxxHyzK9bnLR6kM4jJIIgLShZeqLY7iboHoGkdgFl7W2/Ivi4SkMJYGKqW8vSuk0uKUj6qsSw==", "dev": true }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "dependencies": { "defaults": "^1.0.3" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, "node_modules/webpack": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-1.15.0.tgz", - "integrity": "sha1-T/MfU9sDM55VFkqdRo7gMklo/pg=", + "integrity": "sha512-+8bxNSHMZCWBa6hi++2A2pw9GmLUWY6lII+aIXlgUPpB+ClNrUKgP8hx0w+hxjWhX81hclUYPGFg+7NxgLTUYQ==", "dev": true, "dependencies": { "acorn": "^3.0.0", @@ -6397,7 +6010,7 @@ "node_modules/webpack-core": { "version": "0.6.9", "resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.9.tgz", - "integrity": "sha1-/FcViMhVjad76e+23r3Fo7FyvcI=", + "integrity": "sha512-P6ZUGXn5buTEZyTStCHHLwtWGKSm/jA629Zgp4pcHSsy60CCsT9MaHDxNIPL+GGJ2KwOgI6ORwQtHcrYHAt2UQ==", "dev": true, "dependencies": { "source-list-map": "~0.1.7", @@ -6410,7 +6023,7 @@ "node_modules/webpack-core/node_modules/source-map": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "integrity": "sha512-Y8nIfcb1s/7DcobUz1yOO1GSp7gyL+D9zLHDehT7iRESqGSxjJ448Sg7rvfgsRJCnKLdSl11uGf0s9X80cH0/A==", "dev": true, "dependencies": { "amdefine": ">=0.0.4" @@ -6421,8 +6034,8 @@ }, "node_modules/webpack/node_modules/acorn": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha512-OLUyIIZ7mF5oaAUT1w0TFqQS81q3saT46x8t7ukpPjMNk+nbs4ZHhs7ToV8EWnLYLepjETXd4XaCE4uxkMeqUw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -6431,10 +6044,28 @@ "node": ">=0.4.0" } }, + "node_modules/webpack/node_modules/big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/webpack/node_modules/emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/webpack/node_modules/enhanced-resolve": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", - "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", + "integrity": "sha512-kxpoMgrdtkXZ5h0SeraBS1iRntpTpQ3R8ussdb38+UAFnMGX5DDyJXePm+OCHOcoXvHDw7mc2erbJBpDnl7TPw==", "dev": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -6448,22 +6079,22 @@ "node_modules/webpack/node_modules/enhanced-resolve/node_modules/memory-fs": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", - "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", + "integrity": "sha512-+y4mDxU4rvXXu5UDSGCGNiesFmwCHuefGMoPCO1WYucNYj7DsLqrFaa2fXVI0H+NNiPTwwzKwspn9yTZqUGqng==", "dev": true }, - "node_modules/webpack/node_modules/has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "node_modules/webpack/node_modules/json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "bin": { + "json5": "lib/cli.js" } }, "node_modules/webpack/node_modules/loader-utils": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==", "dev": true, "dependencies": { "big.js": "^3.1.3", @@ -6475,34 +6106,32 @@ "node_modules/webpack/node_modules/memory-fs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", - "integrity": "sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA=", + "integrity": "sha512-QTNXnl79X97kZ9jJk/meJrtDuvgvRakX5LU7HZW1L7MsXHuSTwoMIzN9tOLLH3Xfsj/gbsSqX/ovnsqz246zKQ==", "dev": true, "dependencies": { "errno": "^0.1.3", "readable-stream": "^2.0.1" } }, - "node_modules/webpack/node_modules/supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "dependencies": { - "has-flag": "^1.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/webpack/node_modules/tapable": { "version": "0.1.10", - "resolved": "http://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", - "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", + "integrity": "sha512-jX8Et4hHg57mug1/079yitEKWGB3LCwoxByLsNim89LABq8NqgiX+6iYVOsq0vX8uJHkU+DZ5fnq95f800bEsQ==", "dev": true, "engines": { "node": ">=0.6" } }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -6516,9 +6145,9 @@ } }, "node_modules/widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "dev": true, "dependencies": { "string-width": "^2.1.1" @@ -6530,7 +6159,7 @@ "node_modules/window-size": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "integrity": "sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==", "dev": true, "engines": { "node": ">= 0.8.0" @@ -6539,19 +6168,19 @@ "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, "dependencies": { "graceful-fs": "^4.1.11", @@ -6562,16 +6191,16 @@ "node_modules/xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "integrity": "sha512-1Dly4xqlulvPD3fZUQJLY+FUIeqN3N2MM3uqe4rCJftAvOjFa3jFGfctOgluGx4ahPbUCsZkmJILiP0Vi4T6lQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, "engines": { "node": ">=0.4" @@ -6580,13 +6209,13 @@ "node_modules/yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", "dev": true }, "node_modules/yargs": { "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha512-QFzUah88GAGy9lyDKGBqZdkYApt63rCXYBGYnEP4xDJPXNqXXnBDACnbrXnViV6jRSqAePwrATi2i8mfYm4L1A==", "dev": true, "dependencies": { "camelcase": "^1.0.2", @@ -6598,7 +6227,7 @@ "node_modules/yargs/node_modules/camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6607,7 +6236,7 @@ "node_modules/yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "integrity": "sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==", "engines": { "node": ">=4" } @@ -6615,5473 +6244,7 @@ "node_modules/zip-object": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/zip-object/-/zip-object-0.1.0.tgz", - "integrity": "sha1-waDaBMiMg3dW4khoCgP/kC7D9To=", - "dev": true - } - }, - "dependencies": { - "@openapitools/typescript-fetch-petstore": { - "version": "file:../../builds/with-npm-version", - "requires": { - "typescript": "^4.0" - } - }, - "@swagger/typescript-fetch-petstore": { - "version": "file:../../builds/with-npm-version", - "requires": { - "typescript": "^4.0" - } - }, - "@types/chai": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", - "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", - "dev": true - }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/isomorphic-fetch": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", - "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", - "dev": true - }, - "@types/mocha": { - "version": "2.2.48", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", - "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", - "dev": true - }, - "@types/node": { - "version": "12.20.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz", - "integrity": "sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==", - "dev": true - }, - "@types/node-fetch": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha512-XroxUzLpKuL+CVkQqXlffRkEPi4Gh3Oui/mWyS7ztKiyqVxiU+h3imCW5I2NQmde5jK+3q++36/Q96cyRWsweg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", - "dev": true - }, - "acorn-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.0.tgz", - "integrity": "sha512-ZsysjEh+Y3i14f7YXCAKJy99RXbd56wHKYBzN4FlFtICIZyFpYwK6OwNJhcz8A/FMtxoUZkJofH1v9KIfNgWmw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1", - "xtend": "^4.0.1" - } - }, - "acorn-walk": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.0.tgz", - "integrity": "sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg==", - "dev": true - }, - "agent-base": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", - "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", - "dev": true, - "requires": { - "extend": "~3.0.0", - "semver": "~5.0.1" - }, - "dependencies": { - "semver": { - "version": "5.0.3", - "resolved": "http://registry.npmjs.org/semver/-/semver-5.0.3.tgz", - "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", - "dev": true - } - } - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "dev": true, - "requires": { - "string-width": "^2.0.0" - } - }, - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true - }, - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "requires": { - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async": { - "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", - "dev": true - }, - "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", - "dev": true - }, - "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "dev": true, - "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dev": true, - "requires": { - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "JSONStream": "^1.0.3", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - } - }, - "browser-resolve": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", - "dev": true, - "requires": { - "resolve": "1.1.7" - }, - "dependencies": { - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - } - } - }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "browserify": { - "version": "14.5.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.5.0.tgz", - "integrity": "sha512-gKfOsNQv/toWz+60nSPfYzuwSEdzvV2WdxrVPUbPD/qui44rAkB3t3muNtmmGYHqrG56FGwX9SUEQmzNLAeS7g==", - "dev": true, - "requires": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^1.11.0", - "browserify-zlib": "~0.2.0", - "buffer": "^5.0.2", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.5.1", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.0", - "domain-browser": "~1.1.0", - "duplexer2": "~0.1.2", - "events": "~1.1.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.0.0", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "module-deps": "^4.0.8", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "~0.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^2.0.0", - "stream-http": "^2.0.0", - "string_decoder": "~1.0.0", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "~0.0.0", - "url": "~0.11.0", - "util": "~0.10.1", - "vm-browserify": "~0.0.1", - "xtend": "^4.0.0" - } - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "cached-path-relative": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", - "dev": true - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" - } - }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, - "ci-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", - "dev": true - }, - "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", - "dev": true, - "requires": { - "restore-cursor": "^1.0.1" - } - }, - "cli-truncate": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-1.1.0.tgz", - "integrity": "sha512-bAtZo0u82gCfaAGfSNxUdTI9mNyza7D8w4CVCcaOsy7sgwDzvx6ekr6cuWJqY3UGzgnQ1+4wgENup5eIhgxEYA==", - "dev": true, - "requires": { - "slice-ansi": "^1.0.0", - "string-width": "^2.0.0" - } - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - } - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "columnify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", - "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", - "dev": true, - "requires": { - "strip-ansi": "^3.0.0", - "wcwidth": "^1.0.0" - } - }, - "combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "requires": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.9.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "~2.0.0", - "typedarray": "~0.0.5" - }, - "dependencies": { - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "convert-source-map": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "dev": true, - "requires": { - "capture-stack-trace": "^1.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "dev": true - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "deps-sort": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "shasum": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - } - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - }, - "detective": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", - "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", - "dev": true, - "requires": { - "acorn": "^5.2.1", - "defined": "^1.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - } - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", - "dev": true - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "elegant-spinner": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", - "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", - "dev": true - }, - "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "enhanced-resolve": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", - "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "object-assign": "^4.0.1", - "tapable": "^0.2.7" - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "events": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" - }, - "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "dev": true, - "requires": { - "ini": "^1.3.4" - } - }, - "got": { - "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "dev": true, - "requires": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", - "dev": true - }, - "http-proxy-agent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-1.0.0.tgz", - "integrity": "sha1-zBzjjkU7+YSg93AtLdWcc9CBKEo=", - "dev": true, - "requires": { - "agent-base": "2", - "debug": "2", - "extend": "3" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "https-proxy-agent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", - "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", - "dev": true, - "requires": { - "agent-base": "2", - "debug": "2", - "extend": "3" - } - }, - "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "requires": { - "source-map": "~0.5.3" - } - }, - "insert-module-globals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", - "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", - "dev": true, - "requires": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "dependencies": { - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - } - } - }, - "interpret": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", - "integrity": "sha1-/s16GOfOXKar+5U+H4YhOknxYls=", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "is-absolute": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", - "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", - "dev": true, - "requires": { - "is-relative": "^0.2.1", - "is-windows": "^0.2.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "dev": true, - "requires": { - "ci-info": "^1.5.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "dev": true, - "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - } - }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", - "dev": true - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "dev": true - }, - "is-relative": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", - "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", - "dev": true, - "requires": { - "is-unc-path": "^0.1.1" - } - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-unc-path": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", - "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.0" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "json-stable-stringify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } - }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, - "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "jspm-config": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/jspm-config/-/jspm-config-0.3.4.tgz", - "integrity": "sha1-RMJpAuSujs4jZs7cn/FrEKXzkcY=", - "dev": true, - "requires": { - "any-promise": "^1.3.0", - "graceful-fs": "^4.1.4", - "make-error-cause": "^1.2.1", - "object.pick": "^1.1.2", - "parse-json": "^2.2.0", - "strip-bom": "^3.0.0", - "thenify": "^3.2.0", - "throat": "^3.0.0", - "xtend": "^4.0.1" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "labeled-stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", - "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "isarray": "^2.0.4", - "stream-splicer": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", - "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", - "dev": true - } - } - }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "dev": true, - "requires": { - "package-json": "^4.0.0" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true - }, - "listify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/listify/-/listify-1.0.0.tgz", - "integrity": "sha1-A8p7otFQ1CZ3c/dOV1WNEFPSvuM=", - "dev": true - }, - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" - } - }, - "lockfile": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", - "dev": true, - "requires": { - "signal-exit": "^3.0.2" - } - }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true, - "requires": { - "lodash._basecopy": "^3.0.0", - "lodash.keys": "^3.0.0" - } - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true, - "requires": { - "lodash._baseassign": "^3.0.0", - "lodash._basecreate": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - } - }, - "lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, - "log-update": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", - "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", - "dev": true, - "requires": { - "ansi-escapes": "^1.0.0", - "cli-cursor": "^1.0.2" - } - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==" - }, - "make-error-cause": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/make-error-cause/-/make-error-cause-1.2.2.tgz", - "integrity": "sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0=", - "dev": true, - "requires": { - "make-error": "^1.2.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", - "dev": true - }, - "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", - "dev": true, - "requires": { - "mime-db": "~1.36.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } - }, - "mocha": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", - "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.8", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "he": "1.1.1", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - }, - "dependencies": { - "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true - }, - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "module-deps": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", - "dev": true, - "requires": { - "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.5.0", - "defined": "^1.0.0", - "detective": "^4.0.0", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "JSONStream": "^1.0.3", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.3", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "node-fetch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.2.0.tgz", - "integrity": "sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA==", - "dev": true - }, - "node-libs-browser": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.7.0.tgz", - "integrity": "sha1-PicsCBnjCJNeJmdECNevDhSRuDs=", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.1.4", - "buffer": "^4.9.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "3.3.0", - "domain-browser": "^1.1.1", - "events": "^1.0.0", - "https-browserify": "0.0.1", - "os-browserify": "^0.2.0", - "path-browserify": "0.0.0", - "process": "^0.11.0", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.0.5", - "stream-browserify": "^2.0.1", - "stream-http": "^2.3.1", - "string_decoder": "^0.10.25", - "timers-browserify": "^2.0.2", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.10.3", - "vm-browserify": "0.0.4" - }, - "dependencies": { - "browserify-aes": { - "version": "0.4.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-0.4.0.tgz", - "integrity": "sha1-BnFJtmjfMcS1hTPgLQHoBthgjiw=", - "dev": true, - "requires": { - "inherits": "^2.0.1" - } - }, - "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", - "dev": true, - "requires": { - "pako": "~0.2.0" - } - }, - "buffer": { - "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "crypto-browserify": { - "version": "3.3.0", - "resolved": "http://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz", - "integrity": "sha1-ufx1u0oO1h3PHNXa6W6zDJw+UGw=", - "dev": true, - "requires": { - "browserify-aes": "0.4.0", - "pbkdf2-compat": "2.0.1", - "ripemd160": "0.2.0", - "sha.js": "2.2.6" - } - }, - "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", - "dev": true - }, - "os-browserify": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", - "dev": true - }, - "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", - "dev": true - }, - "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", - "dev": true - }, - "ripemd160": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", - "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", - "dev": true - }, - "sha.js": { - "version": "2.2.6", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", - "integrity": "sha1-F93t3F9yL7ZlAWWIlUYZd4ZzFbo=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - } - } - }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "dev": true, - "requires": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" - } - }, - "pako": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "dev": true - }, - "parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", - "dev": true, - "requires": { - "path-platform": "~0.11.15" - } - }, - "parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", - "dev": true - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "pbkdf2-compat": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", - "integrity": "sha1-tuDI+plJTZTgURV1gCpZpcFC8og=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "popsicle": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/popsicle/-/popsicle-9.2.0.tgz", - "integrity": "sha512-petRj39w05GvH1WKuGFmzxR9+k+R9E7zX5XWTFee7P/qf88hMuLT7aAO/RsmldpQMtJsWQISkTQlfMRECKlxhw==", - "dev": true, - "requires": { - "concat-stream": "^1.4.7", - "form-data": "^2.0.0", - "make-error-cause": "^1.2.1", - "tough-cookie": "^2.0.0" - } - }, - "popsicle-proxy-agent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/popsicle-proxy-agent/-/popsicle-proxy-agent-3.0.0.tgz", - "integrity": "sha1-uRM8VdlFdZq37mG3cRNkYg066tw=", - "dev": true, - "requires": { - "http-proxy-agent": "^1.0.0", - "https-proxy-agent": "^1.0.0" - } - }, - "popsicle-retry": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/popsicle-retry/-/popsicle-retry-3.2.1.tgz", - "integrity": "sha1-4G6GZTO0KnoSPrMwy+Y6fOvLoQw=", - "dev": true, - "requires": { - "any-promise": "^1.1.0", - "xtend": "^4.0.1" - } - }, - "popsicle-rewrite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/popsicle-rewrite/-/popsicle-rewrite-1.0.0.tgz", - "integrity": "sha1-HdTo6pwxgjUfuCD4eTTZkvf7kAc=", - "dev": true - }, - "popsicle-status": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/popsicle-status/-/popsicle-status-2.0.1.tgz", - "integrity": "sha1-jdcMT+fGlBCa3XhP/oDqysHnso0=", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "promise-finally": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/promise-finally/-/promise-finally-3.0.0.tgz", - "integrity": "sha1-3dXQ+JVDKxIGzrjaEnUGTRjnqiM=", - "dev": true - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randomatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", - "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "dev": true, - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "dev": true, - "requires": { - "rc": "^1.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", - "dev": true, - "requires": { - "exit-hook": "^1.0.0", - "onetime": "^1.0.0" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "requires": { - "align-text": "^0.1.1" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true - }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "dev": true, - "requires": { - "semver": "^5.0.3" - } - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shasum": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", - "dev": true, - "requires": { - "json-stable-stringify": "~0.0.0", - "sha.js": "~2.4.4" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" - } - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "sort-keys": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", - "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "source-list-map": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", - "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "requires": { - "source-map": "^0.5.6" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", - "dev": true, - "requires": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-splicer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", - "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-template": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", - "integrity": "sha1-np8iM9wA8hhxjsN5oopWc+zKi5Y=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", - "dev": true, - "requires": { - "minimist": "^1.1.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "requires": { - "acorn-node": "^1.2.0" - } - }, - "tapable": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", - "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", - "dev": true - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - } - }, - "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", - "dev": true, - "requires": { - "any-promise": "^1.0.0" - } - }, - "throat": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-3.2.0.tgz", - "integrity": "sha512-/EY8VpvlqJ+sFtLPeOgc8Pl7kQVOWv0woD87KTXVHPIAE842FGT+rokxIhe8xIUP1cfgrkt0as0vDLjDiMtr8w==", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - } - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true - }, - "timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", - "dev": true, - "requires": { - "process": "~0.11.0" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - } - } - }, - "touch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", - "dev": true, - "requires": { - "nopt": "~1.0.10" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, - "ts-loader": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-2.3.7.tgz", - "integrity": "sha512-8t3bu2FcEkXb+D4L+Cn8qiK2E2C6Ms4/GQChvz6IMbVurcFHLXrhW4EMtfaol1a1ASQACZGDUGit4NHnX9g7hQ==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "enhanced-resolve": "^3.0.0", - "loader-utils": "^1.0.2", - "semver": "^5.0.1" - } - }, - "ts-node": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-3.3.0.tgz", - "integrity": "sha1-wTxqMCTjC+EYDdUwOPwgkonUv2k=", - "requires": { - "arrify": "^1.0.0", - "chalk": "^2.0.0", - "diff": "^3.1.0", - "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.0", - "tsconfig": "^6.0.0", - "v8flags": "^3.0.0", - "yn": "^2.0.0" - } - }, - "tsconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-6.0.0.tgz", - "integrity": "sha1-aw6DdgA9evGGT434+J3QBZ/80DI=", - "requires": { - "strip-bom": "^3.0.0", - "strip-json-comments": "^2.0.0" - } - }, - "tsify": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tsify/-/tsify-3.0.4.tgz", - "integrity": "sha512-y75+qgB41YS8HJck+jmSIn395I4qRGtm5ZELzvNh80Llzh8ojPWp47jm0ZoIJesNYVzbqEyLzgYXV9d/calvVg==", - "dev": true, - "requires": { - "convert-source-map": "^1.1.0", - "fs.realpath": "^1.0.0", - "object-assign": "^4.1.0", - "semver": "^5.1.0", - "through2": "^2.0.0", - "tsconfig": "^5.0.3" - }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "tsconfig": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-5.0.3.tgz", - "integrity": "sha1-X0J45wGACWeo/Dg/0ZZIh48qbjo=", - "dev": true, - "requires": { - "any-promise": "^1.3.0", - "parse-json": "^2.2.0", - "strip-bom": "^2.0.0", - "strip-json-comments": "^2.0.0" - } - } - } - }, - "tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", - "dev": true - }, - "typings": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/typings/-/typings-2.1.1.tgz", - "integrity": "sha1-usxp0lWXCkeOCfdsf2iZddU1p4o=", - "dev": true, - "requires": { - "archy": "^1.0.0", - "bluebird": "^3.1.1", - "chalk": "^1.0.0", - "cli-truncate": "^1.0.0", - "columnify": "^1.5.2", - "elegant-spinner": "^1.0.1", - "has-unicode": "^2.0.1", - "listify": "^1.0.0", - "log-update": "^1.0.2", - "minimist": "^1.2.0", - "promise-finally": "^3.0.0", - "typings-core": "^2.3.3", - "update-notifier": "^2.0.0", - "wordwrap": "^1.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "typings-core": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/typings-core/-/typings-core-2.3.3.tgz", - "integrity": "sha1-CexUzVsR3V8e8vwKsx03ACyita0=", - "dev": true, - "requires": { - "array-uniq": "^1.0.2", - "configstore": "^3.0.0", - "debug": "^2.2.0", - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "has": "^1.0.1", - "invariant": "^2.2.0", - "is-absolute": "^0.2.3", - "jspm-config": "^0.3.0", - "listify": "^1.0.0", - "lockfile": "^1.0.1", - "make-error-cause": "^1.2.1", - "mkdirp": "^0.5.1", - "object.pick": "^1.1.1", - "parse-json": "^2.2.0", - "popsicle": "^9.0.0", - "popsicle-proxy-agent": "^3.0.0", - "popsicle-retry": "^3.2.0", - "popsicle-rewrite": "^1.0.0", - "popsicle-status": "^2.0.0", - "promise-finally": "^3.0.0", - "rc": "^1.1.5", - "rimraf": "^2.4.4", - "sort-keys": "^1.0.0", - "string-template": "^1.0.0", - "strip-bom": "^3.0.0", - "thenify": "^3.1.0", - "throat": "^3.0.0", - "touch": "^1.0.0", - "typescript": "^2.1.4", - "xtend": "^4.0.0", - "zip-object": "^0.1.0" - }, - "dependencies": { - "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", - "dev": true - } - } - }, - "uglify-js": { - "version": "2.7.5", - "resolved": "http://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz", - "integrity": "sha1-RhLAx7qu4rp8SH3kkErhIgefLKg=", - "dev": true, - "requires": { - "async": "~0.2.6", - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "async": { - "version": "0.2.10", - "resolved": "http://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", - "dev": true - } - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true - }, - "umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "undeclared-identifiers": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", - "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", - "dev": true, - "requires": { - "acorn-node": "^1.3.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "dev": true, - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "dev": true - }, - "update-notifier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "dev": true, - "requires": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "dev": true, - "requires": { - "prepend-http": "^1.0.1" - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "v8flags": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.1.tgz", - "integrity": "sha512-iw/1ViSEaff8NJ3HLyEjawk/8hjJib3E7pvG4pddVXfUg1983s3VGsiClDjhK64MQVDGqc1Q8r18S4VKQZS9EQ==", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - }, - "watchpack": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-0.2.9.tgz", - "integrity": "sha1-Yuqkq15bo1/fwBgnVibjwPXj+ws=", - "dev": true, - "requires": { - "async": "^0.9.0", - "chokidar": "^1.0.0", - "graceful-fs": "^4.1.2" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - } - } - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "webpack": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-1.15.0.tgz", - "integrity": "sha1-T/MfU9sDM55VFkqdRo7gMklo/pg=", - "dev": true, - "requires": { - "acorn": "^3.0.0", - "async": "^1.3.0", - "clone": "^1.0.2", - "enhanced-resolve": "~0.9.0", - "interpret": "^0.6.4", - "loader-utils": "^0.2.11", - "memory-fs": "~0.3.0", - "mkdirp": "~0.5.0", - "node-libs-browser": "^0.7.0", - "optimist": "~0.6.0", - "supports-color": "^3.1.0", - "tapable": "~0.1.8", - "uglify-js": "~2.7.3", - "watchpack": "^0.2.1", - "webpack-core": "~0.6.9" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - }, - "enhanced-resolve": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", - "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.2.0", - "tapable": "^0.1.8" - }, - "dependencies": { - "memory-fs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", - "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", - "dev": true - } - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", - "dev": true, - "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0", - "object-assign": "^4.0.1" - } - }, - "memory-fs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", - "integrity": "sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - }, - "tapable": { - "version": "0.1.10", - "resolved": "http://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", - "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", - "dev": true - } - } - }, - "webpack-core": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.9.tgz", - "integrity": "sha1-/FcViMhVjad76e+23r3Fo7FyvcI=", - "dev": true, - "requires": { - "source-list-map": "~0.1.7", - "source-map": "~0.4.1" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", - "dev": true, - "requires": { - "string-width": "^2.1.1" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true - } - } - }, - "yn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" - }, - "zip-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/zip-object/-/zip-object-0.1.0.tgz", - "integrity": "sha1-waDaBMiMg3dW4khoCgP/kC7D9To=", + "integrity": "sha512-eujiZK9Z3F/WuswEIWqlaNUwUj67oRw4Op5a1VeKw4n9XBkV7EdxtgblroWBYvLmD7XqZ1cjqsbmE3jU43prTA==", "dev": true } } diff --git a/samples/client/petstore/typescript-fetch/tests/default/package.json b/samples/client/petstore/typescript-fetch/tests/default/package.json index f33719a8f42..786f0e5caf9 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/package.json +++ b/samples/client/petstore/typescript-fetch/tests/default/package.json @@ -26,7 +26,7 @@ "node-fetch": "^2.2.0", "ts-loader": "^2.3.0", "tsify": "^3.0.4", - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "typings": "^2.1.1", "webpack": "^1.13.0" }, diff --git a/samples/client/petstore/typescript-jquery/npm/package.json b/samples/client/petstore/typescript-jquery/npm/package.json index 39bc3c53929..671a6325f5c 100644 --- a/samples/client/petstore/typescript-jquery/npm/package.json +++ b/samples/client/petstore/typescript-jquery/npm/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@types/jquery": "^3.1", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts index 39681eb809d..dc0d40220dd 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts @@ -1,4 +1,4 @@ -import { DynamicModule, HttpService, HttpModule, Module, Global } from '@nestjs/common'; +import { DynamicModule, HttpService, HttpModule, Module, Global, Provider } from '@nestjs/common'; import { AsyncConfiguration, Configuration, ConfigurationFactory } from './configuration'; import { PetService } from './api/pet.service'; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts index 32b236cddb2..fc179af6e23 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts @@ -11,12 +11,13 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -49,19 +50,19 @@ export class PetService { */ public addPet(pet: Pet, ): Observable>; public addPet(pet: Pet, ): Observable { - if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -83,12 +84,20 @@ export class PetService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/pet`, - pet, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -101,23 +110,22 @@ export class PetService { */ public deletePet(petId: number, apiKey?: string, ): Observable>; public deletePet(petId: number, apiKey?: string, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - let headers = {...this.defaultHeaders}; if (apiKey !== undefined && apiKey !== null) { headers['api_key'] = String(apiKey); } + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -131,11 +139,19 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -147,7 +163,6 @@ export class PetService { */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable>>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable { - if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -159,12 +174,13 @@ export class PetService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -180,12 +196,20 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -197,7 +221,6 @@ export class PetService { */ public findPetsByTags(tags: Array, ): Observable>>; public findPetsByTags(tags: Array, ): Observable { - if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -209,12 +232,13 @@ export class PetService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -230,12 +254,20 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get>(`${this.basePath}/pet/findByTags`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get>(`${this.basePath}/pet/findByTags`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -247,13 +279,14 @@ export class PetService { */ public getPetById(petId: number, ): Observable>; public getPetById(petId: number, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -272,11 +305,19 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -288,19 +329,19 @@ export class PetService { */ public updatePet(pet: Pet, ): Observable>; public updatePet(pet: Pet, ): Observable { - if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -322,12 +363,20 @@ export class PetService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.put(`${this.basePath}/pet`, - pet, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.put(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -341,21 +390,19 @@ export class PetService { */ public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable>; public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -390,12 +437,20 @@ export class PetService { formParams!.append('status', status); } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - convertFormParamsToString ? formParams!.toString() : formParams!, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams!.toString() : formParams!, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -409,21 +464,19 @@ export class PetService { */ public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable>; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } - - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -463,12 +516,20 @@ export class PetService { formParams!.append('file', file); } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, - convertFormParamsToString ? formParams!.toString() : formParams!, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams!.toString() : formParams!, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts index 84b80c0f1d8..3c45cde1c26 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts @@ -11,11 +11,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -48,13 +49,14 @@ export class StoreService { */ public deleteOrder(orderId: string, ): Observable>; public deleteOrder(orderId: string, ): Observable { - if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; @@ -66,11 +68,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -81,9 +91,10 @@ export class StoreService { */ public getInventory(): Observable>; public getInventory(): Observable { - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -101,11 +112,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -117,13 +136,14 @@ export class StoreService { */ public getOrderById(orderId: number, ): Observable>; public getOrderById(orderId: number, ): Observable { - if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -137,11 +157,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -153,13 +181,14 @@ export class StoreService { */ public placeOrder(order: Order, ): Observable>; public placeOrder(order: Order, ): Observable { - if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -178,12 +207,20 @@ export class StoreService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/store/order`, - order, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/store/order`, + order, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts index 32ed0c7a5fe..5ab42497f8f 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts @@ -11,11 +11,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { HttpService, Inject, Injectable, Optional } from '@nestjs/common'; +import { HttpService, Injectable, Optional } from '@nestjs/common'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -48,13 +49,14 @@ export class UserService { */ public createUser(user: User, ): Observable>; public createUser(user: User, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -76,12 +78,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -93,13 +103,14 @@ export class UserService { */ public createUsersWithArrayInput(user: Array, ): Observable>; public createUsersWithArrayInput(user: Array, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -121,12 +132,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user/createWithArray`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user/createWithArray`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -138,13 +157,14 @@ export class UserService { */ public createUsersWithListInput(user: Array, ): Observable>; public createUsersWithListInput(user: Array, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -166,12 +186,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user/createWithList`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user/createWithList`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -183,13 +211,14 @@ export class UserService { */ public deleteUser(username: string, ): Observable>; public deleteUser(username: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -206,11 +235,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -222,13 +259,14 @@ export class UserService { */ public getUserByName(username: string, ): Observable>; public getUserByName(username: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -242,11 +280,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -259,7 +305,6 @@ export class UserService { */ public loginUser(username: string, password: string, ): Observable>; public loginUser(username: string, password: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -278,6 +323,8 @@ export class UserService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -291,12 +338,20 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/login`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/login`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -307,9 +362,10 @@ export class UserService { */ public logoutUser(): Observable>; public logoutUser(): Observable { - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -326,11 +382,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/logout`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/logout`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -343,7 +407,6 @@ export class UserService { */ public updateUser(username: string, user: User, ): Observable>; public updateUser(username: string, user: User, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -354,6 +417,8 @@ export class UserService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -375,12 +440,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts index 39cf69ee612..1ee763ae549 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json index d8efa421c35..9918f4e9492 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json @@ -50,7 +50,7 @@ "ts-node": "8.3.0", "tsconfig-paths": "3.8.0", "tslint": "5.18.0", - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "wait-on": "^3.2.0" }, "jest": { diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts index 8a3d572777d..8adce2ebe57 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/pet.service.ts @@ -11,13 +11,14 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -50,19 +51,19 @@ export class PetService { */ public addPet(pet: Pet, ): Observable>; public addPet(pet: Pet, ): Observable { - if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling addPet.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -84,12 +85,20 @@ export class PetService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/pet`, - pet, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -102,23 +111,22 @@ export class PetService { */ public deletePet(petId: number, apiKey?: string, ): Observable>; public deletePet(petId: number, apiKey?: string, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } - let headers = {...this.defaultHeaders}; if (apiKey !== undefined && apiKey !== null) { headers['api_key'] = String(apiKey); } + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -132,11 +140,19 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -148,7 +164,6 @@ export class PetService { */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable>>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable { - if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -160,12 +175,13 @@ export class PetService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -181,12 +197,20 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -198,7 +222,6 @@ export class PetService { */ public findPetsByTags(tags: Array, ): Observable>>; public findPetsByTags(tags: Array, ): Observable { - if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -210,12 +233,13 @@ export class PetService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -231,12 +255,20 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get>(`${this.basePath}/pet/findByTags`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get>(`${this.basePath}/pet/findByTags`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -248,13 +280,14 @@ export class PetService { */ public getPetById(petId: number, ): Observable>; public getPetById(petId: number, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -273,11 +306,19 @@ export class PetService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -289,19 +330,19 @@ export class PetService { */ public updatePet(pet: Pet, ): Observable>; public updatePet(pet: Pet, ): Observable { - if (pet === null || pet === undefined) { throw new Error('Required parameter pet was null or undefined when calling updatePet.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -323,12 +364,20 @@ export class PetService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.put(`${this.basePath}/pet`, - pet, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.put(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -342,21 +391,19 @@ export class PetService { */ public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable>; public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } - - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -391,12 +438,20 @@ export class PetService { formParams!.append('status', status); } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, - convertFormParamsToString ? formParams!.toString() : formParams!, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams!.toString() : formParams!, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -410,21 +465,19 @@ export class PetService { */ public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable>; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable { - if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } - - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (petstore_auth) required if (this.configuration.accessToken) { - const accessToken = typeof this.configuration.accessToken === 'function' - ? this.configuration.accessToken() - : this.configuration.accessToken; - headers['Authorization'] = 'Bearer ' + accessToken; + accessTokenObservable = typeof this.configuration.accessToken === 'function' + ? from(Promise.resolve(this.configuration.accessToken())) + : from(Promise.resolve(this.configuration.accessToken)) } // to determine the Accept header @@ -464,12 +517,20 @@ export class PetService { formParams!.append('file', file); } - return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, - convertFormParamsToString ? formParams!.toString() : formParams!, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams!.toString() : formParams!, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts index daae6d1dbee..93bfd113ba8 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts @@ -11,12 +11,13 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { Order } from '../model/order'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -49,13 +50,14 @@ export class StoreService { */ public deleteOrder(orderId: string, ): Observable>; public deleteOrder(orderId: string, ): Observable { - if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; @@ -67,11 +69,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -82,9 +92,10 @@ export class StoreService { */ public getInventory(): Observable>; public getInventory(): Observable { - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -102,11 +113,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -118,13 +137,14 @@ export class StoreService { */ public getOrderById(orderId: number, ): Observable>; public getOrderById(orderId: number, ): Observable { - if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -138,11 +158,19 @@ export class StoreService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -154,13 +182,14 @@ export class StoreService { */ public placeOrder(order: Order, ): Observable>; public placeOrder(order: Order, ): Observable { - if (order === null || order === undefined) { throw new Error('Required parameter order was null or undefined when calling placeOrder.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -179,12 +208,20 @@ export class StoreService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/store/order`, - order, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/store/order`, + order, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts index c34c9ae1878..dcbfddd4fa0 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/user.service.ts @@ -11,12 +11,13 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { AxiosResponse } from 'axios'; -import { Observable } from 'rxjs'; +import { Observable, from, of, switchMap } from 'rxjs'; import { User } from '../model/user'; import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; @Injectable() @@ -49,13 +50,14 @@ export class UserService { */ public createUser(user: User, ): Observable>; public createUser(user: User, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUser.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -77,12 +79,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -94,13 +104,14 @@ export class UserService { */ public createUsersWithArrayInput(user: Array, ): Observable>; public createUsersWithArrayInput(user: Array, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -122,12 +133,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user/createWithArray`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user/createWithArray`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -139,13 +158,14 @@ export class UserService { */ public createUsersWithListInput(user: Array, ): Observable>; public createUsersWithListInput(user: Array, ): Observable { - if (user === null || user === undefined) { throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -167,12 +187,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.post(`${this.basePath}/user/createWithList`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.post(`${this.basePath}/user/createWithList`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -184,13 +212,14 @@ export class UserService { */ public deleteUser(username: string, ): Observable>; public deleteUser(username: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -207,11 +236,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -223,13 +260,14 @@ export class UserService { */ public getUserByName(username: string, ): Observable>; public getUserByName(username: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -243,11 +281,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -260,7 +306,6 @@ export class UserService { */ public loginUser(username: string, password: string, ): Observable>; public loginUser(username: string, password: string, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling loginUser.'); } @@ -279,6 +324,8 @@ export class UserService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/xml', @@ -292,12 +339,20 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/login`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/login`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -308,9 +363,10 @@ export class UserService { */ public logoutUser(): Observable>; public logoutUser(): Observable { - let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -327,11 +383,19 @@ export class UserService { // to determine the Content-Type header const consumes: string[] = [ ]; - return this.httpClient.get(`${this.basePath}/user/logout`, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.get(`${this.basePath}/user/logout`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } /** @@ -344,7 +408,6 @@ export class UserService { */ public updateUser(username: string, user: User, ): Observable>; public updateUser(username: string, user: User, ): Observable { - if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } @@ -355,6 +418,8 @@ export class UserService { let headers = {...this.defaultHeaders}; + let accessTokenObservable: Observable = of(null); + // authentication (api_key) required if (this.configuration.apiKeys?.["api_key"]) { headers['api_key'] = this.configuration.apiKeys["api_key"]; @@ -376,12 +441,20 @@ export class UserService { if (httpContentTypeSelected != undefined) { headers['Content-Type'] = httpContentTypeSelected; } - return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, - user, - { - withCredentials: this.configuration.withCredentials, - headers: headers - } + return accessTokenObservable.pipe( + switchMap((accessToken) => { + if (accessToken) { + headers['Authorization'] = `Bearer ${accessToken}`; + } + + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + }) ); } } diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts index 39cf69ee612..1ee763ae549 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts @@ -4,7 +4,7 @@ export interface ConfigurationParameters { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; } @@ -13,7 +13,7 @@ export class Configuration { apiKeys?: {[ key: string ]: string}; username?: string; password?: string; - accessToken?: string | (() => string); + accessToken?: string | Promise | (() => string | Promise); basePath?: string; withCredentials?: boolean; diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/package.json b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/package.json index bd74fe891d0..e32c30bcde0 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/package.json +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/package.json @@ -51,7 +51,7 @@ "ts-node": "8.3.0", "tsconfig-paths": "3.8.0", "tslint": "5.18.0", - "typescript": "^4.0", + "typescript": "^4.0 || ^5.0", "wait-on": "^3.2.0" }, "jest": { diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index 5f9c28d342d..d754e779f7c 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -23,7 +23,7 @@ "@types/bluebird": "^3.5.33", "@types/node": "^12", "@types/request": "^2.48.8", - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/package.json b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/package.json index 7ff78ec2c59..d96cdf4f8c4 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/package.json @@ -17,7 +17,7 @@ "redux-query": "^3.2.0" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json b/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json index add1ece5a0b..fc89fe29cbe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/package.json @@ -17,7 +17,7 @@ "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json index add1ece5a0b..fc89fe29cbe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/package.json @@ -17,7 +17,7 @@ "rxjs": "^7.2.0" }, "devDependencies": { - "typescript": "^4.0" + "typescript": "^4.0 || ^5.0" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index c9e125ba188..f1358e30d8a 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -7.4.0-SNAPSHOT +8.0.0-SNAPSHOT diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 110cc439a08..1f7b7b1cf7e 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1017,6 +1017,7 @@ ul.nav-tabs { } }; + var errs = {}; @@ -1482,6 +1483,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -1530,41 +1533,60 @@ $(document).ready(function() {
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-addPet-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-addPet-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -1587,6 +1609,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -1968,6 +2032,48 @@ Pet id to delete
    +
    +
    + +
    + +
    @@ -2319,41 +2425,66 @@ Status values that need to be considered for filter
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-findPetsByStatus-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-findPetsByStatus-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -2376,6 +2507,48 @@ Status values that need to be considered for filter
    +
    +
    + +
    + +
    @@ -2727,41 +2900,66 @@ Tags to filter by
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-findPetsByTags-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-findPetsByTags-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -2784,6 +2982,48 @@ Tags to filter by
    +
    +
    + +
    + +
    @@ -3147,41 +3387,60 @@ ID of pet to return
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-getPetById-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-getPetById-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -3204,6 +3463,48 @@ ID of pet to return
    +
    +
    + +
    + +

    @@ -3226,6 +3527,48 @@ ID of pet to return
    +
    +
    + +
    + +
    @@ -3592,6 +3935,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -3640,41 +3985,60 @@ $(document).ready(function() {
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-updatePet-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-updatePet-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -3697,6 +4061,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +

    @@ -3719,6 +4125,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +

    @@ -3741,6 +4189,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -4157,6 +4647,48 @@ Updated status of the pet
    +
    +
    + +
    + +
    @@ -4591,41 +5123,55 @@ file to upload
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Pet-uploadFile-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Pet-uploadFile-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +
    @@ -4934,6 +5480,48 @@ ID of the order that needs to be deleted
    +
    +
    + +
    + +

    @@ -4956,6 +5544,48 @@ ID of the order that needs to be deleted
    +
    +
    + +
    + +
    @@ -5275,41 +5905,59 @@ pub fn main() {
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Store-getInventory-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Store-getInventory-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +
    @@ -5633,41 +6281,60 @@ ID of pet that needs to be fetched
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Store-getOrderById-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Store-getOrderById-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -5690,6 +6357,48 @@ ID of pet that needs to be fetched
    +
    +
    + +
    + +

    @@ -5712,6 +6421,48 @@ ID of pet that needs to be fetched
    +
    +
    + +
    + +
    @@ -6010,6 +6761,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -6058,41 +6811,60 @@ $(document).ready(function() {
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-Store-placeOrder-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-Store-placeOrder-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -6115,6 +6887,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -6448,6 +7262,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -6491,6 +7307,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -6824,6 +7682,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -6867,6 +7727,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -7200,6 +8102,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -7243,6 +8147,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -7588,6 +8534,48 @@ The name that needs to be deleted
    +
    +
    + +
    + +

    @@ -7610,6 +8598,48 @@ The name that needs to be deleted
    +
    +
    + +
    + +
    @@ -7930,41 +8960,60 @@ The name that needs to be fetched. Use user1 for testing.
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-User-getUserByName-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-User-getUserByName-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +

    @@ -7987,6 +9036,48 @@ The name that needs to be fetched. Use user1 for testing.
    +
    +
    + +
    + +

    @@ -8009,6 +9100,48 @@ The name that needs to be fetched. Use user1 for testing.
    +
    +
    + +
    + +
    @@ -8366,41 +9499,89 @@ The password for login in clear text
    -
    -
    - -
    - + var view = new JSONSchemaView(schema, 3); + $('#responses-User-loginUser-200-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-User-loginUser-schema-200'); + result.empty(); + result.append(view.render()); + }); +
    + +
    @@ -8410,19 +9591,19 @@ The password for login in clear text - + - + - + @@ -8451,6 +9632,48 @@ The password for login in clear text
    +
    +
    + +
    + +
    @@ -8755,6 +9978,48 @@ pub fn main() {
    +
    +
    + +
    + +
    @@ -9126,6 +10391,8 @@ $(document).ready(function() { } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); + } else if (schema.items != null && schema.items.$ref != null) { + schema.items = defsParser.$refs.get(schema.items.$ref); } else { schemaWrapper.definitions = Object.assign({}, defs); $RefParser.dereference(schemaWrapper).catch(function(err) { @@ -9169,6 +10436,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +

    @@ -9191,6 +10500,48 @@ $(document).ready(function() {
    +
    +
    + +
    + +
    @@ -10309,7 +11660,7 @@ var JSONSchemaView = (function () { // Determine if a schema is an array this.isArray = !this.isAny && this.schema && this.schema.type === 'array'; - this.isObject = this.schema && (this.schema.type === 'object' || this.schema.properties || this.schema.anyOf || this.schema.oneof || this.schema.allOf); + this.isObject = this.schema && (this.schema.type === 'object' || this.schema.properties || this.schema.anyOf || this.schema.oneOf || this.schema.allOf); // Determine if a schema is a primitive this.isPrimitive = !this.isAny && !this.isArray && !this.isObject; diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 3d4244cc7c6..03bfb12813d 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -31,7 +31,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 2.22.2 @@ -41,7 +41,6 @@ -Xms512m -Xmx1500m methods - pertest @@ -114,15 +113,16 @@ provided - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} + test UTF-8 8.0.0-SNAPSHOT 1.0.0 - 4.13.2 + 5.10.2 diff --git a/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java b/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java index e49abd7033f..be460783362 100644 --- a/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java +++ b/samples/meta-codegen/lib/src/test/java/com/my/company/codegen/MyclientcodegenGeneratorTest.java @@ -1,6 +1,6 @@ package com.my.company.codegen; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.DefaultGenerator; import org.openapitools.codegen.config.CodegenConfigurator; diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go index 431577cfccd..33da123ab61 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go @@ -162,7 +162,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml index 9622fcc9e07..6bd3c344ba7 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar and b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew.bat b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew.bat +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index ae051237ef4..9baa214187c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -212,7 +212,7 @@ module XAuthIDAlias # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -291,7 +291,7 @@ module XAuthIDAlias # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index 95b8000b462..8ed831e2685 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -211,7 +211,7 @@ module DynamicServers # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -290,7 +290,7 @@ module DynamicServers # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index bb0ea46ca8f..3e99df93cfe 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -211,7 +211,7 @@ module Petstore # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -290,7 +290,7 @@ module Petstore # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml index de93663746d..efc0d4ccd70 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml index de93663746d..efc0d4ccd70 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml index de93663746d..efc0d4ccd70 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/oneof_primitive/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart index a3d4df084be..7cedba75141 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/additional_properties_class.dart @@ -47,15 +47,17 @@ class AdditionalPropertiesClass { - @override - bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && - other.mapProperty == mapProperty && - other.mapOfMapProperty == mapOfMapProperty; - @override - int get hashCode => - mapProperty.hashCode + - mapOfMapProperty.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass && + other.mapProperty == mapProperty && + other.mapOfMapProperty == mapOfMapProperty; + + @override + int get hashCode => + mapProperty.hashCode + + mapOfMapProperty.hashCode; factory AdditionalPropertiesClass.fromJson(Map json) => _$AdditionalPropertiesClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart index b654a66733e..2b799c619dc 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/all_of_with_single_ref.dart @@ -48,15 +48,17 @@ class AllOfWithSingleRef { - @override - bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && - other.username == username && - other.singleRefType == singleRefType; - @override - int get hashCode => - username.hashCode + - singleRefType.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is AllOfWithSingleRef && + other.username == username && + other.singleRefType == singleRefType; + + @override + int get hashCode => + username.hashCode + + singleRefType.hashCode; factory AllOfWithSingleRef.fromJson(Map json) => _$AllOfWithSingleRefFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart index 22a196ce7d7..19c22c9351e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/animal.dart @@ -47,15 +47,17 @@ class Animal { - @override - bool operator ==(Object other) => identical(this, other) || other is Animal && - other.className == className && - other.color == color; - @override - int get hashCode => - className.hashCode + - color.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Animal && + other.className == className && + other.color == color; + + @override + int get hashCode => + className.hashCode + + color.hashCode; factory Animal.fromJson(Map json) => _$AnimalFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart index c6700e2d39c..22cdcaff69b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/api_response.dart @@ -61,17 +61,19 @@ class ApiResponse { - @override - bool operator ==(Object other) => identical(this, other) || other is ApiResponse && - other.code == code && - other.type == type && - other.message == message; - @override - int get hashCode => - code.hashCode + - type.hashCode + - message.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiResponse && + other.code == code && + other.type == type && + other.message == message; + + @override + int get hashCode => + code.hashCode + + type.hashCode + + message.hashCode; factory ApiResponse.fromJson(Map json) => _$ApiResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart index 7372be1583f..79f8bf64fee 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_array_of_number_only.dart @@ -33,13 +33,15 @@ class ArrayOfArrayOfNumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && - other.arrayArrayNumber == arrayArrayNumber; - @override - int get hashCode => - arrayArrayNumber.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfArrayOfNumberOnly && + other.arrayArrayNumber == arrayArrayNumber; + + @override + int get hashCode => + arrayArrayNumber.hashCode; factory ArrayOfArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfArrayOfNumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart index d538bb312fd..d4ecbeff86f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_of_number_only.dart @@ -33,13 +33,15 @@ class ArrayOfNumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && - other.arrayNumber == arrayNumber; - @override - int get hashCode => - arrayNumber.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayOfNumberOnly && + other.arrayNumber == arrayNumber; + + @override + int get hashCode => + arrayNumber.hashCode; factory ArrayOfNumberOnly.fromJson(Map json) => _$ArrayOfNumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart index 30a6ec8a8b7..c6f7c38ac76 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/array_test.dart @@ -62,17 +62,19 @@ class ArrayTest { - @override - bool operator ==(Object other) => identical(this, other) || other is ArrayTest && - other.arrayOfString == arrayOfString && - other.arrayArrayOfInteger == arrayArrayOfInteger && - other.arrayArrayOfModel == arrayArrayOfModel; - @override - int get hashCode => - arrayOfString.hashCode + - arrayArrayOfInteger.hashCode + - arrayArrayOfModel.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ArrayTest && + other.arrayOfString == arrayOfString && + other.arrayArrayOfInteger == arrayArrayOfInteger && + other.arrayArrayOfModel == arrayArrayOfModel; + + @override + int get hashCode => + arrayOfString.hashCode + + arrayArrayOfInteger.hashCode + + arrayArrayOfModel.hashCode; factory ArrayTest.fromJson(Map json) => _$ArrayTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart index 707cb05a040..2c996e5c71b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/capitalization.dart @@ -104,23 +104,25 @@ class Capitalization { - @override - bool operator ==(Object other) => identical(this, other) || other is Capitalization && - other.smallCamel == smallCamel && - other.capitalCamel == capitalCamel && - other.smallSnake == smallSnake && - other.capitalSnake == capitalSnake && - other.sCAETHFlowPoints == sCAETHFlowPoints && - other.ATT_NAME == ATT_NAME; - @override - int get hashCode => - smallCamel.hashCode + - capitalCamel.hashCode + - smallSnake.hashCode + - capitalSnake.hashCode + - sCAETHFlowPoints.hashCode + - ATT_NAME.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Capitalization && + other.smallCamel == smallCamel && + other.capitalCamel == capitalCamel && + other.smallSnake == smallSnake && + other.capitalSnake == capitalSnake && + other.sCAETHFlowPoints == sCAETHFlowPoints && + other.ATT_NAME == ATT_NAME; + + @override + int get hashCode => + smallCamel.hashCode + + capitalCamel.hashCode + + smallSnake.hashCode + + capitalSnake.hashCode + + sCAETHFlowPoints.hashCode + + ATT_NAME.hashCode; factory Capitalization.fromJson(Map json) => _$CapitalizationFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart index 0b176faf313..b468550dce5 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/cat.dart @@ -64,17 +64,19 @@ class Cat { - @override - bool operator ==(Object other) => identical(this, other) || other is Cat && - other.className == className && - other.color == color && - other.declawed == declawed; - @override - int get hashCode => - className.hashCode + - color.hashCode + - declawed.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Cat && + other.className == className && + other.color == color && + other.declawed == declawed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + declawed.hashCode; factory Cat.fromJson(Map json) => _$CatFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart index b94c6157990..ffa8d07de9d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/category.dart @@ -47,15 +47,17 @@ class Category { - @override - bool operator ==(Object other) => identical(this, other) || other is Category && - other.id == id && - other.name == name; - @override - int get hashCode => - id.hashCode + - name.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Category && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; factory Category.fromJson(Map json) => _$CategoryFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart index 674a58ca893..22b9df5c55a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/child_with_nullable.dart @@ -64,17 +64,19 @@ class ChildWithNullable { - @override - bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && - other.type == type && - other.nullableProperty == nullableProperty && - other.otherProperty == otherProperty; - @override - int get hashCode => - type.hashCode + - (nullableProperty == null ? 0 : nullableProperty.hashCode) + - otherProperty.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ChildWithNullable && + other.type == type && + other.nullableProperty == nullableProperty && + other.otherProperty == otherProperty; + + @override + int get hashCode => + type.hashCode + + (nullableProperty == null ? 0 : nullableProperty.hashCode) + + otherProperty.hashCode; factory ChildWithNullable.fromJson(Map json) => _$ChildWithNullableFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart index 01837bfcca9..28a10ad2573 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/class_model.dart @@ -33,13 +33,15 @@ class ClassModel { - @override - bool operator ==(Object other) => identical(this, other) || other is ClassModel && - other.class_ == class_; - @override - int get hashCode => - class_.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ClassModel && + other.class_ == class_; + + @override + int get hashCode => + class_.hashCode; factory ClassModel.fromJson(Map json) => _$ClassModelFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart index 0151b72e23a..7598e946468 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/deprecated_object.dart @@ -34,13 +34,15 @@ class DeprecatedObject { - @override - bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && - other.name == name; - @override - int get hashCode => - name.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is DeprecatedObject && + other.name == name; + + @override + int get hashCode => + name.hashCode; factory DeprecatedObject.fromJson(Map json) => _$DeprecatedObjectFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart index a049d0479fb..8a5b55baf10 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/dog.dart @@ -64,17 +64,19 @@ class Dog { - @override - bool operator ==(Object other) => identical(this, other) || other is Dog && - other.className == className && - other.color == color && - other.breed == breed; - @override - int get hashCode => - className.hashCode + - color.hashCode + - breed.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Dog && + other.className == className && + other.color == color && + other.breed == breed; + + @override + int get hashCode => + className.hashCode + + color.hashCode + + breed.hashCode; factory Dog.fromJson(Map json) => _$DogFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart index a97d069a3d2..46959e7ccd7 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_arrays.dart @@ -47,15 +47,17 @@ class EnumArrays { - @override - bool operator ==(Object other) => identical(this, other) || other is EnumArrays && - other.justSymbol == justSymbol && - other.arrayEnum == arrayEnum; - @override - int get hashCode => - justSymbol.hashCode + - arrayEnum.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumArrays && + other.justSymbol == justSymbol && + other.arrayEnum == arrayEnum; + + @override + int get hashCode => + justSymbol.hashCode + + arrayEnum.hashCode; factory EnumArrays.fromJson(Map json) => _$EnumArraysFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart index 80555c14d03..687e674d211 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/enum_test.dart @@ -135,27 +135,29 @@ class EnumTest { - @override - bool operator ==(Object other) => identical(this, other) || other is EnumTest && - other.enumString == enumString && - other.enumStringRequired == enumStringRequired && - other.enumInteger == enumInteger && - other.enumNumber == enumNumber && - other.outerEnum == outerEnum && - other.outerEnumInteger == outerEnumInteger && - other.outerEnumDefaultValue == outerEnumDefaultValue && - other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; - @override - int get hashCode => - enumString.hashCode + - enumStringRequired.hashCode + - enumInteger.hashCode + - enumNumber.hashCode + - (outerEnum == null ? 0 : outerEnum.hashCode) + - outerEnumInteger.hashCode + - outerEnumDefaultValue.hashCode + - outerEnumIntegerDefaultValue.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is EnumTest && + other.enumString == enumString && + other.enumStringRequired == enumStringRequired && + other.enumInteger == enumInteger && + other.enumNumber == enumNumber && + other.outerEnum == outerEnum && + other.outerEnumInteger == outerEnumInteger && + other.outerEnumDefaultValue == outerEnumDefaultValue && + other.outerEnumIntegerDefaultValue == outerEnumIntegerDefaultValue; + + @override + int get hashCode => + enumString.hashCode + + enumStringRequired.hashCode + + enumInteger.hashCode + + enumNumber.hashCode + + (outerEnum == null ? 0 : outerEnum.hashCode) + + outerEnumInteger.hashCode + + outerEnumDefaultValue.hashCode + + outerEnumIntegerDefaultValue.hashCode; factory EnumTest.fromJson(Map json) => _$EnumTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart index 965257f0a07..d413eadb223 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/fake_big_decimal_map200_response.dart @@ -47,15 +47,17 @@ class FakeBigDecimalMap200Response { - @override - bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && - other.someId == someId && - other.someMap == someMap; - @override - int get hashCode => - someId.hashCode + - someMap.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FakeBigDecimalMap200Response && + other.someId == someId && + other.someMap == someMap; + + @override + int get hashCode => + someId.hashCode + + someMap.hashCode; factory FakeBigDecimalMap200Response.fromJson(Map json) => _$FakeBigDecimalMap200ResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart index bd2a9dc6f2f..55195af35db 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/file_schema_test_class.dart @@ -48,15 +48,17 @@ class FileSchemaTestClass { - @override - bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && - other.file == file && - other.files == files; - @override - int get hashCode => - file.hashCode + - files.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FileSchemaTestClass && + other.file == file && + other.files == files; + + @override + int get hashCode => + file.hashCode + + files.hashCode; factory FileSchemaTestClass.fromJson(Map json) => _$FileSchemaTestClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart index b43572d222c..b8d2d1f2da8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo.dart @@ -33,13 +33,15 @@ class Foo { - @override - bool operator ==(Object other) => identical(this, other) || other is Foo && - other.bar == bar; - @override - int get hashCode => - bar.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Foo && + other.bar == bar; + + @override + int get hashCode => + bar.hashCode; factory Foo.fromJson(Map json) => _$FooFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart index acc1c60e435..1702a8fcebd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/foo_get_default_response.dart @@ -34,13 +34,15 @@ class FooGetDefaultResponse { - @override - bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && - other.string == string; - @override - int get hashCode => - string.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FooGetDefaultResponse && + other.string == string; + + @override + int get hashCode => + string.hashCode; factory FooGetDefaultResponse.fromJson(Map json) => _$FooGetDefaultResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart index 91b35595a34..65edad5d646 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/format_test.dart @@ -251,43 +251,45 @@ class FormatTest { - @override - bool operator ==(Object other) => identical(this, other) || other is FormatTest && - other.integer == integer && - other.int32 == int32 && - other.int64 == int64 && - other.number == number && - other.float == float && - other.double_ == double_ && - other.decimal == decimal && - other.string == string && - other.byte == byte && - other.binary == binary && - other.date == date && - other.dateTime == dateTime && - other.uuid == uuid && - other.password == password && - other.patternWithDigits == patternWithDigits && - other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; - @override - int get hashCode => - integer.hashCode + - int32.hashCode + - int64.hashCode + - number.hashCode + - float.hashCode + - double_.hashCode + - decimal.hashCode + - string.hashCode + - byte.hashCode + - binary.hashCode + - date.hashCode + - dateTime.hashCode + - uuid.hashCode + - password.hashCode + - patternWithDigits.hashCode + - patternWithDigitsAndDelimiter.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is FormatTest && + other.integer == integer && + other.int32 == int32 && + other.int64 == int64 && + other.number == number && + other.float == float && + other.double_ == double_ && + other.decimal == decimal && + other.string == string && + other.byte == byte && + other.binary == binary && + other.date == date && + other.dateTime == dateTime && + other.uuid == uuid && + other.password == password && + other.patternWithDigits == patternWithDigits && + other.patternWithDigitsAndDelimiter == patternWithDigitsAndDelimiter; + + @override + int get hashCode => + integer.hashCode + + int32.hashCode + + int64.hashCode + + number.hashCode + + float.hashCode + + double_.hashCode + + decimal.hashCode + + string.hashCode + + byte.hashCode + + binary.hashCode + + date.hashCode + + dateTime.hashCode + + uuid.hashCode + + password.hashCode + + patternWithDigits.hashCode + + patternWithDigitsAndDelimiter.hashCode; factory FormatTest.fromJson(Map json) => _$FormatTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart index 84c99fbc188..1cf233f8c33 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/has_only_read_only.dart @@ -47,15 +47,17 @@ class HasOnlyReadOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && - other.bar == bar && - other.foo == foo; - @override - int get hashCode => - bar.hashCode + - foo.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is HasOnlyReadOnly && + other.bar == bar && + other.foo == foo; + + @override + int get hashCode => + bar.hashCode + + foo.hashCode; factory HasOnlyReadOnly.fromJson(Map json) => _$HasOnlyReadOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart index fcb2973b751..a77a95c2e4c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/health_check_result.dart @@ -33,13 +33,15 @@ class HealthCheckResult { - @override - bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && - other.nullableMessage == nullableMessage; - @override - int get hashCode => - (nullableMessage == null ? 0 : nullableMessage.hashCode); + + @override + bool operator ==(Object other) => identical(this, other) || other is HealthCheckResult && + other.nullableMessage == nullableMessage; + + @override + int get hashCode => + (nullableMessage == null ? 0 : nullableMessage.hashCode); factory HealthCheckResult.fromJson(Map json) => _$HealthCheckResultFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart index 7ab19eabd5c..beb4547b770 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/map_test.dart @@ -75,19 +75,21 @@ class MapTest { - @override - bool operator ==(Object other) => identical(this, other) || other is MapTest && - other.mapMapOfString == mapMapOfString && - other.mapOfEnumString == mapOfEnumString && - other.directMap == directMap && - other.indirectMap == indirectMap; - @override - int get hashCode => - mapMapOfString.hashCode + - mapOfEnumString.hashCode + - directMap.hashCode + - indirectMap.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is MapTest && + other.mapMapOfString == mapMapOfString && + other.mapOfEnumString == mapOfEnumString && + other.directMap == directMap && + other.indirectMap == indirectMap; + + @override + int get hashCode => + mapMapOfString.hashCode + + mapOfEnumString.hashCode + + directMap.hashCode + + indirectMap.hashCode; factory MapTest.fromJson(Map json) => _$MapTestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart index e2e3cd0b857..c7262a747b2 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/mixed_properties_and_additional_properties_class.dart @@ -62,17 +62,19 @@ class MixedPropertiesAndAdditionalPropertiesClass { - @override - bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && - other.uuid == uuid && - other.dateTime == dateTime && - other.map == map; - @override - int get hashCode => - uuid.hashCode + - dateTime.hashCode + - map.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is MixedPropertiesAndAdditionalPropertiesClass && + other.uuid == uuid && + other.dateTime == dateTime && + other.map == map; + + @override + int get hashCode => + uuid.hashCode + + dateTime.hashCode + + map.hashCode; factory MixedPropertiesAndAdditionalPropertiesClass.fromJson(Map json) => _$MixedPropertiesAndAdditionalPropertiesClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart index 346f1257555..4e84da142bd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model200_response.dart @@ -47,15 +47,17 @@ class Model200Response { - @override - bool operator ==(Object other) => identical(this, other) || other is Model200Response && - other.name == name && - other.class_ == class_; - @override - int get hashCode => - name.hashCode + - class_.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Model200Response && + other.name == name && + other.class_ == class_; + + @override + int get hashCode => + name.hashCode + + class_.hashCode; factory Model200Response.fromJson(Map json) => _$Model200ResponseFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart index 14e22005a16..29e587b33ac 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_client.dart @@ -33,13 +33,15 @@ class ModelClient { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelClient && - other.client == client; - @override - int get hashCode => - client.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelClient && + other.client == client; + + @override + int get hashCode => + client.hashCode; factory ModelClient.fromJson(Map json) => _$ModelClientFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart index 2cecd3b9c72..7ff6301e9ed 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_enum_class.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum ModelEnumClass { - @JsonValue(r'_abc') - abc(r'_abc'), - @JsonValue(r'-efg') - efg(r'-efg'), - @JsonValue(r'(xyz)') - leftParenthesisXyzRightParenthesis(r'(xyz)'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'_abc') + abc(r'_abc'), + @JsonValue(r'-efg') + efg(r'-efg'), + @JsonValue(r'(xyz)') + leftParenthesisXyzRightParenthesis(r'(xyz)'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const ModelEnumClass(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart index fe95e3ff002..6fc79d9a069 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_file.dart @@ -34,13 +34,15 @@ class ModelFile { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelFile && - other.sourceURI == sourceURI; - @override - int get hashCode => - sourceURI.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelFile && + other.sourceURI == sourceURI; + + @override + int get hashCode => + sourceURI.hashCode; factory ModelFile.fromJson(Map json) => _$ModelFileFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart index 543b79ac9f1..cc626409a89 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_list.dart @@ -33,13 +33,15 @@ class ModelList { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelList && - other.n123list == n123list; - @override - int get hashCode => - n123list.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelList && + other.n123list == n123list; + + @override + int get hashCode => + n123list.hashCode; factory ModelList.fromJson(Map json) => _$ModelListFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart index 192b134d8fc..5d414ad454d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/model_return.dart @@ -33,13 +33,15 @@ class ModelReturn { - @override - bool operator ==(Object other) => identical(this, other) || other is ModelReturn && - other.return_ == return_; - @override - int get hashCode => - return_.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ModelReturn && + other.return_ == return_; + + @override + int get hashCode => + return_.hashCode; factory ModelReturn.fromJson(Map json) => _$ModelReturnFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart index 6613fa3afc8..172e70e7a9d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/name.dart @@ -75,19 +75,21 @@ class Name { - @override - bool operator ==(Object other) => identical(this, other) || other is Name && - other.name == name && - other.snakeCase == snakeCase && - other.property == property && - other.n123number == n123number; - @override - int get hashCode => - name.hashCode + - snakeCase.hashCode + - property.hashCode + - n123number.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Name && + other.name == name && + other.snakeCase == snakeCase && + other.property == property && + other.n123number == n123number; + + @override + int get hashCode => + name.hashCode + + snakeCase.hashCode + + property.hashCode + + n123number.hashCode; factory Name.fromJson(Map json) => _$NameFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart index 897d489ba45..811eaa2118a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/nullable_class.dart @@ -187,35 +187,37 @@ class NullableClass { - @override - bool operator ==(Object other) => identical(this, other) || other is NullableClass && - other.integerProp == integerProp && - other.numberProp == numberProp && - other.booleanProp == booleanProp && - other.stringProp == stringProp && - other.dateProp == dateProp && - other.datetimeProp == datetimeProp && - other.arrayNullableProp == arrayNullableProp && - other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && - other.arrayItemsNullable == arrayItemsNullable && - other.objectNullableProp == objectNullableProp && - other.objectAndItemsNullableProp == objectAndItemsNullableProp && - other.objectItemsNullable == objectItemsNullable; - @override - int get hashCode => - (integerProp == null ? 0 : integerProp.hashCode) + - (numberProp == null ? 0 : numberProp.hashCode) + - (booleanProp == null ? 0 : booleanProp.hashCode) + - (stringProp == null ? 0 : stringProp.hashCode) + - (dateProp == null ? 0 : dateProp.hashCode) + - (datetimeProp == null ? 0 : datetimeProp.hashCode) + - (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + - (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + - arrayItemsNullable.hashCode + - (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + - (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + - objectItemsNullable.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is NullableClass && + other.integerProp == integerProp && + other.numberProp == numberProp && + other.booleanProp == booleanProp && + other.stringProp == stringProp && + other.dateProp == dateProp && + other.datetimeProp == datetimeProp && + other.arrayNullableProp == arrayNullableProp && + other.arrayAndItemsNullableProp == arrayAndItemsNullableProp && + other.arrayItemsNullable == arrayItemsNullable && + other.objectNullableProp == objectNullableProp && + other.objectAndItemsNullableProp == objectAndItemsNullableProp && + other.objectItemsNullable == objectItemsNullable; + + @override + int get hashCode => + (integerProp == null ? 0 : integerProp.hashCode) + + (numberProp == null ? 0 : numberProp.hashCode) + + (booleanProp == null ? 0 : booleanProp.hashCode) + + (stringProp == null ? 0 : stringProp.hashCode) + + (dateProp == null ? 0 : dateProp.hashCode) + + (datetimeProp == null ? 0 : datetimeProp.hashCode) + + (arrayNullableProp == null ? 0 : arrayNullableProp.hashCode) + + (arrayAndItemsNullableProp == null ? 0 : arrayAndItemsNullableProp.hashCode) + + arrayItemsNullable.hashCode + + (objectNullableProp == null ? 0 : objectNullableProp.hashCode) + + (objectAndItemsNullableProp == null ? 0 : objectAndItemsNullableProp.hashCode) + + objectItemsNullable.hashCode; factory NullableClass.fromJson(Map json) => _$NullableClassFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart index 3ca6bf704b5..71bb0aa221e 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/number_only.dart @@ -33,13 +33,15 @@ class NumberOnly { - @override - bool operator ==(Object other) => identical(this, other) || other is NumberOnly && - other.justNumber == justNumber; - @override - int get hashCode => - justNumber.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is NumberOnly && + other.justNumber == justNumber; + + @override + int get hashCode => + justNumber.hashCode; factory NumberOnly.fromJson(Map json) => _$NumberOnlyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart index e4eb5263113..7beda7d4aa8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/object_with_deprecated_fields.dart @@ -79,19 +79,21 @@ class ObjectWithDeprecatedFields { - @override - bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && - other.uuid == uuid && - other.id == id && - other.deprecatedRef == deprecatedRef && - other.bars == bars; - @override - int get hashCode => - uuid.hashCode + - id.hashCode + - deprecatedRef.hashCode + - bars.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ObjectWithDeprecatedFields && + other.uuid == uuid && + other.id == id && + other.deprecatedRef == deprecatedRef && + other.bars == bars; + + @override + int get hashCode => + uuid.hashCode + + id.hashCode + + deprecatedRef.hashCode + + bars.hashCode; factory ObjectWithDeprecatedFields.fromJson(Map json) => _$ObjectWithDeprecatedFieldsFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart index 54134b51131..00b4e62e0a1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/order.dart @@ -104,23 +104,25 @@ class Order { - @override - bool operator ==(Object other) => identical(this, other) || other is Order && - other.id == id && - other.petId == petId && - other.quantity == quantity && - other.shipDate == shipDate && - other.status == status && - other.complete == complete; - @override - int get hashCode => - id.hashCode + - petId.hashCode + - quantity.hashCode + - shipDate.hashCode + - status.hashCode + - complete.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Order && + other.id == id && + other.petId == petId && + other.quantity == quantity && + other.shipDate == shipDate && + other.status == status && + other.complete == complete; + + @override + int get hashCode => + id.hashCode + + petId.hashCode + + quantity.hashCode + + shipDate.hashCode + + status.hashCode + + complete.hashCode; factory Order.fromJson(Map json) => _$OrderFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart index f2509cb9921..9986dc4f7d1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_composite.dart @@ -61,17 +61,19 @@ class OuterComposite { - @override - bool operator ==(Object other) => identical(this, other) || other is OuterComposite && - other.myNumber == myNumber && - other.myString == myString && - other.myBoolean == myBoolean; - @override - int get hashCode => - myNumber.hashCode + - myString.hashCode + - myBoolean.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterComposite && + other.myNumber == myNumber && + other.myString == myString && + other.myBoolean == myBoolean; + + @override + int get hashCode => + myNumber.hashCode + + myString.hashCode + + myBoolean.hashCode; factory OuterComposite.fromJson(Map json) => _$OuterCompositeFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart index c3ba7b26a6b..e7687f47c55 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnum { - @JsonValue(r'placed') - placed(r'placed'), - @JsonValue(r'approved') - approved(r'approved'), - @JsonValue(r'delivered') - delivered(r'delivered'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'placed') + placed(r'placed'), + @JsonValue(r'approved') + approved(r'approved'), + @JsonValue(r'delivered') + delivered(r'delivered'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const OuterEnum(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart index 955683b929b..e232c230492 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_default_value.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumDefaultValue { - @JsonValue(r'placed') - placed(r'placed'), - @JsonValue(r'approved') - approved(r'approved'), - @JsonValue(r'delivered') - delivered(r'delivered'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'placed') + placed(r'placed'), + @JsonValue(r'approved') + approved(r'approved'), + @JsonValue(r'delivered') + delivered(r'delivered'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const OuterEnumDefaultValue(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart index b1464c0dda3..304ecf5f51f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumInteger { - @JsonValue(0) - number0('0'), - @JsonValue(1) - number1('1'), - @JsonValue(2) - number2('2'), - @JsonValue(11184809) - unknownDefaultOpenApi('11184809'); + @JsonValue(0) + number0('0'), + @JsonValue(1) + number1('1'), + @JsonValue(2) + number2('2'), + @JsonValue(11184809) + unknownDefaultOpenApi('11184809'); const OuterEnumInteger(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart index 64c416abec7..6483e0b837f 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_enum_integer_default_value.dart @@ -7,14 +7,14 @@ import 'package:json_annotation/json_annotation.dart'; enum OuterEnumIntegerDefaultValue { - @JsonValue(0) - number0('0'), - @JsonValue(1) - number1('1'), - @JsonValue(2) - number2('2'), - @JsonValue(11184809) - unknownDefaultOpenApi('11184809'); + @JsonValue(0) + number0('0'), + @JsonValue(1) + number1('1'), + @JsonValue(2) + number2('2'), + @JsonValue(11184809) + unknownDefaultOpenApi('11184809'); const OuterEnumIntegerDefaultValue(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart index 76d18676a11..a8602e9183a 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/outer_object_with_enum_property.dart @@ -34,13 +34,15 @@ class OuterObjectWithEnumProperty { - @override - bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && - other.value == value; - @override - int get hashCode => - value.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is OuterObjectWithEnumProperty && + other.value == value; + + @override + int get hashCode => + value.hashCode; factory OuterObjectWithEnumProperty.fromJson(Map json) => _$OuterObjectWithEnumPropertyFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart index 0490c4b2b07..880c2c33cec 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/parent_with_nullable.dart @@ -47,15 +47,17 @@ class ParentWithNullable { - @override - bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && - other.type == type && - other.nullableProperty == nullableProperty; - @override - int get hashCode => - type.hashCode + - (nullableProperty == null ? 0 : nullableProperty.hashCode); + + @override + bool operator ==(Object other) => identical(this, other) || other is ParentWithNullable && + other.type == type && + other.nullableProperty == nullableProperty; + + @override + int get hashCode => + type.hashCode + + (nullableProperty == null ? 0 : nullableProperty.hashCode); factory ParentWithNullable.fromJson(Map json) => _$ParentWithNullableFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart index 28d6294bae5..1e7a108b760 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/pet.dart @@ -106,23 +106,25 @@ class Pet { - @override - bool operator ==(Object other) => identical(this, other) || other is Pet && - other.id == id && - other.category == category && - other.name == name && - other.photoUrls == photoUrls && - other.tags == tags && - other.status == status; - @override - int get hashCode => - id.hashCode + - category.hashCode + - name.hashCode + - photoUrls.hashCode + - tags.hashCode + - status.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Pet && + other.id == id && + other.category == category && + other.name == name && + other.photoUrls == photoUrls && + other.tags == tags && + other.status == status; + + @override + int get hashCode => + id.hashCode + + category.hashCode + + name.hashCode + + photoUrls.hashCode + + tags.hashCode + + status.hashCode; factory Pet.fromJson(Map json) => _$PetFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart index c71c088f138..0a57599c7c3 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/read_only_first.dart @@ -47,15 +47,17 @@ class ReadOnlyFirst { - @override - bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && - other.bar == bar && - other.baz == baz; - @override - int get hashCode => - bar.hashCode + - baz.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is ReadOnlyFirst && + other.bar == bar && + other.baz == baz; + + @override + int get hashCode => + bar.hashCode + + baz.hashCode; factory ReadOnlyFirst.fromJson(Map json) => _$ReadOnlyFirstFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart index 9ee2644bf81..3ea636c76a1 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/single_ref_type.dart @@ -7,12 +7,12 @@ import 'package:json_annotation/json_annotation.dart'; enum SingleRefType { - @JsonValue(r'admin') - admin(r'admin'), - @JsonValue(r'user') - user(r'user'), - @JsonValue(r'unknown_default_open_api') - unknownDefaultOpenApi(r'unknown_default_open_api'); + @JsonValue(r'admin') + admin(r'admin'), + @JsonValue(r'user') + user(r'user'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); const SingleRefType(this.value); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart index acd3ba09957..d3a033358f8 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/special_model_name.dart @@ -33,13 +33,15 @@ class SpecialModelName { - @override - bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && - other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - @override - int get hashCode => - dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is SpecialModelName && + other.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket == dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; + + @override + int get hashCode => + dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket.hashCode; factory SpecialModelName.fromJson(Map json) => _$SpecialModelNameFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart index d8a87eec182..00c6ff8cb70 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/tag.dart @@ -47,15 +47,17 @@ class Tag { - @override - bool operator ==(Object other) => identical(this, other) || other is Tag && - other.id == id && - other.name == name; - @override - int get hashCode => - id.hashCode + - name.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Tag && + other.id == id && + other.name == name; + + @override + int get hashCode => + id.hashCode + + name.hashCode; factory Tag.fromJson(Map json) => _$TagFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart index f00e1d91eb5..8f5947509ba 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/test_inline_freeform_additional_properties_request.dart @@ -33,13 +33,15 @@ class TestInlineFreeformAdditionalPropertiesRequest { - @override - bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && - other.someProperty == someProperty; - @override - int get hashCode => - someProperty.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is TestInlineFreeformAdditionalPropertiesRequest && + other.someProperty == someProperty; + + @override + int get hashCode => + someProperty.hashCode; factory TestInlineFreeformAdditionalPropertiesRequest.fromJson(Map json) => _$TestInlineFreeformAdditionalPropertiesRequestFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart index 62f132ce776..44a437d5134 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/lib/src/model/user.dart @@ -132,27 +132,29 @@ class User { - @override - bool operator ==(Object other) => identical(this, other) || other is User && - other.id == id && - other.username == username && - other.firstName == firstName && - other.lastName == lastName && - other.email == email && - other.password == password && - other.phone == phone && - other.userStatus == userStatus; - @override - int get hashCode => - id.hashCode + - username.hashCode + - firstName.hashCode + - lastName.hashCode + - email.hashCode + - password.hashCode + - phone.hashCode + - userStatus.hashCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is User && + other.id == id && + other.username == username && + other.firstName == firstName && + other.lastName == lastName && + other.email == email && + other.password == password && + other.phone == phone && + other.userStatus == userStatus; + + @override + int get hashCode => + id.hashCode + + username.hashCode + + firstName.hashCode + + lastName.hashCode + + email.hashCode + + password.hashCode + + phone.hashCode + + userStatus.hashCode; factory User.fromJson(Map json) => _$UserFromJson(json); diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml index dc16507435f..8a32778ad38 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml index de93663746d..efc0d4ccd70 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/pubspec.yaml @@ -4,7 +4,7 @@ description: OpenAPI API client homepage: homepage environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml index 8475e362b88..5b4ebb1c5c0 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml @@ -5,7 +5,7 @@ description: OpenAPI API Dart DIO client tests for petstore_client_lib_fake publish_to: none environment: - sdk: '>=2.15.0 <3.0.0' + sdk: '>=2.15.0 <4.0.0' dev_dependencies: built_collection: 5.1.1 diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml b/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml index f0330284329..72a2cdd8d13 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/pubspec.yaml @@ -7,7 +7,7 @@ version: '1.0.0' description: 'OpenAPI API client' homepage: 'homepage' environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0' diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml index f0330284329..72a2cdd8d13 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/pubspec.yaml @@ -7,7 +7,7 @@ version: '1.0.0' description: 'OpenAPI API client' homepage: 'homepage' environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: collection: '^1.17.0' http: '>=0.13.0 <0.14.0' diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go index 27e96506524..3174a5c333e 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/client.go @@ -163,7 +163,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index aab1677559d..5950806508b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -181,7 +181,7 @@ func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix stri return } if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), collectionType) return } value = v.Type().String() + " value" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml index 61960dfc743..fc30e929e53 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar and b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/.github/workflows/maven.yml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.jar and b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.properties +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew.bat +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/.github/workflows/maven.yml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.jar and b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.properties +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew.bat +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml b/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml index 1dc4b505d7e..460f78bfd1b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '8' ] + java: [ 17, 21 ] steps: - uses: actions/checkout@v4 - name: Set up JDK diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md index 3f39832529b..258d87e5699 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ChildCat.md @@ -16,7 +16,7 @@ | Name | Value | |---- | -----| -| CHILDCAT | "ChildCat" | +| CHILD_CAT | "ChildCat" | diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar and b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - JAVACMD=$( cygpath --unix "$JAVACMD" ) +JAVACMD=$( cygpath --unix "$JAVACMD" ) - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat +++ b/samples/openapi3/client/petstore/java/jersey2-java8/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES index f7e65690c39..6b44ba44379 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-aiohttp/.openapi-generator/FILES @@ -17,6 +17,7 @@ docs/ArrayOfArrayOfModel.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md +docs/BaseDiscriminator.md docs/BasquePig.md docs/Bathing.md docs/Capitalization.md @@ -53,6 +54,7 @@ docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/ImportTestDatetimeApi.md +docs/Info.md docs/InnerDictWithProperty.md docs/InputAllOf.md docs/IntOrString.md @@ -84,6 +86,7 @@ docs/Pet.md docs/PetApi.md docs/Pig.md docs/PoopCleaning.md +docs/PrimitiveString.md docs/PropertyMap.md docs/PropertyNameCollision.md docs/ReadOnlyFirst.md @@ -137,6 +140,7 @@ petstore_api/models/array_of_array_of_model.py petstore_api/models/array_of_array_of_number_only.py petstore_api/models/array_of_number_only.py petstore_api/models/array_test.py +petstore_api/models/base_discriminator.py petstore_api/models/basque_pig.py petstore_api/models/bathing.py petstore_api/models/capitalization.py @@ -169,6 +173,7 @@ petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/info.py petstore_api/models/inner_dict_with_property.py petstore_api/models/input_all_of.py petstore_api/models/int_or_string.py @@ -199,6 +204,7 @@ petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/poop_cleaning.py +petstore_api/models/primitive_string.py petstore_api/models/property_map.py petstore_api/models/property_name_collision.py petstore_api/models/read_only_first.py diff --git a/samples/openapi3/client/petstore/python-aiohttp/README.md b/samples/openapi3/client/petstore/python-aiohttp/README.md index d89ff974b14..20a105cf2b9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-aiohttp/README.md @@ -163,6 +163,7 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BaseDiscriminator](docs/BaseDiscriminator.md) - [BasquePig](docs/BasquePig.md) - [Bathing](docs/Bathing.md) - [Capitalization](docs/Capitalization.md) @@ -195,6 +196,7 @@ Class | Method | HTTP request | Description - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [Info](docs/Info.md) - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [InputAllOf](docs/InputAllOf.md) - [IntOrString](docs/IntOrString.md) @@ -225,6 +227,7 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [PoopCleaning](docs/PoopCleaning.md) + - [PrimitiveString](docs/PrimitiveString.md) - [PropertyMap](docs/PropertyMap.md) - [PropertyNameCollision](docs/PropertyNameCollision.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesAnyType.md index a47fbd73260..314cba3a614 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesAnyType.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesAnyType.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesAnyType.to_json()) # convert the object into a dict additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict() # create an instance of AdditionalPropertiesAnyType from a dict -additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict) +additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesClass.md index a19d1b338e6..8d4c08707f5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesClass.md @@ -23,7 +23,7 @@ print(AdditionalPropertiesClass.to_json()) # convert the object into a dict additional_properties_class_dict = additional_properties_class_instance.to_dict() # create an instance of AdditionalPropertiesClass from a dict -additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict) +additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesObject.md index f9c516ee9b6..d647ec64896 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesObject.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesObject.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesObject.to_json()) # convert the object into a dict additional_properties_object_dict = additional_properties_object_instance.to_dict() # create an instance of AdditionalPropertiesObject from a dict -additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict) +additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md index 3dbb9c6f3e9..061f5524872 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesWithDescriptionOnly.to_json()) # convert the object into a dict additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict() # create an instance of AdditionalPropertiesWithDescriptionOnly from a dict -additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict) +additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfSuperModel.md index 1262bd9dc51..421a1527f1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfSuperModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfSuperModel.md @@ -22,7 +22,7 @@ print(AllOfSuperModel.to_json()) # convert the object into a dict all_of_super_model_dict = all_of_super_model_instance.to_dict() # create an instance of AllOfSuperModel from a dict -all_of_super_model_form_dict = all_of_super_model.from_dict(all_of_super_model_dict) +all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfWithSingleRef.md index 6c2860c02f5..203a4b5da3d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AllOfWithSingleRef.md @@ -23,7 +23,7 @@ print(AllOfWithSingleRef.to_json()) # convert the object into a dict all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict() # create an instance of AllOfWithSingleRef from a dict -all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict) +all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Animal.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Animal.md index 4c693f09e5f..381d27b66e4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Animal.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Animal.md @@ -23,7 +23,7 @@ print(Animal.to_json()) # convert the object into a dict animal_dict = animal_instance.to_dict() # create an instance of Animal from a dict -animal_form_dict = animal.from_dict(animal_dict) +animal_from_dict = Animal.from_dict(animal_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfColor.md index ccaf51ce9fe..6ed75dd7b48 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfColor.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfColor.md @@ -22,7 +22,7 @@ print(AnyOfColor.to_json()) # convert the object into a dict any_of_color_dict = any_of_color_instance.to_dict() # create an instance of AnyOfColor from a dict -any_of_color_form_dict = any_of_color.from_dict(any_of_color_dict) +any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfPig.md index 52109d6670c..9367e226189 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfPig.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/AnyOfPig.md @@ -24,7 +24,7 @@ print(AnyOfPig.to_json()) # convert the object into a dict any_of_pig_dict = any_of_pig_instance.to_dict() # create an instance of AnyOfPig from a dict -any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict) +any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfModel.md index 1cd9c367b26..f866863d53f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfModel.md @@ -22,7 +22,7 @@ print(ArrayOfArrayOfModel.to_json()) # convert the object into a dict array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict() # create an instance of ArrayOfArrayOfModel from a dict -array_of_array_of_model_form_dict = array_of_array_of_model.from_dict(array_of_array_of_model_dict) +array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfNumberOnly.md index 3ad18d346f6..32bd2dfbf1e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfArrayOfNumberOnly.md @@ -22,7 +22,7 @@ print(ArrayOfArrayOfNumberOnly.to_json()) # convert the object into a dict array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict() # create an instance of ArrayOfArrayOfNumberOnly from a dict -array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict) +array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfNumberOnly.md index a606e3a54bb..b814d759494 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayOfNumberOnly.md @@ -22,7 +22,7 @@ print(ArrayOfNumberOnly.to_json()) # convert the object into a dict array_of_number_only_dict = array_of_number_only_instance.to_dict() # create an instance of ArrayOfNumberOnly from a dict -array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict) +array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayTest.md index a673e8a2893..ed871fae662 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ArrayTest.md @@ -25,7 +25,7 @@ print(ArrayTest.to_json()) # convert the object into a dict array_test_dict = array_test_instance.to_dict() # create an instance of ArrayTest from a dict -array_test_form_dict = array_test.from_dict(array_test_dict) +array_test_from_dict = ArrayTest.from_dict(array_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python-aiohttp/docs/BaseDiscriminator.md new file mode 100644 index 00000000000..fcdbeb032e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/BaseDiscriminator.md @@ -0,0 +1,29 @@ +# BaseDiscriminator + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.base_discriminator import BaseDiscriminator + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDiscriminator from a JSON string +base_discriminator_instance = BaseDiscriminator.from_json(json) +# print the JSON string representation of the object +print(BaseDiscriminator.to_json()) + +# convert the object into a dict +base_discriminator_dict = base_discriminator_instance.to_dict() +# create an instance of BaseDiscriminator from a dict +base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/BasquePig.md b/samples/openapi3/client/petstore/python-aiohttp/docs/BasquePig.md index aa3b3d28b3e..ee28d628722 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/BasquePig.md @@ -23,7 +23,7 @@ print(BasquePig.to_json()) # convert the object into a dict basque_pig_dict = basque_pig_instance.to_dict() # create an instance of BasquePig from a dict -basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict) +basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Bathing.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Bathing.md index bb8d40ac8ab..6ad70e2f67c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Bathing.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Bathing.md @@ -24,7 +24,7 @@ print(Bathing.to_json()) # convert the object into a dict bathing_dict = bathing_instance.to_dict() # create an instance of Bathing from a dict -bathing_form_dict = bathing.from_dict(bathing_dict) +bathing_from_dict = Bathing.from_dict(bathing_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Capitalization.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Capitalization.md index 7f1a36413d5..6f564a8ed8c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Capitalization.md @@ -27,7 +27,7 @@ print(Capitalization.to_json()) # convert the object into a dict capitalization_dict = capitalization_instance.to_dict() # create an instance of Capitalization from a dict -capitalization_form_dict = capitalization.from_dict(capitalization_dict) +capitalization_from_dict = Capitalization.from_dict(capitalization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Cat.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Cat.md index a2d4b88805f..d0e39efdb33 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Cat.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Cat.md @@ -22,7 +22,7 @@ print(Cat.to_json()) # convert the object into a dict cat_dict = cat_instance.to_dict() # create an instance of Cat from a dict -cat_form_dict = cat.from_dict(cat_dict) +cat_from_dict = Cat.from_dict(cat_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Category.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Category.md index 24160009af4..dbde14b7344 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Category.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Category.md @@ -23,7 +23,7 @@ print(Category.to_json()) # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python-aiohttp/docs/CircularAllOfRef.md index a00be37d4d1..65b171177e5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/CircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/CircularAllOfRef.md @@ -23,7 +23,7 @@ print(CircularAllOfRef.to_json()) # convert the object into a dict circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict() # create an instance of CircularAllOfRef from a dict -circular_all_of_ref_form_dict = circular_all_of_ref.from_dict(circular_all_of_ref_dict) +circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/CircularReferenceModel.md index 6695d4a7613..87216f7273a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/CircularReferenceModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/CircularReferenceModel.md @@ -23,7 +23,7 @@ print(CircularReferenceModel.to_json()) # convert the object into a dict circular_reference_model_dict = circular_reference_model_instance.to_dict() # create an instance of CircularReferenceModel from a dict -circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ClassModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ClassModel.md index 25351614fa4..ea76a5c157b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ClassModel.md @@ -23,7 +23,7 @@ print(ClassModel.to_json()) # convert the object into a dict class_model_dict = class_model_instance.to_dict() # create an instance of ClassModel from a dict -class_model_form_dict = class_model.from_dict(class_model_dict) +class_model_from_dict = ClassModel.from_dict(class_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Client.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Client.md index b601737b02f..22321c18915 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Client.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Client.md @@ -22,7 +22,7 @@ print(Client.to_json()) # convert the object into a dict client_dict = client_instance.to_dict() # create an instance of Client from a dict -client_form_dict = client.from_dict(client_dict) +client_from_dict = Client.from_dict(client_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Color.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Color.md index 9bd63f91d7c..9ac3ab2e91f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Color.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Color.md @@ -22,7 +22,7 @@ print(Color.to_json()) # convert the object into a dict color_dict = color_instance.to_dict() # create an instance of Color from a dict -color_form_dict = color.from_dict(color_dict) +color_from_dict = Color.from_dict(color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Creature.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Creature.md index fa1ec65401b..a4710214c19 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Creature.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Creature.md @@ -23,7 +23,7 @@ print(Creature.to_json()) # convert the object into a dict creature_dict = creature_instance.to_dict() # create an instance of Creature from a dict -creature_form_dict = creature.from_dict(creature_dict) +creature_from_dict = Creature.from_dict(creature_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python-aiohttp/docs/CreatureInfo.md index fe4ab81a807..db3b82bb9ff 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/CreatureInfo.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/CreatureInfo.md @@ -22,7 +22,7 @@ print(CreatureInfo.to_json()) # convert the object into a dict creature_info_dict = creature_info_instance.to_dict() # create an instance of CreatureInfo from a dict -creature_info_form_dict = creature_info.from_dict(creature_info_dict) +creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DanishPig.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DanishPig.md index 6aef777ffe0..16941388832 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DanishPig.md @@ -23,7 +23,7 @@ print(DanishPig.to_json()) # convert the object into a dict danish_pig_dict = danish_pig_instance.to_dict() # create an instance of DanishPig from a dict -danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict) +danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DeprecatedObject.md index 5de685050ff..6b362f379ba 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DeprecatedObject.md @@ -22,7 +22,7 @@ print(DeprecatedObject.to_json()) # convert the object into a dict deprecated_object_dict = deprecated_object_instance.to_dict() # create an instance of DeprecatedObject from a dict -deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict) +deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md index e7cd36010f5..f72b6e8e68c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSub.md @@ -21,7 +21,7 @@ print(DiscriminatorAllOfSub.to_json()) # convert the object into a dict discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() # create an instance of DiscriminatorAllOfSub from a dict -discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md index 4859a9a6d40..477c05bfc44 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DiscriminatorAllOfSuper.md @@ -22,7 +22,7 @@ print(DiscriminatorAllOfSuper.to_json()) # convert the object into a dict discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() # create an instance of DiscriminatorAllOfSuper from a dict -discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Dog.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Dog.md index ecb20592957..ed23f613d01 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Dog.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Dog.md @@ -22,7 +22,7 @@ print(Dog.to_json()) # convert the object into a dict dog_dict = dog_instance.to_dict() # create an instance of Dog from a dict -dog_form_dict = dog.from_dict(dog_dict) +dog_from_dict = Dog.from_dict(dog_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/DummyModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/DummyModel.md index 21a59bef1bf..01b675977f5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/DummyModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/DummyModel.md @@ -23,7 +23,7 @@ print(DummyModel.to_json()) # convert the object into a dict dummy_model_dict = dummy_model_instance.to_dict() # create an instance of DummyModel from a dict -dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict) +dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumArrays.md index 6a5293dfcc6..f44617497bc 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumArrays.md @@ -23,7 +23,7 @@ print(EnumArrays.to_json()) # convert the object into a dict enum_arrays_dict = enum_arrays_instance.to_dict() # create an instance of EnumArrays from a dict -enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict) +enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md index 494a4d054f0..dd37f9cc7b4 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/EnumTest.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **enum_integer_default** | **int** | | [optional] [default to 5] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] +**enum_number_vendor_ext** | **int** | | [optional] +**enum_string_vendor_ext** | **str** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] **outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] @@ -30,7 +32,7 @@ print(EnumTest.to_json()) # convert the object into a dict enum_test_dict = enum_test_instance.to_dict() # create an instance of EnumTest from a dict -enum_test_form_dict = enum_test.from_dict(enum_test_dict) +enum_test_from_dict = EnumTest.from_dict(enum_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Feeding.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Feeding.md index 7d1e83627dd..9f92b5d964d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Feeding.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Feeding.md @@ -24,7 +24,7 @@ print(Feeding.to_json()) # convert the object into a dict feeding_dict = feeding_instance.to_dict() # create an instance of Feeding from a dict -feeding_form_dict = feeding.from_dict(feeding_dict) +feeding_from_dict = Feeding.from_dict(feeding_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/File.md b/samples/openapi3/client/petstore/python-aiohttp/docs/File.md index 1b03d58761c..23f0567411c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/File.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/File.md @@ -23,7 +23,7 @@ print(File.to_json()) # convert the object into a dict file_dict = file_instance.to_dict() # create an instance of File from a dict -file_form_dict = file.from_dict(file_dict) +file_from_dict = File.from_dict(file_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FileSchemaTestClass.md index 26a1758abfe..e1118042a8e 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FileSchemaTestClass.md @@ -23,7 +23,7 @@ print(FileSchemaTestClass.to_json()) # convert the object into a dict file_schema_test_class_dict = file_schema_test_class_instance.to_dict() # create an instance of FileSchemaTestClass from a dict -file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict) +file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FirstRef.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FirstRef.md index 5092de432d3..94b8ddc5ac2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FirstRef.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FirstRef.md @@ -23,7 +23,7 @@ print(FirstRef.to_json()) # convert the object into a dict first_ref_dict = first_ref_instance.to_dict() # create an instance of FirstRef from a dict -first_ref_form_dict = first_ref.from_dict(first_ref_dict) +first_ref_from_dict = FirstRef.from_dict(first_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Foo.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Foo.md index 020b8d75b76..f635b0daa6d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Foo.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Foo.md @@ -22,7 +22,7 @@ print(Foo.to_json()) # convert the object into a dict foo_dict = foo_instance.to_dict() # create an instance of Foo from a dict -foo_form_dict = foo.from_dict(foo_dict) +foo_from_dict = Foo.from_dict(foo_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FooGetDefaultResponse.md index 755c3232bbf..8d84f795b00 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FooGetDefaultResponse.md @@ -22,7 +22,7 @@ print(FooGetDefaultResponse.to_json()) # convert the object into a dict foo_get_default_response_dict = foo_get_default_response_instance.to_dict() # create an instance of FooGetDefaultResponse from a dict -foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict) +foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/FormatTest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/FormatTest.md index 3b2f44457f1..6be7fc01757 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/FormatTest.md @@ -38,7 +38,7 @@ print(FormatTest.to_json()) # convert the object into a dict format_test_dict = format_test_instance.to_dict() # create an instance of FormatTest from a dict -format_test_form_dict = format_test.from_dict(format_test_dict) +format_test_from_dict = FormatTest.from_dict(format_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-aiohttp/docs/HasOnlyReadOnly.md index 00d2af2fd33..fdc48781b15 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/HasOnlyReadOnly.md @@ -23,7 +23,7 @@ print(HasOnlyReadOnly.to_json()) # convert the object into a dict has_only_read_only_dict = has_only_read_only_instance.to_dict() # create an instance of HasOnlyReadOnly from a dict -has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict) +has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-aiohttp/docs/HealthCheckResult.md index d32450f4c2e..d4a2b187167 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/HealthCheckResult.md @@ -23,7 +23,7 @@ print(HealthCheckResult.to_json()) # convert the object into a dict health_check_result_dict = health_check_result_instance.to_dict() # create an instance of HealthCheckResult from a dict -health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict) +health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Info.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Info.md new file mode 100644 index 00000000000..db88778a914 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Info.md @@ -0,0 +1,29 @@ +# Info + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional] + +## Example + +```python +from petstore_api.models.info import Info + +# TODO update the JSON string below +json = "{}" +# create an instance of Info from a JSON string +info_instance = Info.from_json(json) +# print the JSON string representation of the object +print(Info.to_json()) + +# convert the object into a dict +info_dict = info_instance.to_dict() +# create an instance of Info from a dict +info_from_dict = Info.from_dict(info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-aiohttp/docs/InnerDictWithProperty.md index efd91b13f3a..7b82ebb770b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/InnerDictWithProperty.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/InnerDictWithProperty.md @@ -22,7 +22,7 @@ print(InnerDictWithProperty.to_json()) # convert the object into a dict inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() # create an instance of InnerDictWithProperty from a dict -inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/InputAllOf.md b/samples/openapi3/client/petstore/python-aiohttp/docs/InputAllOf.md index 7d6404e3f27..45298f5308f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/InputAllOf.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/InputAllOf.md @@ -22,7 +22,7 @@ print(InputAllOf.to_json()) # convert the object into a dict input_all_of_dict = input_all_of_instance.to_dict() # create an instance of InputAllOf from a dict -input_all_of_form_dict = input_all_of.from_dict(input_all_of_dict) +input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/IntOrString.md b/samples/openapi3/client/petstore/python-aiohttp/docs/IntOrString.md index c2f6fd5838e..b4070b9a8c7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/IntOrString.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/IntOrString.md @@ -21,7 +21,7 @@ print(IntOrString.to_json()) # convert the object into a dict int_or_string_dict = int_or_string_instance.to_dict() # create an instance of IntOrString from a dict -int_or_string_form_dict = int_or_string.from_dict(int_or_string_dict) +int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ListClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ListClass.md index 3595f39de14..01068b7d22c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ListClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ListClass.md @@ -22,7 +22,7 @@ print(ListClass.to_json()) # convert the object into a dict list_class_dict = list_class_instance.to_dict() # create an instance of ListClass from a dict -list_class_form_dict = list_class.from_dict(list_class_dict) +list_class_from_dict = ListClass.from_dict(list_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/MapOfArrayOfModel.md index 2220ab1f7c4..71a4ef66b68 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/MapOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/MapOfArrayOfModel.md @@ -22,7 +22,7 @@ print(MapOfArrayOfModel.to_json()) # convert the object into a dict map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict() # create an instance of MapOfArrayOfModel from a dict -map_of_array_of_model_form_dict = map_of_array_of_model.from_dict(map_of_array_of_model_dict) +map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/MapTest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/MapTest.md index bd62a851e92..d04b82e9378 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/MapTest.md @@ -25,7 +25,7 @@ print(MapTest.to_json()) # convert the object into a dict map_test_dict = map_test_instance.to_dict() # create an instance of MapTest from a dict -map_test_form_dict = map_test.from_dict(map_test_dict) +map_test_from_dict = MapTest.from_dict(map_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 7cab16af173..0dc994275d1 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -24,7 +24,7 @@ print(MixedPropertiesAndAdditionalPropertiesClass.to_json()) # convert the object into a dict mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict() # create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict -mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict) +mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Model200Response.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Model200Response.md index 454a4fcf30a..7fdbdefc6ce 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Model200Response.md @@ -24,7 +24,7 @@ print(Model200Response.to_json()) # convert the object into a dict model200_response_dict = model200_response_instance.to_dict() # create an instance of Model200Response from a dict -model200_response_form_dict = model200_response.from_dict(model200_response_dict) +model200_response_from_dict = Model200Response.from_dict(model200_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelApiResponse.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelApiResponse.md index 8e0a033bd64..5ddc0db2a0f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelApiResponse.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelApiResponse.md @@ -24,7 +24,7 @@ print(ModelApiResponse.to_json()) # convert the object into a dict model_api_response_dict = model_api_response_instance.to_dict() # create an instance of ModelApiResponse from a dict -model_api_response_form_dict = model_api_response.from_dict(model_api_response_dict) +model_api_response_from_dict = ModelApiResponse.from_dict(model_api_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelField.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelField.md index f5f03fd82d2..9073b5dbdb0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelField.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelField.md @@ -22,7 +22,7 @@ print(ModelField.to_json()) # convert the object into a dict model_field_dict = model_field_instance.to_dict() # create an instance of ModelField from a dict -model_field_form_dict = model_field.from_dict(model_field_dict) +model_field_from_dict = ModelField.from_dict(model_field_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelReturn.md index 6b660953e1d..7d327053b0c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ModelReturn.md @@ -23,7 +23,7 @@ print(ModelReturn.to_json()) # convert the object into a dict model_return_dict = model_return_instance.to_dict() # create an instance of ModelReturn from a dict -model_return_form_dict = model_return.from_dict(model_return_dict) +model_return_from_dict = ModelReturn.from_dict(model_return_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Name.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Name.md index 5c5986a76d0..5a04ec1ada0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Name.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Name.md @@ -26,7 +26,7 @@ print(Name.to_json()) # convert the object into a dict name_dict = name_instance.to_dict() # create an instance of Name from a dict -name_form_dict = name.from_dict(name_dict) +name_from_dict = Name.from_dict(name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/NullableClass.md b/samples/openapi3/client/petstore/python-aiohttp/docs/NullableClass.md index 3657d21255c..0387dcc2c67 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/NullableClass.md @@ -34,7 +34,7 @@ print(NullableClass.to_json()) # convert the object into a dict nullable_class_dict = nullable_class_instance.to_dict() # create an instance of NullableClass from a dict -nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict) +nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/NullableProperty.md b/samples/openapi3/client/petstore/python-aiohttp/docs/NullableProperty.md index 27ce3192f84..30edaf4844b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/NullableProperty.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/NullableProperty.md @@ -23,7 +23,7 @@ print(NullableProperty.to_json()) # convert the object into a dict nullable_property_dict = nullable_property_instance.to_dict() # create an instance of NullableProperty from a dict -nullable_property_form_dict = nullable_property.from_dict(nullable_property_dict) +nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-aiohttp/docs/NumberOnly.md index 72e0a4bfde0..415dd25585d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/NumberOnly.md @@ -22,7 +22,7 @@ print(NumberOnly.to_json()) # convert the object into a dict number_only_dict = number_only_instance.to_dict() # create an instance of NumberOnly from a dict -number_only_form_dict = number_only.from_dict(number_only_dict) +number_only_from_dict = NumberOnly.from_dict(number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectToTestAdditionalProperties.md index 5d2c76c8958..f6bc34c98e6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectToTestAdditionalProperties.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectToTestAdditionalProperties.md @@ -23,7 +23,7 @@ print(ObjectToTestAdditionalProperties.to_json()) # convert the object into a dict object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict() # create an instance of ObjectToTestAdditionalProperties from a dict -object_to_test_additional_properties_form_dict = object_to_test_additional_properties.from_dict(object_to_test_additional_properties_dict) +object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectWithDeprecatedFields.md index b1077a60b95..6dbd2ace04f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ObjectWithDeprecatedFields.md @@ -25,7 +25,7 @@ print(ObjectWithDeprecatedFields.to_json()) # convert the object into a dict object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict() # create an instance of ObjectWithDeprecatedFields from a dict -object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict) +object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OneOfEnumString.md index 25fc402280f..1d385c09293 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OneOfEnumString.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OneOfEnumString.md @@ -22,7 +22,7 @@ print(OneOfEnumString.to_json()) # convert the object into a dict one_of_enum_string_dict = one_of_enum_string_instance.to_dict() # create an instance of OneOfEnumString from a dict -one_of_enum_string_form_dict = one_of_enum_string.from_dict(one_of_enum_string_dict) +one_of_enum_string_from_dict = OneOfEnumString.from_dict(one_of_enum_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Order.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Order.md index 08b602f1669..00526b8d04b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Order.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Order.md @@ -27,7 +27,7 @@ print(Order.to_json()) # convert the object into a dict order_dict = order_instance.to_dict() # create an instance of Order from a dict -order_form_dict = order.from_dict(order_dict) +order_from_dict = Order.from_dict(order_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterComposite.md index 9d4401d659b..c8242c2d265 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterComposite.md @@ -24,7 +24,7 @@ print(OuterComposite.to_json()) # convert the object into a dict outer_composite_dict = outer_composite_instance.to_dict() # create an instance of OuterComposite from a dict -outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict) +outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterObjectWithEnumProperty.md index beffcbe2545..6137dbd98da 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/OuterObjectWithEnumProperty.md @@ -23,7 +23,7 @@ print(OuterObjectWithEnumProperty.to_json()) # convert the object into a dict outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict() # create an instance of OuterObjectWithEnumProperty from a dict -outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict) +outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Parent.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Parent.md index 3b71011330d..7387f9250aa 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Parent.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Parent.md @@ -22,7 +22,7 @@ print(Parent.to_json()) # convert the object into a dict parent_dict = parent_instance.to_dict() # create an instance of Parent from a dict -parent_form_dict = parent.from_dict(parent_dict) +parent_from_dict = Parent.from_dict(parent_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ParentWithOptionalDict.md index 23e11a6dd66..bfc8688ea26 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ParentWithOptionalDict.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ParentWithOptionalDict.md @@ -22,7 +22,7 @@ print(ParentWithOptionalDict.to_json()) # convert the object into a dict parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() # create an instance of ParentWithOptionalDict from a dict -parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Pet.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Pet.md index fa9dc7bf308..5329cf2fb92 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Pet.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Pet.md @@ -27,7 +27,7 @@ print(Pet.to_json()) # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Pig.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Pig.md index 9ad7b790494..62593067608 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Pig.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Pig.md @@ -24,7 +24,7 @@ print(Pig.to_json()) # convert the object into a dict pig_dict = pig_instance.to_dict() # create an instance of Pig from a dict -pig_form_dict = pig.from_dict(pig_dict) +pig_from_dict = Pig.from_dict(pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python-aiohttp/docs/PoopCleaning.md index d96a5db0d4c..8f9c25e0831 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/PoopCleaning.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/PoopCleaning.md @@ -24,7 +24,7 @@ print(PoopCleaning.to_json()) # convert the object into a dict poop_cleaning_dict = poop_cleaning_instance.to_dict() # create an instance of PoopCleaning from a dict -poop_cleaning_form_dict = poop_cleaning.from_dict(poop_cleaning_dict) +poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python-aiohttp/docs/PrimitiveString.md new file mode 100644 index 00000000000..85ceb632e16 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/PrimitiveString.md @@ -0,0 +1,29 @@ +# PrimitiveString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.primitive_string import PrimitiveString + +# TODO update the JSON string below +json = "{}" +# create an instance of PrimitiveString from a JSON string +primitive_string_instance = PrimitiveString.from_json(json) +# print the JSON string representation of the object +print(PrimitiveString.to_json()) + +# convert the object into a dict +primitive_string_dict = primitive_string_instance.to_dict() +# create an instance of PrimitiveString from a dict +primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyMap.md b/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyMap.md index 3b4c0a8cc03..a55a0e5c6f0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyMap.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyMap.md @@ -22,7 +22,7 @@ print(PropertyMap.to_json()) # convert the object into a dict property_map_dict = property_map_instance.to_dict() # create an instance of PropertyMap from a dict -property_map_form_dict = property_map.from_dict(property_map_dict) +property_map_from_dict = PropertyMap.from_dict(property_map_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyNameCollision.md index 1bd7ce5ee2b..40c233670dd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyNameCollision.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/PropertyNameCollision.md @@ -24,7 +24,7 @@ print(PropertyNameCollision.to_json()) # convert the object into a dict property_name_collision_dict = property_name_collision_instance.to_dict() # create an instance of PropertyNameCollision from a dict -property_name_collision_form_dict = property_name_collision.from_dict(property_name_collision_dict) +property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-aiohttp/docs/ReadOnlyFirst.md index 4644f28f56a..686ec5da41c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/ReadOnlyFirst.md @@ -23,7 +23,7 @@ print(ReadOnlyFirst.to_json()) # convert the object into a dict read_only_first_dict = read_only_first_instance.to_dict() # create an instance of ReadOnlyFirst from a dict -read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict) +read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SecondCircularAllOfRef.md index eae28911ed2..65ebdd4c7e1 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SecondCircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SecondCircularAllOfRef.md @@ -23,7 +23,7 @@ print(SecondCircularAllOfRef.to_json()) # convert the object into a dict second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict() # create an instance of SecondCircularAllOfRef from a dict -second_circular_all_of_ref_form_dict = second_circular_all_of_ref.from_dict(second_circular_all_of_ref_dict) +second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/SecondRef.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SecondRef.md index 97c65b8ef79..dfb1a0ac6db 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SecondRef.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SecondRef.md @@ -23,7 +23,7 @@ print(SecondRef.to_json()) # convert the object into a dict second_ref_dict = second_ref_instance.to_dict() # create an instance of SecondRef from a dict -second_ref_form_dict = second_ref.from_dict(second_ref_dict) +second_ref_from_dict = SecondRef.from_dict(second_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SelfReferenceModel.md index 2ca21efd50c..208cdac04b6 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SelfReferenceModel.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SelfReferenceModel.md @@ -23,7 +23,7 @@ print(SelfReferenceModel.to_json()) # convert the object into a dict self_reference_model_dict = self_reference_model_instance.to_dict() # create an instance of SelfReferenceModel from a dict -self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict) +self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialModelName.md index ea1ef0008c8..35303f34efd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialModelName.md @@ -22,7 +22,7 @@ print(SpecialModelName.to_json()) # convert the object into a dict special_model_name_dict = special_model_name_instance.to_dict() # create an instance of SpecialModelName from a dict -special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict) +special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialName.md b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialName.md index c541b0b3d4b..ccc550b16e3 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialName.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/SpecialName.md @@ -24,7 +24,7 @@ print(SpecialName.to_json()) # convert the object into a dict special_name_dict = special_name_instance.to_dict() # create an instance of SpecialName from a dict -special_name_form_dict = special_name.from_dict(special_name_dict) +special_name_from_dict = SpecialName.from_dict(special_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Tag.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Tag.md index a8d1885a938..4106d9cfe5d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Tag.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Tag.md @@ -23,7 +23,7 @@ print(Tag.to_json()) # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Task.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Task.md index 905cc03b65d..211ce76cdfe 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Task.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Task.md @@ -24,7 +24,7 @@ print(Task.to_json()) # convert the object into a dict task_dict = task_instance.to_dict() # create an instance of Task from a dict -task_form_dict = task.from_dict(task_dict) +task_from_dict = Task.from_dict(task_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TaskActivity.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TaskActivity.md index 36159e069b5..e905a477292 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/TaskActivity.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TaskActivity.md @@ -24,7 +24,7 @@ print(TaskActivity.to_json()) # convert the object into a dict task_activity_dict = task_activity_instance.to_dict() # create an instance of TaskActivity from a dict -task_activity_form_dict = task_activity.from_dict(task_activity_dict) +task_activity_from_dict = TaskActivity.from_dict(task_activity_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel400Response.md index 1ff12d238e0..be416bbad0f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel400Response.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel400Response.md @@ -22,7 +22,7 @@ print(TestErrorResponsesWithModel400Response.to_json()) # convert the object into a dict test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel400Response from a dict -test_error_responses_with_model400_response_form_dict = test_error_responses_with_model400_response.from_dict(test_error_responses_with_model400_response_dict) +test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel404Response.md index a62725a99bb..1c984f847bf 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel404Response.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestErrorResponsesWithModel404Response.md @@ -22,7 +22,7 @@ print(TestErrorResponsesWithModel404Response.to_json()) # convert the object into a dict test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel404Response from a dict -test_error_responses_with_model404_response_form_dict = test_error_responses_with_model404_response.from_dict(test_error_responses_with_model404_response_dict) +test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md index d678aa823e1..511132d689b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -22,7 +22,7 @@ print(TestInlineFreeformAdditionalPropertiesRequest.to_json()) # convert the object into a dict test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() # create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict -test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md index 75cd561ffae..ff0ca9ee00a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md @@ -22,7 +22,7 @@ print(TestObjectForMultipartRequestsRequestMarker.to_json()) # convert the object into a dict test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict() # create an instance of TestObjectForMultipartRequestsRequestMarker from a dict -test_object_for_multipart_requests_request_marker_form_dict = test_object_for_multipart_requests_request_marker.from_dict(test_object_for_multipart_requests_request_marker_dict) +test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/Tiger.md b/samples/openapi3/client/petstore/python-aiohttp/docs/Tiger.md index f03552af073..f1cf2133f0f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/Tiger.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/Tiger.md @@ -22,7 +22,7 @@ print(Tiger.to_json()) # convert the object into a dict tiger_dict = tiger_instance.to_dict() # create an instance of Tiger from a dict -tiger_form_dict = tiger.from_dict(tiger_dict) +tiger_from_dict = Tiger.from_dict(tiger_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md index 201a2d8d3e8..68cd00ab0a7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md @@ -22,7 +22,7 @@ print(UnnamedDictWithAdditionalModelListProperties.to_json()) # convert the object into a dict unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalModelListProperties from a dict -unnamed_dict_with_additional_model_list_properties_form_dict = unnamed_dict_with_additional_model_list_properties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) +unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md index 534b6bec797..045b0e22ad0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md @@ -22,7 +22,7 @@ print(UnnamedDictWithAdditionalStringListProperties.to_json()) # convert the object into a dict unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalStringListProperties from a dict -unnamed_dict_with_additional_string_list_properties_form_dict = unnamed_dict_with_additional_string_list_properties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) +unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/User.md b/samples/openapi3/client/petstore/python-aiohttp/docs/User.md index e9d5051b646..c45d26d2704 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/User.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/User.md @@ -29,7 +29,7 @@ print(User.to_json()) # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-aiohttp/docs/WithNestedOneOf.md index 7fdc6cb3d21..e7bbbc28fc2 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/docs/WithNestedOneOf.md +++ b/samples/openapi3/client/petstore/python-aiohttp/docs/WithNestedOneOf.md @@ -24,7 +24,7 @@ print(WithNestedOneOf.to_json()) # convert the object into a dict with_nested_one_of_dict = with_nested_one_of_instance.to_dict() # create an instance of WithNestedOneOf from a dict -with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict) +with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py index 1d2a609f13b..3f6c3aabf13 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py @@ -52,6 +52,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -84,6 +85,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -114,6 +116,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py index efd9c939d21..30718c766d7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py @@ -27,6 +27,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -59,6 +60,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -89,6 +91,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py new file mode 100644 index 00000000000..f13c270b56b --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/base_discriminator.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.primitive_string import PrimitiveString + from petstore_api.models.info import Info + +class BaseDiscriminator(BaseModel): + """ + BaseDiscriminator + """ # noqa: E501 + type_name: Optional[StrictStr] = Field(default=None, alias="_typeName") + __properties: ClassVar[List[str]] = ["_typeName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '_typeName' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'string': 'PrimitiveString','Info': 'Info' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'PrimitiveString': + return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj) + if object_type == 'Info': + return import_module("petstore_api.models.info").Info.from_dict(obj) + + raise ValueError("BaseDiscriminator failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py index 820879b30e4..1e65d8a8018 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_test.py @@ -35,11 +35,13 @@ class EnumTest(BaseModel): enum_integer_default: Optional[StrictInt] = 5 enum_integer: Optional[StrictInt] = None enum_number: Optional[float] = None + enum_number_vendor_ext: Optional[StrictInt] = None + enum_string_vendor_ext: Optional[StrictStr] = None outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum") outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger") outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=None, alias="outerEnumDefaultValue") outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=None, alias="outerEnumIntegerDefaultValue") - __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] + __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_number_vendor_ext", "enum_string_vendor_ext", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @field_validator('enum_string') def enum_string_validate_enum(cls, value): @@ -88,6 +90,26 @@ class EnumTest(BaseModel): raise ValueError("must be one of enum values (1.1, -1.2)") return value + @field_validator('enum_number_vendor_ext') + def enum_number_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([42, 18, 56]): + raise ValueError("must be one of enum values (42, 18, 56)") + return value + + @field_validator('enum_string_vendor_ext') + def enum_string_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FOO', 'Bar', 'baz']): + raise ValueError("must be one of enum values ('FOO', 'Bar', 'baz')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -149,6 +171,8 @@ class EnumTest(BaseModel): "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5, "enum_integer": obj.get("enum_integer"), "enum_number": obj.get("enum_number"), + "enum_number_vendor_ext": obj.get("enum_number_vendor_ext"), + "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outerEnum": obj.get("outerEnum"), "outerEnumInteger": obj.get("outerEnumInteger"), "outerEnumDefaultValue": obj.get("outerEnumDefaultValue"), diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py new file mode 100644 index 00000000000..5a15b5f9f52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/info.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class Info(BaseDiscriminator): + """ + Info + """ # noqa: E501 + val: Optional[BaseDiscriminator] = None + __properties: ClassVar[List[str]] = ["_typeName", "val"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Info from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of val + if self.val: + _dict['val'] = self.val.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Info from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "val": BaseDiscriminator.from_dict(obj["val"]) if obj.get("val") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py new file mode 100644 index 00000000000..5a706559786 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/primitive_string.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class PrimitiveString(BaseDiscriminator): + """ + PrimitiveString + """ # noqa: E501 + value: Optional[StrictStr] = Field(default=None, alias="_value") + __properties: ClassVar[List[str]] = ["_typeName", "_value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrimitiveString from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrimitiveString from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "_value": obj.get("_value") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_base_discriminator.py new file mode 100644 index 00000000000..61c40f7f680 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_base_discriminator.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.base_discriminator import BaseDiscriminator + +class TestBaseDiscriminator(unittest.TestCase): + """BaseDiscriminator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseDiscriminator: + """Test BaseDiscriminator + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseDiscriminator` + """ + model = BaseDiscriminator() + if include_optional: + return BaseDiscriminator( + type_name = '' + ) + else: + return BaseDiscriminator( + ) + """ + + def testBaseDiscriminator(self): + """Test BaseDiscriminator""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_info.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_info.py new file mode 100644 index 00000000000..e1fce9f9c1e --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_info.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.info import Info + +class TestInfo(unittest.TestCase): + """Info unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Info: + """Test Info + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Info` + """ + model = Info() + if include_optional: + return Info( + val = petstore_api.models.base_discriminator.BaseDiscriminator() + ) + else: + return Info( + ) + """ + + def testInfo(self): + """Test Info""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-aiohttp/test/test_primitive_string.py b/samples/openapi3/client/petstore/python-aiohttp/test/test_primitive_string.py new file mode 100644 index 00000000000..8b9ccf59893 --- /dev/null +++ b/samples/openapi3/client/petstore/python-aiohttp/test/test_primitive_string.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.primitive_string import PrimitiveString + +class TestPrimitiveString(unittest.TestCase): + """PrimitiveString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PrimitiveString: + """Test PrimitiveString + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PrimitiveString` + """ + model = PrimitiveString() + if include_optional: + return PrimitiveString( + value = '' + ) + else: + return PrimitiveString( + ) + """ + + def testPrimitiveString(self): + """Test PrimitiveString""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES index c9774b574f8..5bd01d52420 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/.openapi-generator/FILES @@ -18,6 +18,7 @@ docs/ArrayOfArrayOfModel.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md +docs/BaseDiscriminator.md docs/BasquePig.md docs/Bathing.md docs/Capitalization.md @@ -55,6 +56,7 @@ docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/ImportTestDatetimeApi.md +docs/Info.md docs/InnerDictWithProperty.md docs/InputAllOf.md docs/IntOrString.md @@ -84,6 +86,7 @@ docs/Pet.md docs/PetApi.md docs/Pig.md docs/PoopCleaning.md +docs/PrimitiveString.md docs/PropertyMap.md docs/PropertyNameCollision.md docs/ReadOnlyFirst.md @@ -138,6 +141,7 @@ petstore_api/models/array_of_array_of_model.py petstore_api/models/array_of_array_of_number_only.py petstore_api/models/array_of_number_only.py petstore_api/models/array_test.py +petstore_api/models/base_discriminator.py petstore_api/models/basque_pig.py petstore_api/models/bathing.py petstore_api/models/capitalization.py @@ -171,6 +175,7 @@ petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/info.py petstore_api/models/inner_dict_with_property.py petstore_api/models/input_all_of.py petstore_api/models/int_or_string.py @@ -199,6 +204,7 @@ petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/poop_cleaning.py +petstore_api/models/primitive_string.py petstore_api/models/property_map.py petstore_api/models/property_name_collision.py petstore_api/models/read_only_first.py diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md index 640b29c335e..30bae1cf642 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/README.md @@ -165,6 +165,7 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BaseDiscriminator](docs/BaseDiscriminator.md) - [BasquePig](docs/BasquePig.md) - [Bathing](docs/Bathing.md) - [Capitalization](docs/Capitalization.md) @@ -198,6 +199,7 @@ Class | Method | HTTP request | Description - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [Info](docs/Info.md) - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [InputAllOf](docs/InputAllOf.md) - [IntOrString](docs/IntOrString.md) @@ -226,6 +228,7 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [PoopCleaning](docs/PoopCleaning.md) + - [PrimitiveString](docs/PrimitiveString.md) - [PropertyMap](docs/PropertyMap.md) - [PropertyNameCollision](docs/PropertyNameCollision.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesAnyType.md index beedef76c05..79b75f9f010 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesAnyType.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesAnyType.md @@ -21,7 +21,7 @@ print AdditionalPropertiesAnyType.to_json() # convert the object into a dict additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict() # create an instance of AdditionalPropertiesAnyType from a dict -additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict) +additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesClass.md index 6abc3136b9c..88b80a675ff 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesClass.md @@ -22,7 +22,7 @@ print AdditionalPropertiesClass.to_json() # convert the object into a dict additional_properties_class_dict = additional_properties_class_instance.to_dict() # create an instance of AdditionalPropertiesClass from a dict -additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict) +additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesObject.md index 8b9259c687f..a9d656a6caf 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesObject.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesObject.md @@ -21,7 +21,7 @@ print AdditionalPropertiesObject.to_json() # convert the object into a dict additional_properties_object_dict = additional_properties_object_instance.to_dict() # create an instance of AdditionalPropertiesObject from a dict -additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict) +additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md index d66094f18e5..f86bb3f609c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AdditionalPropertiesWithDescriptionOnly.md @@ -21,7 +21,7 @@ print AdditionalPropertiesWithDescriptionOnly.to_json() # convert the object into a dict additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict() # create an instance of AdditionalPropertiesWithDescriptionOnly from a dict -additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict) +additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfSuperModel.md index 0e8a9bacf0e..e26106e3447 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfSuperModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfSuperModel.md @@ -21,7 +21,7 @@ print AllOfSuperModel.to_json() # convert the object into a dict all_of_super_model_dict = all_of_super_model_instance.to_dict() # create an instance of AllOfSuperModel from a dict -all_of_super_model_form_dict = all_of_super_model.from_dict(all_of_super_model_dict) +all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfWithSingleRef.md index 1a8b4df7ecc..8ad1d9798b7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AllOfWithSingleRef.md @@ -22,7 +22,7 @@ print AllOfWithSingleRef.to_json() # convert the object into a dict all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict() # create an instance of AllOfWithSingleRef from a dict -all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict) +all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Animal.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Animal.md index b62f1969099..af4959f50c1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Animal.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Animal.md @@ -22,7 +22,7 @@ print Animal.to_json() # convert the object into a dict animal_dict = animal_instance.to_dict() # create an instance of Animal from a dict -animal_form_dict = animal.from_dict(animal_dict) +animal_from_dict = Animal.from_dict(animal_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfColor.md index 9b161ccba1c..96290acbf9a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfColor.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfColor.md @@ -21,7 +21,7 @@ print AnyOfColor.to_json() # convert the object into a dict any_of_color_dict = any_of_color_instance.to_dict() # create an instance of AnyOfColor from a dict -any_of_color_form_dict = any_of_color.from_dict(any_of_color_dict) +any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfPig.md index 2da7ca6eefe..7c39ea27e99 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfPig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/AnyOfPig.md @@ -23,7 +23,7 @@ print AnyOfPig.to_json() # convert the object into a dict any_of_pig_dict = any_of_pig_instance.to_dict() # create an instance of AnyOfPig from a dict -any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict) +any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ApiResponse.md index ba35ea9e2f0..6102313cb14 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ApiResponse.md @@ -23,7 +23,7 @@ print ApiResponse.to_json() # convert the object into a dict api_response_dict = api_response_instance.to_dict() # create an instance of ApiResponse from a dict -api_response_form_dict = api_response.from_dict(api_response_dict) +api_response_from_dict = ApiResponse.from_dict(api_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfModel.md index 09406159261..0b93fb437ab 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfModel.md @@ -21,7 +21,7 @@ print ArrayOfArrayOfModel.to_json() # convert the object into a dict array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict() # create an instance of ArrayOfArrayOfModel from a dict -array_of_array_of_model_form_dict = array_of_array_of_model.from_dict(array_of_array_of_model_dict) +array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfNumberOnly.md index 3f0c127d4fa..4bb70bf2786 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfArrayOfNumberOnly.md @@ -21,7 +21,7 @@ print ArrayOfArrayOfNumberOnly.to_json() # convert the object into a dict array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict() # create an instance of ArrayOfArrayOfNumberOnly from a dict -array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict) +array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfNumberOnly.md index c10191915a7..395ad7f9f8b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayOfNumberOnly.md @@ -21,7 +21,7 @@ print ArrayOfNumberOnly.to_json() # convert the object into a dict array_of_number_only_dict = array_of_number_only_instance.to_dict() # create an instance of ArrayOfNumberOnly from a dict -array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict) +array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayTest.md index d99d1a3c4ae..0b2fb30bff3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ArrayTest.md @@ -24,7 +24,7 @@ print ArrayTest.to_json() # convert the object into a dict array_test_dict = array_test_instance.to_dict() # create an instance of ArrayTest from a dict -array_test_form_dict = array_test.from_dict(array_test_dict) +array_test_from_dict = ArrayTest.from_dict(array_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BaseDiscriminator.md new file mode 100644 index 00000000000..38e238100e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BaseDiscriminator.md @@ -0,0 +1,28 @@ +# BaseDiscriminator + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.base_discriminator import BaseDiscriminator + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDiscriminator from a JSON string +base_discriminator_instance = BaseDiscriminator.from_json(json) +# print the JSON string representation of the object +print BaseDiscriminator.to_json() + +# convert the object into a dict +base_discriminator_dict = base_discriminator_instance.to_dict() +# create an instance of BaseDiscriminator from a dict +base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BasquePig.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BasquePig.md index 552b9390c7e..4e3b5052dbc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/BasquePig.md @@ -22,7 +22,7 @@ print BasquePig.to_json() # convert the object into a dict basque_pig_dict = basque_pig_instance.to_dict() # create an instance of BasquePig from a dict -basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict) +basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Bathing.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Bathing.md index f7844f95d54..0841a9898ab 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Bathing.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Bathing.md @@ -23,7 +23,7 @@ print Bathing.to_json() # convert the object into a dict bathing_dict = bathing_instance.to_dict() # create an instance of Bathing from a dict -bathing_form_dict = bathing.from_dict(bathing_dict) +bathing_from_dict = Bathing.from_dict(bathing_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Capitalization.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Capitalization.md index 99e6fae88fd..44024234da3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Capitalization.md @@ -26,7 +26,7 @@ print Capitalization.to_json() # convert the object into a dict capitalization_dict = capitalization_instance.to_dict() # create an instance of Capitalization from a dict -capitalization_form_dict = capitalization.from_dict(capitalization_dict) +capitalization_from_dict = Capitalization.from_dict(capitalization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Cat.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Cat.md index 4b509dda7ea..0880a52adec 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Cat.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Cat.md @@ -21,7 +21,7 @@ print Cat.to_json() # convert the object into a dict cat_dict = cat_instance.to_dict() # create an instance of Cat from a dict -cat_form_dict = cat.from_dict(cat_dict) +cat_from_dict = Cat.from_dict(cat_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Category.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Category.md index c49514ef802..072bc446592 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Category.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Category.md @@ -22,7 +22,7 @@ print Category.to_json() # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularAllOfRef.md index d4c78e1f402..3c6bc5fa6f7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularAllOfRef.md @@ -22,7 +22,7 @@ print CircularAllOfRef.to_json() # convert the object into a dict circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict() # create an instance of CircularAllOfRef from a dict -circular_all_of_ref_form_dict = circular_all_of_ref.from_dict(circular_all_of_ref_dict) +circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularReferenceModel.md index d5e97934d2b..f9cfab080e1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularReferenceModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CircularReferenceModel.md @@ -22,7 +22,7 @@ print CircularReferenceModel.to_json() # convert the object into a dict circular_reference_model_dict = circular_reference_model_instance.to_dict() # create an instance of CircularReferenceModel from a dict -circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ClassModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ClassModel.md index 1b6fb7cfc77..c8c17439ce3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ClassModel.md @@ -22,7 +22,7 @@ print ClassModel.to_json() # convert the object into a dict class_model_dict = class_model_instance.to_dict() # create an instance of ClassModel from a dict -class_model_form_dict = class_model.from_dict(class_model_dict) +class_model_from_dict = ClassModel.from_dict(class_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Client.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Client.md index b0ded10dd76..60d8102c542 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Client.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Client.md @@ -21,7 +21,7 @@ print Client.to_json() # convert the object into a dict client_dict = client_instance.to_dict() # create an instance of Client from a dict -client_form_dict = client.from_dict(client_dict) +client_from_dict = Client.from_dict(client_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Color.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Color.md index 07fcd01991a..b320dcf0e9a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Color.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Color.md @@ -21,7 +21,7 @@ print Color.to_json() # convert the object into a dict color_dict = color_instance.to_dict() # create an instance of Color from a dict -color_form_dict = color.from_dict(color_dict) +color_from_dict = Color.from_dict(color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Creature.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Creature.md index 54249d5871e..4460f1a04c5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Creature.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Creature.md @@ -22,7 +22,7 @@ print Creature.to_json() # convert the object into a dict creature_dict = creature_instance.to_dict() # create an instance of Creature from a dict -creature_form_dict = creature.from_dict(creature_dict) +creature_from_dict = Creature.from_dict(creature_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CreatureInfo.md index 5a600b9f337..1df6883a71b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CreatureInfo.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/CreatureInfo.md @@ -21,7 +21,7 @@ print CreatureInfo.to_json() # convert the object into a dict creature_info_dict = creature_info_instance.to_dict() # create an instance of CreatureInfo from a dict -creature_info_form_dict = creature_info.from_dict(creature_info_dict) +creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DanishPig.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DanishPig.md index 253616c2fc3..33faed74189 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DanishPig.md @@ -22,7 +22,7 @@ print DanishPig.to_json() # convert the object into a dict danish_pig_dict = danish_pig_instance.to_dict() # create an instance of DanishPig from a dict -danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict) +danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DeprecatedObject.md index e6cf5718963..a12d1cad419 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DeprecatedObject.md @@ -21,7 +21,7 @@ print DeprecatedObject.to_json() # convert the object into a dict deprecated_object_dict = deprecated_object_instance.to_dict() # create an instance of DeprecatedObject from a dict -deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict) +deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md index b5dcd991926..dc27629cd1f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSub.md @@ -20,7 +20,7 @@ print DiscriminatorAllOfSub.to_json() # convert the object into a dict discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() # create an instance of DiscriminatorAllOfSub from a dict -discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md index 9564ca75c80..7506eb150b2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DiscriminatorAllOfSuper.md @@ -21,7 +21,7 @@ print DiscriminatorAllOfSuper.to_json() # convert the object into a dict discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() # create an instance of DiscriminatorAllOfSuper from a dict -discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Dog.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Dog.md index 3469be73a76..ebef27d81d6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Dog.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Dog.md @@ -21,7 +21,7 @@ print Dog.to_json() # convert the object into a dict dog_dict = dog_instance.to_dict() # create an instance of Dog from a dict -dog_form_dict = dog.from_dict(dog_dict) +dog_from_dict = Dog.from_dict(dog_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DummyModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DummyModel.md index e690a8874f8..52483957a5e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DummyModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/DummyModel.md @@ -22,7 +22,7 @@ print DummyModel.to_json() # convert the object into a dict dummy_model_dict = dummy_model_instance.to_dict() # create an instance of DummyModel from a dict -dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict) +dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumArrays.md index d21f58a6608..4f4004c1672 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumArrays.md @@ -22,7 +22,7 @@ print EnumArrays.to_json() # convert the object into a dict enum_arrays_dict = enum_arrays_instance.to_dict() # create an instance of EnumArrays from a dict -enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict) +enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumTest.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumTest.md index 5bcb8e7027e..15d7a6539f9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumTest.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **enum_integer_default** | **int** | | [optional] [default to 5] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] +**enum_number_vendor_ext** | **int** | | [optional] +**enum_string_vendor_ext** | **str** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] **outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] @@ -29,7 +31,7 @@ print EnumTest.to_json() # convert the object into a dict enum_test_dict = enum_test_instance.to_dict() # create an instance of EnumTest from a dict -enum_test_form_dict = enum_test.from_dict(enum_test_dict) +enum_test_from_dict = EnumTest.from_dict(enum_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Feeding.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Feeding.md index 30750a67a07..8bc540ad389 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Feeding.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Feeding.md @@ -23,7 +23,7 @@ print Feeding.to_json() # convert the object into a dict feeding_dict = feeding_instance.to_dict() # create an instance of Feeding from a dict -feeding_form_dict = feeding.from_dict(feeding_dict) +feeding_from_dict = Feeding.from_dict(feeding_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Field.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Field.md index 01abebbda17..0e45544dd0d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Field.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Field.md @@ -21,7 +21,7 @@ print Field.to_json() # convert the object into a dict field_dict = field_instance.to_dict() # create an instance of Field from a dict -field_form_dict = field.from_dict(field_dict) +field_from_dict = Field.from_dict(field_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/File.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/File.md index 586da8e3255..019c02129a9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/File.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/File.md @@ -22,7 +22,7 @@ print File.to_json() # convert the object into a dict file_dict = file_instance.to_dict() # create an instance of File from a dict -file_form_dict = file.from_dict(file_dict) +file_from_dict = File.from_dict(file_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FileSchemaTestClass.md index fb967a8d992..16f4b7a29c2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FileSchemaTestClass.md @@ -22,7 +22,7 @@ print FileSchemaTestClass.to_json() # convert the object into a dict file_schema_test_class_dict = file_schema_test_class_instance.to_dict() # create an instance of FileSchemaTestClass from a dict -file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict) +file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FirstRef.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FirstRef.md index b5e7ab766b4..7b4539dec25 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FirstRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FirstRef.md @@ -22,7 +22,7 @@ print FirstRef.to_json() # convert the object into a dict first_ref_dict = first_ref_instance.to_dict() # create an instance of FirstRef from a dict -first_ref_form_dict = first_ref.from_dict(first_ref_dict) +first_ref_from_dict = FirstRef.from_dict(first_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Foo.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Foo.md index 8062d08df1d..c337d6f1a83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Foo.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Foo.md @@ -21,7 +21,7 @@ print Foo.to_json() # convert the object into a dict foo_dict = foo_instance.to_dict() # create an instance of Foo from a dict -foo_form_dict = foo.from_dict(foo_dict) +foo_from_dict = Foo.from_dict(foo_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FooGetDefaultResponse.md index 550fbe78fa1..311cb6d51b5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FooGetDefaultResponse.md @@ -21,7 +21,7 @@ print FooGetDefaultResponse.to_json() # convert the object into a dict foo_get_default_response_dict = foo_get_default_response_instance.to_dict() # create an instance of FooGetDefaultResponse from a dict -foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict) +foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FormatTest.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FormatTest.md index aa81e585952..08287433303 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/FormatTest.md @@ -37,7 +37,7 @@ print FormatTest.to_json() # convert the object into a dict format_test_dict = format_test_instance.to_dict() # create an instance of FormatTest from a dict -format_test_form_dict = format_test.from_dict(format_test_dict) +format_test_from_dict = FormatTest.from_dict(format_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HasOnlyReadOnly.md index 99573bd28a2..cbb1af037fd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HasOnlyReadOnly.md @@ -22,7 +22,7 @@ print HasOnlyReadOnly.to_json() # convert the object into a dict has_only_read_only_dict = has_only_read_only_instance.to_dict() # create an instance of HasOnlyReadOnly from a dict -has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict) +has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HealthCheckResult.md index b8723e018aa..7748c091cf4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/HealthCheckResult.md @@ -22,7 +22,7 @@ print HealthCheckResult.to_json() # convert the object into a dict health_check_result_dict = health_check_result_instance.to_dict() # create an instance of HealthCheckResult from a dict -health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict) +health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Info.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Info.md new file mode 100644 index 00000000000..20497b998d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Info.md @@ -0,0 +1,28 @@ +# Info + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional] + +## Example + +```python +from petstore_api.models.info import Info + +# TODO update the JSON string below +json = "{}" +# create an instance of Info from a JSON string +info_instance = Info.from_json(json) +# print the JSON string representation of the object +print Info.to_json() + +# convert the object into a dict +info_dict = info_instance.to_dict() +# create an instance of Info from a dict +info_from_dict = Info.from_dict(info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InnerDictWithProperty.md index 45d76ad458c..4571e4dc1a4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InnerDictWithProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InnerDictWithProperty.md @@ -21,7 +21,7 @@ print InnerDictWithProperty.to_json() # convert the object into a dict inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() # create an instance of InnerDictWithProperty from a dict -inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InputAllOf.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InputAllOf.md index eddd22e48a4..50e0f318e70 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InputAllOf.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/InputAllOf.md @@ -21,7 +21,7 @@ print InputAllOf.to_json() # convert the object into a dict input_all_of_dict = input_all_of_instance.to_dict() # create an instance of InputAllOf from a dict -input_all_of_form_dict = input_all_of.from_dict(input_all_of_dict) +input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/IntOrString.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/IntOrString.md index 0a441f186db..5f234f7d20e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/IntOrString.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/IntOrString.md @@ -20,7 +20,7 @@ print IntOrString.to_json() # convert the object into a dict int_or_string_dict = int_or_string_instance.to_dict() # create an instance of IntOrString from a dict -int_or_string_form_dict = int_or_string.from_dict(int_or_string_dict) +int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ListClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ListClass.md index ceb1f50705b..6d84bff6a83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ListClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ListClass.md @@ -21,7 +21,7 @@ print ListClass.to_json() # convert the object into a dict list_class_dict = list_class_instance.to_dict() # create an instance of ListClass from a dict -list_class_form_dict = list_class.from_dict(list_class_dict) +list_class_from_dict = ListClass.from_dict(list_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapOfArrayOfModel.md index b97ace0f42c..912a72c7743 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapOfArrayOfModel.md @@ -21,7 +21,7 @@ print MapOfArrayOfModel.to_json() # convert the object into a dict map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict() # create an instance of MapOfArrayOfModel from a dict -map_of_array_of_model_form_dict = map_of_array_of_model.from_dict(map_of_array_of_model_dict) +map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapTest.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapTest.md index ba87758a522..37d65a59c8a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MapTest.md @@ -24,7 +24,7 @@ print MapTest.to_json() # convert the object into a dict map_test_dict = map_test_instance.to_dict() # create an instance of MapTest from a dict -map_test_form_dict = map_test.from_dict(map_test_dict) +map_test_from_dict = MapTest.from_dict(map_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 8f628d133ab..53d7988588b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -23,7 +23,7 @@ print MixedPropertiesAndAdditionalPropertiesClass.to_json() # convert the object into a dict mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict() # create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict -mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict) +mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Model200Response.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Model200Response.md index 6a20cefe99c..bd6b6ce21aa 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Model200Response.md @@ -23,7 +23,7 @@ print Model200Response.to_json() # convert the object into a dict model200_response_dict = model200_response_instance.to_dict() # create an instance of Model200Response from a dict -model200_response_form_dict = model200_response.from_dict(model200_response_dict) +model200_response_from_dict = Model200Response.from_dict(model200_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ModelReturn.md index a5b47f423c8..a69b543d461 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ModelReturn.md @@ -22,7 +22,7 @@ print ModelReturn.to_json() # convert the object into a dict model_return_dict = model_return_instance.to_dict() # create an instance of ModelReturn from a dict -model_return_form_dict = model_return.from_dict(model_return_dict) +model_return_from_dict = ModelReturn.from_dict(model_return_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Name.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Name.md index 4ccd0ce09aa..b2cf3013a47 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Name.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Name.md @@ -25,7 +25,7 @@ print Name.to_json() # convert the object into a dict name_dict = name_instance.to_dict() # create an instance of Name from a dict -name_form_dict = name.from_dict(name_dict) +name_from_dict = Name.from_dict(name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableClass.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableClass.md index 1658756b50e..d6ca700c887 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableClass.md @@ -33,7 +33,7 @@ print NullableClass.to_json() # convert the object into a dict nullable_class_dict = nullable_class_instance.to_dict() # create an instance of NullableClass from a dict -nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict) +nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableProperty.md index fd9cbbc51aa..3771860aafb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NullableProperty.md @@ -22,7 +22,7 @@ print NullableProperty.to_json() # convert the object into a dict nullable_property_dict = nullable_property_instance.to_dict() # create an instance of NullableProperty from a dict -nullable_property_form_dict = nullable_property.from_dict(nullable_property_dict) +nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NumberOnly.md index f49216ddaa4..eb51449dc20 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/NumberOnly.md @@ -21,7 +21,7 @@ print NumberOnly.to_json() # convert the object into a dict number_only_dict = number_only_instance.to_dict() # create an instance of NumberOnly from a dict -number_only_form_dict = number_only.from_dict(number_only_dict) +number_only_from_dict = NumberOnly.from_dict(number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectToTestAdditionalProperties.md index c4ba9a95850..52d741dcd51 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectToTestAdditionalProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectToTestAdditionalProperties.md @@ -22,7 +22,7 @@ print ObjectToTestAdditionalProperties.to_json() # convert the object into a dict object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict() # create an instance of ObjectToTestAdditionalProperties from a dict -object_to_test_additional_properties_form_dict = object_to_test_additional_properties.from_dict(object_to_test_additional_properties_dict) +object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectWithDeprecatedFields.md index 8daa55a3916..324130af8dd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ObjectWithDeprecatedFields.md @@ -24,7 +24,7 @@ print ObjectWithDeprecatedFields.to_json() # convert the object into a dict object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict() # create an instance of ObjectWithDeprecatedFields from a dict -object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict) +object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OneOfEnumString.md index c7c28bc2944..981fae92dee 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OneOfEnumString.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OneOfEnumString.md @@ -21,7 +21,7 @@ print OneOfEnumString.to_json() # convert the object into a dict one_of_enum_string_dict = one_of_enum_string_instance.to_dict() # create an instance of OneOfEnumString from a dict -one_of_enum_string_form_dict = one_of_enum_string.from_dict(one_of_enum_string_dict) +one_of_enum_string_from_dict = OneOfEnumString.from_dict(one_of_enum_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Order.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Order.md index e71e955a11d..2eaed8c9278 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Order.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Order.md @@ -26,7 +26,7 @@ print Order.to_json() # convert the object into a dict order_dict = order_instance.to_dict() # create an instance of Order from a dict -order_form_dict = order.from_dict(order_dict) +order_from_dict = Order.from_dict(order_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterComposite.md index 504e266f9a1..f9dc458046b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterComposite.md @@ -23,7 +23,7 @@ print OuterComposite.to_json() # convert the object into a dict outer_composite_dict = outer_composite_instance.to_dict() # create an instance of OuterComposite from a dict -outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict) +outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterObjectWithEnumProperty.md index c6a1cdcbc19..f7ea908c924 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/OuterObjectWithEnumProperty.md @@ -22,7 +22,7 @@ print OuterObjectWithEnumProperty.to_json() # convert the object into a dict outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict() # create an instance of OuterObjectWithEnumProperty from a dict -outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict) +outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Parent.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Parent.md index 9a963a6b722..de6fb2bf47a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Parent.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Parent.md @@ -21,7 +21,7 @@ print Parent.to_json() # convert the object into a dict parent_dict = parent_instance.to_dict() # create an instance of Parent from a dict -parent_form_dict = parent.from_dict(parent_dict) +parent_from_dict = Parent.from_dict(parent_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ParentWithOptionalDict.md index 04bf9494201..817faeed32f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ParentWithOptionalDict.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ParentWithOptionalDict.md @@ -21,7 +21,7 @@ print ParentWithOptionalDict.to_json() # convert the object into a dict parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() # create an instance of ParentWithOptionalDict from a dict -parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pet.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pet.md index 05a466f880a..4eedd9366ac 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pet.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pet.md @@ -26,7 +26,7 @@ print Pet.to_json() # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pig.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pig.md index 398d6c6c6e3..e729adee35e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Pig.md @@ -23,7 +23,7 @@ print Pig.to_json() # convert the object into a dict pig_dict = pig_instance.to_dict() # create an instance of Pig from a dict -pig_form_dict = pig.from_dict(pig_dict) +pig_from_dict = Pig.from_dict(pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PoopCleaning.md index bbc93c0203c..2f0ff6470bc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PoopCleaning.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PoopCleaning.md @@ -23,7 +23,7 @@ print PoopCleaning.to_json() # convert the object into a dict poop_cleaning_dict = poop_cleaning_instance.to_dict() # create an instance of PoopCleaning from a dict -poop_cleaning_form_dict = poop_cleaning.from_dict(poop_cleaning_dict) +poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PrimitiveString.md new file mode 100644 index 00000000000..e4af0dda380 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PrimitiveString.md @@ -0,0 +1,28 @@ +# PrimitiveString + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.primitive_string import PrimitiveString + +# TODO update the JSON string below +json = "{}" +# create an instance of PrimitiveString from a JSON string +primitive_string_instance = PrimitiveString.from_json(json) +# print the JSON string representation of the object +print PrimitiveString.to_json() + +# convert the object into a dict +primitive_string_dict = primitive_string_instance.to_dict() +# create an instance of PrimitiveString from a dict +primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyMap.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyMap.md index f7cf4ba8933..2b727c64409 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyMap.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyMap.md @@ -21,7 +21,7 @@ print PropertyMap.to_json() # convert the object into a dict property_map_dict = property_map_instance.to_dict() # create an instance of PropertyMap from a dict -property_map_form_dict = property_map.from_dict(property_map_dict) +property_map_from_dict = PropertyMap.from_dict(property_map_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyNameCollision.md index 2cc1898be69..62fac72a7d0 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyNameCollision.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/PropertyNameCollision.md @@ -23,7 +23,7 @@ print PropertyNameCollision.to_json() # convert the object into a dict property_name_collision_dict = property_name_collision_instance.to_dict() # create an instance of PropertyNameCollision from a dict -property_name_collision_form_dict = property_name_collision.from_dict(property_name_collision_dict) +property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ReadOnlyFirst.md index 22b5acca70c..a67f2705bd1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/ReadOnlyFirst.md @@ -22,7 +22,7 @@ print ReadOnlyFirst.to_json() # convert the object into a dict read_only_first_dict = read_only_first_instance.to_dict() # create an instance of ReadOnlyFirst from a dict -read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict) +read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondCircularAllOfRef.md index 4460634382a..bcb8b5fe453 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondCircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondCircularAllOfRef.md @@ -22,7 +22,7 @@ print SecondCircularAllOfRef.to_json() # convert the object into a dict second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict() # create an instance of SecondCircularAllOfRef from a dict -second_circular_all_of_ref_form_dict = second_circular_all_of_ref.from_dict(second_circular_all_of_ref_dict) +second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondRef.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondRef.md index e6fb1e2d4f7..a75a54047b7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SecondRef.md @@ -22,7 +22,7 @@ print SecondRef.to_json() # convert the object into a dict second_ref_dict = second_ref_instance.to_dict() # create an instance of SecondRef from a dict -second_ref_form_dict = second_ref.from_dict(second_ref_dict) +second_ref_from_dict = SecondRef.from_dict(second_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SelfReferenceModel.md index dbf9589d576..1761dbbf371 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SelfReferenceModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SelfReferenceModel.md @@ -22,7 +22,7 @@ print SelfReferenceModel.to_json() # convert the object into a dict self_reference_model_dict = self_reference_model_instance.to_dict() # create an instance of SelfReferenceModel from a dict -self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict) +self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialModelName.md index 3d27640abb0..04341261b0b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialModelName.md @@ -21,7 +21,7 @@ print SpecialModelName.to_json() # convert the object into a dict special_model_name_dict = special_model_name_instance.to_dict() # create an instance of SpecialModelName from a dict -special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict) +special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialName.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialName.md index 0b412952597..ffd2b6b69ba 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialName.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/SpecialName.md @@ -23,7 +23,7 @@ print SpecialName.to_json() # convert the object into a dict special_name_dict = special_name_instance.to_dict() # create an instance of SpecialName from a dict -special_name_form_dict = special_name.from_dict(special_name_dict) +special_name_from_dict = SpecialName.from_dict(special_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tag.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tag.md index e680c68bedd..008d363a3b8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tag.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tag.md @@ -22,7 +22,7 @@ print Tag.to_json() # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Task.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Task.md index aefe66e7638..42d4dfd17a1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Task.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Task.md @@ -23,7 +23,7 @@ print Task.to_json() # convert the object into a dict task_dict = task_instance.to_dict() # create an instance of Task from a dict -task_form_dict = task.from_dict(task_dict) +task_from_dict = Task.from_dict(task_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TaskActivity.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TaskActivity.md index eb254906156..381e58581e6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TaskActivity.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TaskActivity.md @@ -23,7 +23,7 @@ print TaskActivity.to_json() # convert the object into a dict task_activity_dict = task_activity_instance.to_dict() # create an instance of TaskActivity from a dict -task_activity_form_dict = task_activity.from_dict(task_activity_dict) +task_activity_from_dict = TaskActivity.from_dict(task_activity_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel400Response.md index 1ef43ce4cad..98d3e7fe893 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel400Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel400Response.md @@ -21,7 +21,7 @@ print TestErrorResponsesWithModel400Response.to_json() # convert the object into a dict test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel400Response from a dict -test_error_responses_with_model400_response_form_dict = test_error_responses_with_model400_response.from_dict(test_error_responses_with_model400_response_dict) +test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel404Response.md index 9fda9553784..e36e255b21e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel404Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestErrorResponsesWithModel404Response.md @@ -21,7 +21,7 @@ print TestErrorResponsesWithModel404Response.to_json() # convert the object into a dict test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel404Response from a dict -test_error_responses_with_model404_response_form_dict = test_error_responses_with_model404_response.from_dict(test_error_responses_with_model404_response_dict) +test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md index 7cf86c5244e..7f004690753 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -21,7 +21,7 @@ print TestInlineFreeformAdditionalPropertiesRequest.to_json() # convert the object into a dict test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() # create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict -test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md index 25613918e92..c85a2648872 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/TestObjectForMultipartRequestsRequestMarker.md @@ -21,7 +21,7 @@ print TestObjectForMultipartRequestsRequestMarker.to_json() # convert the object into a dict test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict() # create an instance of TestObjectForMultipartRequestsRequestMarker from a dict -test_object_for_multipart_requests_request_marker_form_dict = test_object_for_multipart_requests_request_marker.from_dict(test_object_for_multipart_requests_request_marker_dict) +test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tiger.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tiger.md index 6ce50a31f5a..48dd71e9c83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tiger.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/Tiger.md @@ -21,7 +21,7 @@ print Tiger.to_json() # convert the object into a dict tiger_dict = tiger_instance.to_dict() # create an instance of Tiger from a dict -tiger_form_dict = tiger.from_dict(tiger_dict) +tiger_from_dict = Tiger.from_dict(tiger_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md index c102bb86beb..784b34c2965 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalModelListProperties.md @@ -21,7 +21,7 @@ print UnnamedDictWithAdditionalModelListProperties.to_json() # convert the object into a dict unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalModelListProperties from a dict -unnamed_dict_with_additional_model_list_properties_form_dict = unnamed_dict_with_additional_model_list_properties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) +unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md index 926404ccd6e..904c007e207 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/UnnamedDictWithAdditionalStringListProperties.md @@ -21,7 +21,7 @@ print UnnamedDictWithAdditionalStringListProperties.to_json() # convert the object into a dict unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalStringListProperties from a dict -unnamed_dict_with_additional_string_list_properties_form_dict = unnamed_dict_with_additional_string_list_properties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) +unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/User.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/User.md index 6d7c357ea86..ff5b1d6f173 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/User.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/User.md @@ -28,7 +28,7 @@ print User.to_json() # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/WithNestedOneOf.md index 247afcab99d..f08130c2839 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/WithNestedOneOf.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/WithNestedOneOf.md @@ -23,7 +23,7 @@ print WithNestedOneOf.to_json() # convert the object into a dict with_nested_one_of_dict = with_nested_one_of_instance.to_dict() # create an instance of WithNestedOneOf from a dict -with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict) +with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py index daedab928cf..c0b99d8bf82 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/__init__.py @@ -53,6 +53,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -86,6 +87,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -114,6 +116,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py index 92d7dc877f2..2124d65dc34 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/__init__.py @@ -28,6 +28,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -61,6 +62,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -89,6 +91,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/base_discriminator.py new file mode 100644 index 00000000000..aa1514c9444 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/base_discriminator.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.primitive_string import PrimitiveString + from petstore_api.models.info import Info + +class BaseDiscriminator(BaseModel): + """ + BaseDiscriminator + """ + type_name: Optional[StrictStr] = Field(default=None, alias="_typeName") + __properties = ["_typeName"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + # JSON field name that stores the object type + __discriminator_property_name = '_typeName' + + # discriminator mappings + __discriminator_value_class_map = { + 'string': 'PrimitiveString', + 'Info': 'Info' + } + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union(Info, PrimitiveString): + """Create an instance of BaseDiscriminator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Union(Info, PrimitiveString): + """Create an instance of BaseDiscriminator from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'PrimitiveString': + return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj) + if object_type == 'Info': + return import_module("petstore_api.models.info").Info.from_dict(obj) + raise ValueError("BaseDiscriminator failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py index 5630ebfa1a3..66c688f9f48 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_test.py @@ -34,11 +34,13 @@ class EnumTest(BaseModel): enum_integer_default: Optional[StrictInt] = 5 enum_integer: Optional[StrictInt] = None enum_number: Optional[float] = None + enum_number_vendor_ext: Optional[StrictInt] = None + enum_string_vendor_ext: Optional[StrictStr] = None outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum") outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger") outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=None, alias="outerEnumDefaultValue") outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=None, alias="outerEnumIntegerDefaultValue") - __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] + __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_number_vendor_ext", "enum_string_vendor_ext", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @validator('enum_string') def enum_string_validate_enum(cls, value): @@ -87,6 +89,26 @@ class EnumTest(BaseModel): raise ValueError("must be one of enum values (1.1, -1.2)") return value + @validator('enum_number_vendor_ext') + def enum_number_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in (42, 18, 56): + raise ValueError("must be one of enum values (42, 18, 56)") + return value + + @validator('enum_string_vendor_ext') + def enum_string_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('FOO', 'Bar', 'baz'): + raise ValueError("must be one of enum values ('FOO', 'Bar', 'baz')") + return value + class Config: """Pydantic configuration""" allow_population_by_field_name = True @@ -133,6 +155,8 @@ class EnumTest(BaseModel): "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5, "enum_integer": obj.get("enum_integer"), "enum_number": obj.get("enum_number"), + "enum_number_vendor_ext": obj.get("enum_number_vendor_ext"), + "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outer_enum": obj.get("outerEnum"), "outer_enum_integer": obj.get("outerEnumInteger"), "outer_enum_default_value": obj.get("outerEnumDefaultValue"), diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/info.py new file mode 100644 index 00000000000..a181034ea31 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/info.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +from petstore_api.models.base_discriminator import BaseDiscriminator + +class Info(BaseDiscriminator): + """ + Info + """ + val: Optional[BaseDiscriminator] = None + __properties = ["_typeName", "val"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Info: + """Create an instance of Info from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of val + if self.val: + _dict['val'] = self.val.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Info: + """Create an instance of Info from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Info.parse_obj(obj) + + _obj = Info.parse_obj({ + "type_name": obj.get("_typeName"), + "val": BaseDiscriminator.from_dict(obj.get("val")) if obj.get("val") is not None else None + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/primitive_string.py new file mode 100644 index 00000000000..4d84353e603 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/primitive_string.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import Field, StrictStr +from petstore_api.models.base_discriminator import BaseDiscriminator + +class PrimitiveString(BaseDiscriminator): + """ + PrimitiveString + """ + value: Optional[StrictStr] = Field(default=None, alias="_value") + __properties = ["_typeName", "_value"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PrimitiveString: + """Create an instance of PrimitiveString from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PrimitiveString: + """Create an instance of PrimitiveString from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PrimitiveString.parse_obj(obj) + + _obj = PrimitiveString.parse_obj({ + "type_name": obj.get("_typeName"), + "value": obj.get("_value") + }) + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_base_discriminator.py new file mode 100644 index 00000000000..c31f6bdea26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_base_discriminator.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.base_discriminator import BaseDiscriminator # noqa: E501 + +class TestBaseDiscriminator(unittest.TestCase): + """BaseDiscriminator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseDiscriminator: + """Test BaseDiscriminator + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseDiscriminator` + """ + model = BaseDiscriminator() # noqa: E501 + if include_optional: + return BaseDiscriminator( + type_name = '' + ) + else: + return BaseDiscriminator( + ) + """ + + def testBaseDiscriminator(self): + """Test BaseDiscriminator""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_info.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_info.py new file mode 100644 index 00000000000..f16c34e34a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_info.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.info import Info # noqa: E501 + +class TestInfo(unittest.TestCase): + """Info unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Info: + """Test Info + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Info` + """ + model = Info() # noqa: E501 + if include_optional: + return Info( + val = petstore_api.models.base_discriminator.BaseDiscriminator() + ) + else: + return Info( + ) + """ + + def testInfo(self): + """Test Info""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_primitive_string.py b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_primitive_string.py new file mode 100644 index 00000000000..7d873f8d621 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/test/test_primitive_string.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.primitive_string import PrimitiveString # noqa: E501 + +class TestPrimitiveString(unittest.TestCase): + """PrimitiveString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PrimitiveString: + """Test PrimitiveString + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PrimitiveString` + """ + model = PrimitiveString() # noqa: E501 + if include_optional: + return PrimitiveString( + value = '' + ) + else: + return PrimitiveString( + ) + """ + + def testPrimitiveString(self): + """Test PrimitiveString""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES index c9774b574f8..5bd01d52420 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-pydantic-v1/.openapi-generator/FILES @@ -18,6 +18,7 @@ docs/ArrayOfArrayOfModel.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md +docs/BaseDiscriminator.md docs/BasquePig.md docs/Bathing.md docs/Capitalization.md @@ -55,6 +56,7 @@ docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/ImportTestDatetimeApi.md +docs/Info.md docs/InnerDictWithProperty.md docs/InputAllOf.md docs/IntOrString.md @@ -84,6 +86,7 @@ docs/Pet.md docs/PetApi.md docs/Pig.md docs/PoopCleaning.md +docs/PrimitiveString.md docs/PropertyMap.md docs/PropertyNameCollision.md docs/ReadOnlyFirst.md @@ -138,6 +141,7 @@ petstore_api/models/array_of_array_of_model.py petstore_api/models/array_of_array_of_number_only.py petstore_api/models/array_of_number_only.py petstore_api/models/array_test.py +petstore_api/models/base_discriminator.py petstore_api/models/basque_pig.py petstore_api/models/bathing.py petstore_api/models/capitalization.py @@ -171,6 +175,7 @@ petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/info.py petstore_api/models/inner_dict_with_property.py petstore_api/models/input_all_of.py petstore_api/models/int_or_string.py @@ -199,6 +204,7 @@ petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/poop_cleaning.py +petstore_api/models/primitive_string.py petstore_api/models/property_map.py petstore_api/models/property_name_collision.py petstore_api/models/read_only_first.py diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/README.md b/samples/openapi3/client/petstore/python-pydantic-v1/README.md index 72f17d0d470..2f58d74d3d2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/README.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/README.md @@ -165,6 +165,7 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BaseDiscriminator](docs/BaseDiscriminator.md) - [BasquePig](docs/BasquePig.md) - [Bathing](docs/Bathing.md) - [Capitalization](docs/Capitalization.md) @@ -198,6 +199,7 @@ Class | Method | HTTP request | Description - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [Info](docs/Info.md) - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [InputAllOf](docs/InputAllOf.md) - [IntOrString](docs/IntOrString.md) @@ -226,6 +228,7 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [PoopCleaning](docs/PoopCleaning.md) + - [PrimitiveString](docs/PrimitiveString.md) - [PropertyMap](docs/PropertyMap.md) - [PropertyNameCollision](docs/PropertyNameCollision.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesAnyType.md index beedef76c05..79b75f9f010 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesAnyType.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesAnyType.md @@ -21,7 +21,7 @@ print AdditionalPropertiesAnyType.to_json() # convert the object into a dict additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict() # create an instance of AdditionalPropertiesAnyType from a dict -additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict) +additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesClass.md index 6abc3136b9c..88b80a675ff 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesClass.md @@ -22,7 +22,7 @@ print AdditionalPropertiesClass.to_json() # convert the object into a dict additional_properties_class_dict = additional_properties_class_instance.to_dict() # create an instance of AdditionalPropertiesClass from a dict -additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict) +additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesObject.md index 8b9259c687f..a9d656a6caf 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesObject.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesObject.md @@ -21,7 +21,7 @@ print AdditionalPropertiesObject.to_json() # convert the object into a dict additional_properties_object_dict = additional_properties_object_instance.to_dict() # create an instance of AdditionalPropertiesObject from a dict -additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict) +additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesWithDescriptionOnly.md index d66094f18e5..f86bb3f609c 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesWithDescriptionOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AdditionalPropertiesWithDescriptionOnly.md @@ -21,7 +21,7 @@ print AdditionalPropertiesWithDescriptionOnly.to_json() # convert the object into a dict additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict() # create an instance of AdditionalPropertiesWithDescriptionOnly from a dict -additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict) +additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfSuperModel.md index 0e8a9bacf0e..e26106e3447 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfSuperModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfSuperModel.md @@ -21,7 +21,7 @@ print AllOfSuperModel.to_json() # convert the object into a dict all_of_super_model_dict = all_of_super_model_instance.to_dict() # create an instance of AllOfSuperModel from a dict -all_of_super_model_form_dict = all_of_super_model.from_dict(all_of_super_model_dict) +all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfWithSingleRef.md index 1a8b4df7ecc..8ad1d9798b7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AllOfWithSingleRef.md @@ -22,7 +22,7 @@ print AllOfWithSingleRef.to_json() # convert the object into a dict all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict() # create an instance of AllOfWithSingleRef from a dict -all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict) +all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Animal.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Animal.md index b62f1969099..af4959f50c1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Animal.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Animal.md @@ -22,7 +22,7 @@ print Animal.to_json() # convert the object into a dict animal_dict = animal_instance.to_dict() # create an instance of Animal from a dict -animal_form_dict = animal.from_dict(animal_dict) +animal_from_dict = Animal.from_dict(animal_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfColor.md index 9b161ccba1c..96290acbf9a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfColor.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfColor.md @@ -21,7 +21,7 @@ print AnyOfColor.to_json() # convert the object into a dict any_of_color_dict = any_of_color_instance.to_dict() # create an instance of AnyOfColor from a dict -any_of_color_form_dict = any_of_color.from_dict(any_of_color_dict) +any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfPig.md index 2da7ca6eefe..7c39ea27e99 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfPig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/AnyOfPig.md @@ -23,7 +23,7 @@ print AnyOfPig.to_json() # convert the object into a dict any_of_pig_dict = any_of_pig_instance.to_dict() # create an instance of AnyOfPig from a dict -any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict) +any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ApiResponse.md index ba35ea9e2f0..6102313cb14 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ApiResponse.md @@ -23,7 +23,7 @@ print ApiResponse.to_json() # convert the object into a dict api_response_dict = api_response_instance.to_dict() # create an instance of ApiResponse from a dict -api_response_form_dict = api_response.from_dict(api_response_dict) +api_response_from_dict = ApiResponse.from_dict(api_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfModel.md index 09406159261..0b93fb437ab 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfModel.md @@ -21,7 +21,7 @@ print ArrayOfArrayOfModel.to_json() # convert the object into a dict array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict() # create an instance of ArrayOfArrayOfModel from a dict -array_of_array_of_model_form_dict = array_of_array_of_model.from_dict(array_of_array_of_model_dict) +array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfNumberOnly.md index 3f0c127d4fa..4bb70bf2786 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfArrayOfNumberOnly.md @@ -21,7 +21,7 @@ print ArrayOfArrayOfNumberOnly.to_json() # convert the object into a dict array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict() # create an instance of ArrayOfArrayOfNumberOnly from a dict -array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict) +array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfNumberOnly.md index c10191915a7..395ad7f9f8b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayOfNumberOnly.md @@ -21,7 +21,7 @@ print ArrayOfNumberOnly.to_json() # convert the object into a dict array_of_number_only_dict = array_of_number_only_instance.to_dict() # create an instance of ArrayOfNumberOnly from a dict -array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict) +array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayTest.md index d99d1a3c4ae..0b2fb30bff3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ArrayTest.md @@ -24,7 +24,7 @@ print ArrayTest.to_json() # convert the object into a dict array_test_dict = array_test_instance.to_dict() # create an instance of ArrayTest from a dict -array_test_form_dict = array_test.from_dict(array_test_dict) +array_test_from_dict = ArrayTest.from_dict(array_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/BaseDiscriminator.md new file mode 100644 index 00000000000..38e238100e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/BaseDiscriminator.md @@ -0,0 +1,28 @@ +# BaseDiscriminator + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.base_discriminator import BaseDiscriminator + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDiscriminator from a JSON string +base_discriminator_instance = BaseDiscriminator.from_json(json) +# print the JSON string representation of the object +print BaseDiscriminator.to_json() + +# convert the object into a dict +base_discriminator_dict = base_discriminator_instance.to_dict() +# create an instance of BaseDiscriminator from a dict +base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/BasquePig.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/BasquePig.md index 552b9390c7e..4e3b5052dbc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/BasquePig.md @@ -22,7 +22,7 @@ print BasquePig.to_json() # convert the object into a dict basque_pig_dict = basque_pig_instance.to_dict() # create an instance of BasquePig from a dict -basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict) +basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Bathing.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Bathing.md index f7844f95d54..0841a9898ab 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Bathing.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Bathing.md @@ -23,7 +23,7 @@ print Bathing.to_json() # convert the object into a dict bathing_dict = bathing_instance.to_dict() # create an instance of Bathing from a dict -bathing_form_dict = bathing.from_dict(bathing_dict) +bathing_from_dict = Bathing.from_dict(bathing_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Capitalization.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Capitalization.md index 99e6fae88fd..44024234da3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Capitalization.md @@ -26,7 +26,7 @@ print Capitalization.to_json() # convert the object into a dict capitalization_dict = capitalization_instance.to_dict() # create an instance of Capitalization from a dict -capitalization_form_dict = capitalization.from_dict(capitalization_dict) +capitalization_from_dict = Capitalization.from_dict(capitalization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Cat.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Cat.md index 4b509dda7ea..0880a52adec 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Cat.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Cat.md @@ -21,7 +21,7 @@ print Cat.to_json() # convert the object into a dict cat_dict = cat_instance.to_dict() # create an instance of Cat from a dict -cat_form_dict = cat.from_dict(cat_dict) +cat_from_dict = Cat.from_dict(cat_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Category.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Category.md index c49514ef802..072bc446592 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Category.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Category.md @@ -22,7 +22,7 @@ print Category.to_json() # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularAllOfRef.md index d4c78e1f402..3c6bc5fa6f7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularAllOfRef.md @@ -22,7 +22,7 @@ print CircularAllOfRef.to_json() # convert the object into a dict circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict() # create an instance of CircularAllOfRef from a dict -circular_all_of_ref_form_dict = circular_all_of_ref.from_dict(circular_all_of_ref_dict) +circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularReferenceModel.md index d5e97934d2b..f9cfab080e1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularReferenceModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CircularReferenceModel.md @@ -22,7 +22,7 @@ print CircularReferenceModel.to_json() # convert the object into a dict circular_reference_model_dict = circular_reference_model_instance.to_dict() # create an instance of CircularReferenceModel from a dict -circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ClassModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ClassModel.md index 1b6fb7cfc77..c8c17439ce3 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ClassModel.md @@ -22,7 +22,7 @@ print ClassModel.to_json() # convert the object into a dict class_model_dict = class_model_instance.to_dict() # create an instance of ClassModel from a dict -class_model_form_dict = class_model.from_dict(class_model_dict) +class_model_from_dict = ClassModel.from_dict(class_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Client.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Client.md index b0ded10dd76..60d8102c542 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Client.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Client.md @@ -21,7 +21,7 @@ print Client.to_json() # convert the object into a dict client_dict = client_instance.to_dict() # create an instance of Client from a dict -client_form_dict = client.from_dict(client_dict) +client_from_dict = Client.from_dict(client_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Color.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Color.md index 07fcd01991a..b320dcf0e9a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Color.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Color.md @@ -21,7 +21,7 @@ print Color.to_json() # convert the object into a dict color_dict = color_instance.to_dict() # create an instance of Color from a dict -color_form_dict = color.from_dict(color_dict) +color_from_dict = Color.from_dict(color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Creature.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Creature.md index 54249d5871e..4460f1a04c5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Creature.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Creature.md @@ -22,7 +22,7 @@ print Creature.to_json() # convert the object into a dict creature_dict = creature_instance.to_dict() # create an instance of Creature from a dict -creature_form_dict = creature.from_dict(creature_dict) +creature_from_dict = Creature.from_dict(creature_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CreatureInfo.md index 5a600b9f337..1df6883a71b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/CreatureInfo.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/CreatureInfo.md @@ -21,7 +21,7 @@ print CreatureInfo.to_json() # convert the object into a dict creature_info_dict = creature_info_instance.to_dict() # create an instance of CreatureInfo from a dict -creature_info_form_dict = creature_info.from_dict(creature_info_dict) +creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DanishPig.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DanishPig.md index 253616c2fc3..33faed74189 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DanishPig.md @@ -22,7 +22,7 @@ print DanishPig.to_json() # convert the object into a dict danish_pig_dict = danish_pig_instance.to_dict() # create an instance of DanishPig from a dict -danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict) +danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DeprecatedObject.md index e6cf5718963..a12d1cad419 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DeprecatedObject.md @@ -21,7 +21,7 @@ print DeprecatedObject.to_json() # convert the object into a dict deprecated_object_dict = deprecated_object_instance.to_dict() # create an instance of DeprecatedObject from a dict -deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict) +deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md index b5dcd991926..dc27629cd1f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSub.md @@ -20,7 +20,7 @@ print DiscriminatorAllOfSub.to_json() # convert the object into a dict discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() # create an instance of DiscriminatorAllOfSub from a dict -discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md index 9564ca75c80..7506eb150b2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DiscriminatorAllOfSuper.md @@ -21,7 +21,7 @@ print DiscriminatorAllOfSuper.to_json() # convert the object into a dict discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() # create an instance of DiscriminatorAllOfSuper from a dict -discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Dog.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Dog.md index 3469be73a76..ebef27d81d6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Dog.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Dog.md @@ -21,7 +21,7 @@ print Dog.to_json() # convert the object into a dict dog_dict = dog_instance.to_dict() # create an instance of Dog from a dict -dog_form_dict = dog.from_dict(dog_dict) +dog_from_dict = Dog.from_dict(dog_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DummyModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DummyModel.md index e690a8874f8..52483957a5e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/DummyModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/DummyModel.md @@ -22,7 +22,7 @@ print DummyModel.to_json() # convert the object into a dict dummy_model_dict = dummy_model_instance.to_dict() # create an instance of DummyModel from a dict -dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict) +dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumArrays.md index d21f58a6608..4f4004c1672 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumArrays.md @@ -22,7 +22,7 @@ print EnumArrays.to_json() # convert the object into a dict enum_arrays_dict = enum_arrays_instance.to_dict() # create an instance of EnumArrays from a dict -enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict) +enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumTest.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumTest.md index 5bcb8e7027e..15d7a6539f9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumTest.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **enum_integer_default** | **int** | | [optional] [default to 5] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] +**enum_number_vendor_ext** | **int** | | [optional] +**enum_string_vendor_ext** | **str** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] **outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] @@ -29,7 +31,7 @@ print EnumTest.to_json() # convert the object into a dict enum_test_dict = enum_test_instance.to_dict() # create an instance of EnumTest from a dict -enum_test_form_dict = enum_test.from_dict(enum_test_dict) +enum_test_from_dict = EnumTest.from_dict(enum_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Feeding.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Feeding.md index 30750a67a07..8bc540ad389 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Feeding.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Feeding.md @@ -23,7 +23,7 @@ print Feeding.to_json() # convert the object into a dict feeding_dict = feeding_instance.to_dict() # create an instance of Feeding from a dict -feeding_form_dict = feeding.from_dict(feeding_dict) +feeding_from_dict = Feeding.from_dict(feeding_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Field.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Field.md index 01abebbda17..0e45544dd0d 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Field.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Field.md @@ -21,7 +21,7 @@ print Field.to_json() # convert the object into a dict field_dict = field_instance.to_dict() # create an instance of Field from a dict -field_form_dict = field.from_dict(field_dict) +field_from_dict = Field.from_dict(field_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/File.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/File.md index 586da8e3255..019c02129a9 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/File.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/File.md @@ -22,7 +22,7 @@ print File.to_json() # convert the object into a dict file_dict = file_instance.to_dict() # create an instance of File from a dict -file_form_dict = file.from_dict(file_dict) +file_from_dict = File.from_dict(file_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FileSchemaTestClass.md index fb967a8d992..16f4b7a29c2 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FileSchemaTestClass.md @@ -22,7 +22,7 @@ print FileSchemaTestClass.to_json() # convert the object into a dict file_schema_test_class_dict = file_schema_test_class_instance.to_dict() # create an instance of FileSchemaTestClass from a dict -file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict) +file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FirstRef.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FirstRef.md index b5e7ab766b4..7b4539dec25 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FirstRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FirstRef.md @@ -22,7 +22,7 @@ print FirstRef.to_json() # convert the object into a dict first_ref_dict = first_ref_instance.to_dict() # create an instance of FirstRef from a dict -first_ref_form_dict = first_ref.from_dict(first_ref_dict) +first_ref_from_dict = FirstRef.from_dict(first_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Foo.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Foo.md index 8062d08df1d..c337d6f1a83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Foo.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Foo.md @@ -21,7 +21,7 @@ print Foo.to_json() # convert the object into a dict foo_dict = foo_instance.to_dict() # create an instance of Foo from a dict -foo_form_dict = foo.from_dict(foo_dict) +foo_from_dict = Foo.from_dict(foo_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FooGetDefaultResponse.md index 550fbe78fa1..311cb6d51b5 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FooGetDefaultResponse.md @@ -21,7 +21,7 @@ print FooGetDefaultResponse.to_json() # convert the object into a dict foo_get_default_response_dict = foo_get_default_response_instance.to_dict() # create an instance of FooGetDefaultResponse from a dict -foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict) +foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FormatTest.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FormatTest.md index aa81e585952..08287433303 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/FormatTest.md @@ -37,7 +37,7 @@ print FormatTest.to_json() # convert the object into a dict format_test_dict = format_test_instance.to_dict() # create an instance of FormatTest from a dict -format_test_form_dict = format_test.from_dict(format_test_dict) +format_test_from_dict = FormatTest.from_dict(format_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/HasOnlyReadOnly.md index 99573bd28a2..cbb1af037fd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/HasOnlyReadOnly.md @@ -22,7 +22,7 @@ print HasOnlyReadOnly.to_json() # convert the object into a dict has_only_read_only_dict = has_only_read_only_instance.to_dict() # create an instance of HasOnlyReadOnly from a dict -has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict) +has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/HealthCheckResult.md index b8723e018aa..7748c091cf4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/HealthCheckResult.md @@ -22,7 +22,7 @@ print HealthCheckResult.to_json() # convert the object into a dict health_check_result_dict = health_check_result_instance.to_dict() # create an instance of HealthCheckResult from a dict -health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict) +health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Info.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Info.md new file mode 100644 index 00000000000..20497b998d1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Info.md @@ -0,0 +1,28 @@ +# Info + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional] + +## Example + +```python +from petstore_api.models.info import Info + +# TODO update the JSON string below +json = "{}" +# create an instance of Info from a JSON string +info_instance = Info.from_json(json) +# print the JSON string representation of the object +print Info.to_json() + +# convert the object into a dict +info_dict = info_instance.to_dict() +# create an instance of Info from a dict +info_from_dict = Info.from_dict(info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/InnerDictWithProperty.md index 45d76ad458c..4571e4dc1a4 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/InnerDictWithProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/InnerDictWithProperty.md @@ -21,7 +21,7 @@ print InnerDictWithProperty.to_json() # convert the object into a dict inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() # create an instance of InnerDictWithProperty from a dict -inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/InputAllOf.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/InputAllOf.md index eddd22e48a4..50e0f318e70 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/InputAllOf.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/InputAllOf.md @@ -21,7 +21,7 @@ print InputAllOf.to_json() # convert the object into a dict input_all_of_dict = input_all_of_instance.to_dict() # create an instance of InputAllOf from a dict -input_all_of_form_dict = input_all_of.from_dict(input_all_of_dict) +input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/IntOrString.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/IntOrString.md index 0a441f186db..5f234f7d20e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/IntOrString.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/IntOrString.md @@ -20,7 +20,7 @@ print IntOrString.to_json() # convert the object into a dict int_or_string_dict = int_or_string_instance.to_dict() # create an instance of IntOrString from a dict -int_or_string_form_dict = int_or_string.from_dict(int_or_string_dict) +int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ListClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ListClass.md index ceb1f50705b..6d84bff6a83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ListClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ListClass.md @@ -21,7 +21,7 @@ print ListClass.to_json() # convert the object into a dict list_class_dict = list_class_instance.to_dict() # create an instance of ListClass from a dict -list_class_form_dict = list_class.from_dict(list_class_dict) +list_class_from_dict = ListClass.from_dict(list_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapOfArrayOfModel.md index b97ace0f42c..912a72c7743 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapOfArrayOfModel.md @@ -21,7 +21,7 @@ print MapOfArrayOfModel.to_json() # convert the object into a dict map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict() # create an instance of MapOfArrayOfModel from a dict -map_of_array_of_model_form_dict = map_of_array_of_model.from_dict(map_of_array_of_model_dict) +map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapTest.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapTest.md index ba87758a522..37d65a59c8a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MapTest.md @@ -24,7 +24,7 @@ print MapTest.to_json() # convert the object into a dict map_test_dict = map_test_instance.to_dict() # create an instance of MapTest from a dict -map_test_form_dict = map_test.from_dict(map_test_dict) +map_test_from_dict = MapTest.from_dict(map_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 8f628d133ab..53d7988588b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -23,7 +23,7 @@ print MixedPropertiesAndAdditionalPropertiesClass.to_json() # convert the object into a dict mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict() # create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict -mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict) +mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Model200Response.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Model200Response.md index 6a20cefe99c..bd6b6ce21aa 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Model200Response.md @@ -23,7 +23,7 @@ print Model200Response.to_json() # convert the object into a dict model200_response_dict = model200_response_instance.to_dict() # create an instance of Model200Response from a dict -model200_response_form_dict = model200_response.from_dict(model200_response_dict) +model200_response_from_dict = Model200Response.from_dict(model200_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ModelReturn.md index a5b47f423c8..a69b543d461 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ModelReturn.md @@ -22,7 +22,7 @@ print ModelReturn.to_json() # convert the object into a dict model_return_dict = model_return_instance.to_dict() # create an instance of ModelReturn from a dict -model_return_form_dict = model_return.from_dict(model_return_dict) +model_return_from_dict = ModelReturn.from_dict(model_return_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Name.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Name.md index 4ccd0ce09aa..b2cf3013a47 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Name.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Name.md @@ -25,7 +25,7 @@ print Name.to_json() # convert the object into a dict name_dict = name_instance.to_dict() # create an instance of Name from a dict -name_form_dict = name.from_dict(name_dict) +name_from_dict = Name.from_dict(name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableClass.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableClass.md index 1658756b50e..d6ca700c887 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableClass.md @@ -33,7 +33,7 @@ print NullableClass.to_json() # convert the object into a dict nullable_class_dict = nullable_class_instance.to_dict() # create an instance of NullableClass from a dict -nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict) +nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableProperty.md index fd9cbbc51aa..3771860aafb 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NullableProperty.md @@ -22,7 +22,7 @@ print NullableProperty.to_json() # convert the object into a dict nullable_property_dict = nullable_property_instance.to_dict() # create an instance of NullableProperty from a dict -nullable_property_form_dict = nullable_property.from_dict(nullable_property_dict) +nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NumberOnly.md index f49216ddaa4..eb51449dc20 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/NumberOnly.md @@ -21,7 +21,7 @@ print NumberOnly.to_json() # convert the object into a dict number_only_dict = number_only_instance.to_dict() # create an instance of NumberOnly from a dict -number_only_form_dict = number_only.from_dict(number_only_dict) +number_only_from_dict = NumberOnly.from_dict(number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectToTestAdditionalProperties.md index c4ba9a95850..52d741dcd51 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectToTestAdditionalProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectToTestAdditionalProperties.md @@ -22,7 +22,7 @@ print ObjectToTestAdditionalProperties.to_json() # convert the object into a dict object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict() # create an instance of ObjectToTestAdditionalProperties from a dict -object_to_test_additional_properties_form_dict = object_to_test_additional_properties.from_dict(object_to_test_additional_properties_dict) +object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectWithDeprecatedFields.md index 8daa55a3916..324130af8dd 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ObjectWithDeprecatedFields.md @@ -24,7 +24,7 @@ print ObjectWithDeprecatedFields.to_json() # convert the object into a dict object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict() # create an instance of ObjectWithDeprecatedFields from a dict -object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict) +object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OneOfEnumString.md index c7c28bc2944..981fae92dee 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OneOfEnumString.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OneOfEnumString.md @@ -21,7 +21,7 @@ print OneOfEnumString.to_json() # convert the object into a dict one_of_enum_string_dict = one_of_enum_string_instance.to_dict() # create an instance of OneOfEnumString from a dict -one_of_enum_string_form_dict = one_of_enum_string.from_dict(one_of_enum_string_dict) +one_of_enum_string_from_dict = OneOfEnumString.from_dict(one_of_enum_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Order.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Order.md index e71e955a11d..2eaed8c9278 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Order.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Order.md @@ -26,7 +26,7 @@ print Order.to_json() # convert the object into a dict order_dict = order_instance.to_dict() # create an instance of Order from a dict -order_form_dict = order.from_dict(order_dict) +order_from_dict = Order.from_dict(order_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterComposite.md index 504e266f9a1..f9dc458046b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterComposite.md @@ -23,7 +23,7 @@ print OuterComposite.to_json() # convert the object into a dict outer_composite_dict = outer_composite_instance.to_dict() # create an instance of OuterComposite from a dict -outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict) +outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterObjectWithEnumProperty.md index c6a1cdcbc19..f7ea908c924 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/OuterObjectWithEnumProperty.md @@ -22,7 +22,7 @@ print OuterObjectWithEnumProperty.to_json() # convert the object into a dict outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict() # create an instance of OuterObjectWithEnumProperty from a dict -outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict) +outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Parent.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Parent.md index 9a963a6b722..de6fb2bf47a 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Parent.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Parent.md @@ -21,7 +21,7 @@ print Parent.to_json() # convert the object into a dict parent_dict = parent_instance.to_dict() # create an instance of Parent from a dict -parent_form_dict = parent.from_dict(parent_dict) +parent_from_dict = Parent.from_dict(parent_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ParentWithOptionalDict.md index 04bf9494201..817faeed32f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ParentWithOptionalDict.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ParentWithOptionalDict.md @@ -21,7 +21,7 @@ print ParentWithOptionalDict.to_json() # convert the object into a dict parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() # create an instance of ParentWithOptionalDict from a dict -parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pet.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pet.md index 05a466f880a..4eedd9366ac 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pet.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pet.md @@ -26,7 +26,7 @@ print Pet.to_json() # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pig.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pig.md index 398d6c6c6e3..e729adee35e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pig.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Pig.md @@ -23,7 +23,7 @@ print Pig.to_json() # convert the object into a dict pig_dict = pig_instance.to_dict() # create an instance of Pig from a dict -pig_form_dict = pig.from_dict(pig_dict) +pig_from_dict = Pig.from_dict(pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PoopCleaning.md index bbc93c0203c..2f0ff6470bc 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PoopCleaning.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PoopCleaning.md @@ -23,7 +23,7 @@ print PoopCleaning.to_json() # convert the object into a dict poop_cleaning_dict = poop_cleaning_instance.to_dict() # create an instance of PoopCleaning from a dict -poop_cleaning_form_dict = poop_cleaning.from_dict(poop_cleaning_dict) +poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PrimitiveString.md new file mode 100644 index 00000000000..e4af0dda380 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PrimitiveString.md @@ -0,0 +1,28 @@ +# PrimitiveString + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.primitive_string import PrimitiveString + +# TODO update the JSON string below +json = "{}" +# create an instance of PrimitiveString from a JSON string +primitive_string_instance = PrimitiveString.from_json(json) +# print the JSON string representation of the object +print PrimitiveString.to_json() + +# convert the object into a dict +primitive_string_dict = primitive_string_instance.to_dict() +# create an instance of PrimitiveString from a dict +primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyMap.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyMap.md index f7cf4ba8933..2b727c64409 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyMap.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyMap.md @@ -21,7 +21,7 @@ print PropertyMap.to_json() # convert the object into a dict property_map_dict = property_map_instance.to_dict() # create an instance of PropertyMap from a dict -property_map_form_dict = property_map.from_dict(property_map_dict) +property_map_from_dict = PropertyMap.from_dict(property_map_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyNameCollision.md index 1a9303701b0..b3394adb08b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyNameCollision.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/PropertyNameCollision.md @@ -23,7 +23,7 @@ print PropertyNameCollision.to_json() # convert the object into a dict property_name_collision_dict = property_name_collision_instance.to_dict() # create an instance of PropertyNameCollision from a dict -property_name_collision_form_dict = property_name_collision.from_dict(property_name_collision_dict) +property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ReadOnlyFirst.md index 22b5acca70c..a67f2705bd1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/ReadOnlyFirst.md @@ -22,7 +22,7 @@ print ReadOnlyFirst.to_json() # convert the object into a dict read_only_first_dict = read_only_first_instance.to_dict() # create an instance of ReadOnlyFirst from a dict -read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict) +read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondCircularAllOfRef.md index 4460634382a..bcb8b5fe453 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondCircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondCircularAllOfRef.md @@ -22,7 +22,7 @@ print SecondCircularAllOfRef.to_json() # convert the object into a dict second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict() # create an instance of SecondCircularAllOfRef from a dict -second_circular_all_of_ref_form_dict = second_circular_all_of_ref.from_dict(second_circular_all_of_ref_dict) +second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondRef.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondRef.md index e6fb1e2d4f7..a75a54047b7 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondRef.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SecondRef.md @@ -22,7 +22,7 @@ print SecondRef.to_json() # convert the object into a dict second_ref_dict = second_ref_instance.to_dict() # create an instance of SecondRef from a dict -second_ref_form_dict = second_ref.from_dict(second_ref_dict) +second_ref_from_dict = SecondRef.from_dict(second_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SelfReferenceModel.md index dbf9589d576..1761dbbf371 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SelfReferenceModel.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SelfReferenceModel.md @@ -22,7 +22,7 @@ print SelfReferenceModel.to_json() # convert the object into a dict self_reference_model_dict = self_reference_model_instance.to_dict() # create an instance of SelfReferenceModel from a dict -self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict) +self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialModelName.md index 3d27640abb0..04341261b0b 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialModelName.md @@ -21,7 +21,7 @@ print SpecialModelName.to_json() # convert the object into a dict special_model_name_dict = special_model_name_instance.to_dict() # create an instance of SpecialModelName from a dict -special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict) +special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialName.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialName.md index 0b412952597..ffd2b6b69ba 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialName.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/SpecialName.md @@ -23,7 +23,7 @@ print SpecialName.to_json() # convert the object into a dict special_name_dict = special_name_instance.to_dict() # create an instance of SpecialName from a dict -special_name_form_dict = special_name.from_dict(special_name_dict) +special_name_from_dict = SpecialName.from_dict(special_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tag.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tag.md index e680c68bedd..008d363a3b8 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tag.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tag.md @@ -22,7 +22,7 @@ print Tag.to_json() # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Task.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Task.md index aefe66e7638..42d4dfd17a1 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Task.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Task.md @@ -23,7 +23,7 @@ print Task.to_json() # convert the object into a dict task_dict = task_instance.to_dict() # create an instance of Task from a dict -task_form_dict = task.from_dict(task_dict) +task_from_dict = Task.from_dict(task_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TaskActivity.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TaskActivity.md index eb254906156..381e58581e6 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TaskActivity.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TaskActivity.md @@ -23,7 +23,7 @@ print TaskActivity.to_json() # convert the object into a dict task_activity_dict = task_activity_instance.to_dict() # create an instance of TaskActivity from a dict -task_activity_form_dict = task_activity.from_dict(task_activity_dict) +task_activity_from_dict = TaskActivity.from_dict(task_activity_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel400Response.md index 1ef43ce4cad..98d3e7fe893 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel400Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel400Response.md @@ -21,7 +21,7 @@ print TestErrorResponsesWithModel400Response.to_json() # convert the object into a dict test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel400Response from a dict -test_error_responses_with_model400_response_form_dict = test_error_responses_with_model400_response.from_dict(test_error_responses_with_model400_response_dict) +test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel404Response.md index 9fda9553784..e36e255b21e 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel404Response.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestErrorResponsesWithModel404Response.md @@ -21,7 +21,7 @@ print TestErrorResponsesWithModel404Response.to_json() # convert the object into a dict test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel404Response from a dict -test_error_responses_with_model404_response_form_dict = test_error_responses_with_model404_response.from_dict(test_error_responses_with_model404_response_dict) +test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestInlineFreeformAdditionalPropertiesRequest.md index 7cf86c5244e..7f004690753 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestInlineFreeformAdditionalPropertiesRequest.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -21,7 +21,7 @@ print TestInlineFreeformAdditionalPropertiesRequest.to_json() # convert the object into a dict test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() # create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict -test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestObjectForMultipartRequestsRequestMarker.md index 25613918e92..c85a2648872 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestObjectForMultipartRequestsRequestMarker.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/TestObjectForMultipartRequestsRequestMarker.md @@ -21,7 +21,7 @@ print TestObjectForMultipartRequestsRequestMarker.to_json() # convert the object into a dict test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict() # create an instance of TestObjectForMultipartRequestsRequestMarker from a dict -test_object_for_multipart_requests_request_marker_form_dict = test_object_for_multipart_requests_request_marker.from_dict(test_object_for_multipart_requests_request_marker_dict) +test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tiger.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tiger.md index 6ce50a31f5a..48dd71e9c83 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tiger.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/Tiger.md @@ -21,7 +21,7 @@ print Tiger.to_json() # convert the object into a dict tiger_dict = tiger_instance.to_dict() # create an instance of Tiger from a dict -tiger_form_dict = tiger.from_dict(tiger_dict) +tiger_from_dict = Tiger.from_dict(tiger_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalModelListProperties.md index c102bb86beb..784b34c2965 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalModelListProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalModelListProperties.md @@ -21,7 +21,7 @@ print UnnamedDictWithAdditionalModelListProperties.to_json() # convert the object into a dict unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalModelListProperties from a dict -unnamed_dict_with_additional_model_list_properties_form_dict = unnamed_dict_with_additional_model_list_properties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) +unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalStringListProperties.md index 926404ccd6e..904c007e207 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalStringListProperties.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/UnnamedDictWithAdditionalStringListProperties.md @@ -21,7 +21,7 @@ print UnnamedDictWithAdditionalStringListProperties.to_json() # convert the object into a dict unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalStringListProperties from a dict -unnamed_dict_with_additional_string_list_properties_form_dict = unnamed_dict_with_additional_string_list_properties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) +unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/User.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/User.md index 6d7c357ea86..ff5b1d6f173 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/User.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/User.md @@ -28,7 +28,7 @@ print User.to_json() # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-pydantic-v1/docs/WithNestedOneOf.md index 247afcab99d..f08130c2839 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/docs/WithNestedOneOf.md +++ b/samples/openapi3/client/petstore/python-pydantic-v1/docs/WithNestedOneOf.md @@ -23,7 +23,7 @@ print WithNestedOneOf.to_json() # convert the object into a dict with_nested_one_of_dict = with_nested_one_of_instance.to_dict() # create an instance of WithNestedOneOf from a dict -with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict) +with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py index daedab928cf..c0b99d8bf82 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/__init__.py @@ -53,6 +53,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -86,6 +87,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -114,6 +116,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py index 92d7dc877f2..2124d65dc34 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/__init__.py @@ -28,6 +28,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -61,6 +62,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -89,6 +91,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/base_discriminator.py new file mode 100644 index 00000000000..1eaf3731bf7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/base_discriminator.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional, Union +from pydantic import BaseModel, Field, StrictStr + +from typing import TYPE_CHECKING +from importlib import import_module +if TYPE_CHECKING: + from petstore_api.models.primitive_string import PrimitiveString + from petstore_api.models.info import Info + +class BaseDiscriminator(BaseModel): + """ + BaseDiscriminator + """ + type_name: Optional[StrictStr] = Field(default=None, alias="_typeName") + additional_properties: Dict[str, Any] = {} + __properties = ["_typeName"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + # JSON field name that stores the object type + __discriminator_property_name = '_typeName' + + # discriminator mappings + __discriminator_value_class_map = { + 'string': 'PrimitiveString', + 'Info': 'Info' + } + + @classmethod + def get_discriminator_value(cls, obj: dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union(Info, PrimitiveString): + """Create an instance of BaseDiscriminator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Union(Info, PrimitiveString): + """Create an instance of BaseDiscriminator from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'PrimitiveString': + return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj) + if object_type == 'Info': + return import_module("petstore_api.models.info").Info.from_dict(obj) + raise ValueError("BaseDiscriminator failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py index 7595ca66738..a04be47a43f 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_test.py @@ -34,12 +34,14 @@ class EnumTest(BaseModel): enum_integer_default: Optional[StrictInt] = 5 enum_integer: Optional[StrictInt] = None enum_number: Optional[StrictFloat] = None + enum_number_vendor_ext: Optional[StrictInt] = None + enum_string_vendor_ext: Optional[StrictStr] = None outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum") outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger") outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=None, alias="outerEnumDefaultValue") outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=None, alias="outerEnumIntegerDefaultValue") additional_properties: Dict[str, Any] = {} - __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] + __properties = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_number_vendor_ext", "enum_string_vendor_ext", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @validator('enum_string') def enum_string_validate_enum(cls, value): @@ -88,6 +90,26 @@ class EnumTest(BaseModel): raise ValueError("must be one of enum values (1.1, -1.2)") return value + @validator('enum_number_vendor_ext') + def enum_number_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in (42, 18, 56): + raise ValueError("must be one of enum values (42, 18, 56)") + return value + + @validator('enum_string_vendor_ext') + def enum_string_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ('FOO', 'Bar', 'baz'): + raise ValueError("must be one of enum values ('FOO', 'Bar', 'baz')") + return value + class Config: """Pydantic configuration""" allow_population_by_field_name = True @@ -140,6 +162,8 @@ class EnumTest(BaseModel): "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5, "enum_integer": obj.get("enum_integer"), "enum_number": obj.get("enum_number"), + "enum_number_vendor_ext": obj.get("enum_number_vendor_ext"), + "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outer_enum": obj.get("outerEnum"), "outer_enum_integer": obj.get("outerEnumInteger"), "outer_enum_default_value": obj.get("outerEnumDefaultValue"), diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/info.py new file mode 100644 index 00000000000..46ea104c0a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/info.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional + +from petstore_api.models.base_discriminator import BaseDiscriminator + +class Info(BaseDiscriminator): + """ + Info + """ + val: Optional[BaseDiscriminator] = None + additional_properties: Dict[str, Any] = {} + __properties = ["_typeName", "val"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Info: + """Create an instance of Info from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of val + if self.val: + _dict['val'] = self.val.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> Info: + """Create an instance of Info from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Info.parse_obj(obj) + + _obj = Info.parse_obj({ + "type_name": obj.get("_typeName"), + "val": BaseDiscriminator.from_dict(obj.get("val")) if obj.get("val") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/primitive_string.py new file mode 100644 index 00000000000..b67daec1d98 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/primitive_string.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, Dict, Optional +from pydantic import Field, StrictStr +from petstore_api.models.base_discriminator import BaseDiscriminator + +class PrimitiveString(BaseDiscriminator): + """ + PrimitiveString + """ + value: Optional[StrictStr] = Field(default=None, alias="_value") + additional_properties: Dict[str, Any] = {} + __properties = ["_typeName", "_value"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PrimitiveString: + """Create an instance of PrimitiveString from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + "additional_properties" + }, + exclude_none=True) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PrimitiveString: + """Create an instance of PrimitiveString from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PrimitiveString.parse_obj(obj) + + _obj = PrimitiveString.parse_obj({ + "type_name": obj.get("_typeName"), + "value": obj.get("_value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_base_discriminator.py new file mode 100644 index 00000000000..c31f6bdea26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_base_discriminator.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.base_discriminator import BaseDiscriminator # noqa: E501 + +class TestBaseDiscriminator(unittest.TestCase): + """BaseDiscriminator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseDiscriminator: + """Test BaseDiscriminator + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseDiscriminator` + """ + model = BaseDiscriminator() # noqa: E501 + if include_optional: + return BaseDiscriminator( + type_name = '' + ) + else: + return BaseDiscriminator( + ) + """ + + def testBaseDiscriminator(self): + """Test BaseDiscriminator""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_info.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_info.py new file mode 100644 index 00000000000..f16c34e34a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_info.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.info import Info # noqa: E501 + +class TestInfo(unittest.TestCase): + """Info unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Info: + """Test Info + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Info` + """ + model = Info() # noqa: E501 + if include_optional: + return Info( + val = petstore_api.models.base_discriminator.BaseDiscriminator() + ) + else: + return Info( + ) + """ + + def testInfo(self): + """Test Info""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/test/test_primitive_string.py b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_primitive_string.py new file mode 100644 index 00000000000..7d873f8d621 --- /dev/null +++ b/samples/openapi3/client/petstore/python-pydantic-v1/test/test_primitive_string.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from petstore_api.models.primitive_string import PrimitiveString # noqa: E501 + +class TestPrimitiveString(unittest.TestCase): + """PrimitiveString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PrimitiveString: + """Test PrimitiveString + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PrimitiveString` + """ + model = PrimitiveString() # noqa: E501 + if include_optional: + return PrimitiveString( + value = '' + ) + else: + return PrimitiveString( + ) + """ + + def testPrimitiveString(self): + """Test PrimitiveString""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES index f7e65690c39..6b44ba44379 100755 --- a/samples/openapi3/client/petstore/python/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -17,6 +17,7 @@ docs/ArrayOfArrayOfModel.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md +docs/BaseDiscriminator.md docs/BasquePig.md docs/Bathing.md docs/Capitalization.md @@ -53,6 +54,7 @@ docs/FormatTest.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/ImportTestDatetimeApi.md +docs/Info.md docs/InnerDictWithProperty.md docs/InputAllOf.md docs/IntOrString.md @@ -84,6 +86,7 @@ docs/Pet.md docs/PetApi.md docs/Pig.md docs/PoopCleaning.md +docs/PrimitiveString.md docs/PropertyMap.md docs/PropertyNameCollision.md docs/ReadOnlyFirst.md @@ -137,6 +140,7 @@ petstore_api/models/array_of_array_of_model.py petstore_api/models/array_of_array_of_number_only.py petstore_api/models/array_of_number_only.py petstore_api/models/array_test.py +petstore_api/models/base_discriminator.py petstore_api/models/basque_pig.py petstore_api/models/bathing.py petstore_api/models/capitalization.py @@ -169,6 +173,7 @@ petstore_api/models/foo_get_default_response.py petstore_api/models/format_test.py petstore_api/models/has_only_read_only.py petstore_api/models/health_check_result.py +petstore_api/models/info.py petstore_api/models/inner_dict_with_property.py petstore_api/models/input_all_of.py petstore_api/models/int_or_string.py @@ -199,6 +204,7 @@ petstore_api/models/parent_with_optional_dict.py petstore_api/models/pet.py petstore_api/models/pig.py petstore_api/models/poop_cleaning.py +petstore_api/models/primitive_string.py petstore_api/models/property_map.py petstore_api/models/property_name_collision.py petstore_api/models/read_only_first.py diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 07a616c2f2c..8fadc3e3acb 100755 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -163,6 +163,7 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BaseDiscriminator](docs/BaseDiscriminator.md) - [BasquePig](docs/BasquePig.md) - [Bathing](docs/Bathing.md) - [Capitalization](docs/Capitalization.md) @@ -195,6 +196,7 @@ Class | Method | HTTP request | Description - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) + - [Info](docs/Info.md) - [InnerDictWithProperty](docs/InnerDictWithProperty.md) - [InputAllOf](docs/InputAllOf.md) - [IntOrString](docs/IntOrString.md) @@ -225,6 +227,7 @@ Class | Method | HTTP request | Description - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - [PoopCleaning](docs/PoopCleaning.md) + - [PrimitiveString](docs/PrimitiveString.md) - [PropertyMap](docs/PropertyMap.md) - [PropertyNameCollision](docs/PropertyNameCollision.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesAnyType.md index a47fbd73260..314cba3a614 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesAnyType.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesAnyType.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesAnyType.to_json()) # convert the object into a dict additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict() # create an instance of AdditionalPropertiesAnyType from a dict -additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict) +additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md index a19d1b338e6..8d4c08707f5 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -23,7 +23,7 @@ print(AdditionalPropertiesClass.to_json()) # convert the object into a dict additional_properties_class_dict = additional_properties_class_instance.to_dict() # create an instance of AdditionalPropertiesClass from a dict -additional_properties_class_form_dict = additional_properties_class.from_dict(additional_properties_class_dict) +additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesObject.md index f9c516ee9b6..d647ec64896 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesObject.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesObject.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesObject.to_json()) # convert the object into a dict additional_properties_object_dict = additional_properties_object_instance.to_dict() # create an instance of AdditionalPropertiesObject from a dict -additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict) +additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithDescriptionOnly.md index 3dbb9c6f3e9..061f5524872 100644 --- a/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithDescriptionOnly.md +++ b/samples/openapi3/client/petstore/python/docs/AdditionalPropertiesWithDescriptionOnly.md @@ -22,7 +22,7 @@ print(AdditionalPropertiesWithDescriptionOnly.to_json()) # convert the object into a dict additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict() # create an instance of AdditionalPropertiesWithDescriptionOnly from a dict -additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict) +additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python/docs/AllOfSuperModel.md index 1262bd9dc51..421a1527f1e 100644 --- a/samples/openapi3/client/petstore/python/docs/AllOfSuperModel.md +++ b/samples/openapi3/client/petstore/python/docs/AllOfSuperModel.md @@ -22,7 +22,7 @@ print(AllOfSuperModel.to_json()) # convert the object into a dict all_of_super_model_dict = all_of_super_model_instance.to_dict() # create an instance of AllOfSuperModel from a dict -all_of_super_model_form_dict = all_of_super_model.from_dict(all_of_super_model_dict) +all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python/docs/AllOfWithSingleRef.md index 6c2860c02f5..203a4b5da3d 100644 --- a/samples/openapi3/client/petstore/python/docs/AllOfWithSingleRef.md +++ b/samples/openapi3/client/petstore/python/docs/AllOfWithSingleRef.md @@ -23,7 +23,7 @@ print(AllOfWithSingleRef.to_json()) # convert the object into a dict all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict() # create an instance of AllOfWithSingleRef from a dict -all_of_with_single_ref_form_dict = all_of_with_single_ref.from_dict(all_of_with_single_ref_dict) +all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python/docs/Animal.md index 4c693f09e5f..381d27b66e4 100644 --- a/samples/openapi3/client/petstore/python/docs/Animal.md +++ b/samples/openapi3/client/petstore/python/docs/Animal.md @@ -23,7 +23,7 @@ print(Animal.to_json()) # convert the object into a dict animal_dict = animal_instance.to_dict() # create an instance of Animal from a dict -animal_form_dict = animal.from_dict(animal_dict) +animal_from_dict = Animal.from_dict(animal_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python/docs/AnyOfColor.md index ccaf51ce9fe..6ed75dd7b48 100644 --- a/samples/openapi3/client/petstore/python/docs/AnyOfColor.md +++ b/samples/openapi3/client/petstore/python/docs/AnyOfColor.md @@ -22,7 +22,7 @@ print(AnyOfColor.to_json()) # convert the object into a dict any_of_color_dict = any_of_color_instance.to_dict() # create an instance of AnyOfColor from a dict -any_of_color_form_dict = any_of_color.from_dict(any_of_color_dict) +any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python/docs/AnyOfPig.md index 52109d6670c..9367e226189 100644 --- a/samples/openapi3/client/petstore/python/docs/AnyOfPig.md +++ b/samples/openapi3/client/petstore/python/docs/AnyOfPig.md @@ -24,7 +24,7 @@ print(AnyOfPig.to_json()) # convert the object into a dict any_of_pig_dict = any_of_pig_instance.to_dict() # create an instance of AnyOfPig from a dict -any_of_pig_form_dict = any_of_pig.from_dict(any_of_pig_dict) +any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfModel.md index 1cd9c367b26..f866863d53f 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfModel.md @@ -22,7 +22,7 @@ print(ArrayOfArrayOfModel.to_json()) # convert the object into a dict array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict() # create an instance of ArrayOfArrayOfModel from a dict -array_of_array_of_model_form_dict = array_of_array_of_model.from_dict(array_of_array_of_model_dict) +array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md index 3ad18d346f6..32bd2dfbf1e 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md @@ -22,7 +22,7 @@ print(ArrayOfArrayOfNumberOnly.to_json()) # convert the object into a dict array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict() # create an instance of ArrayOfArrayOfNumberOnly from a dict -array_of_array_of_number_only_form_dict = array_of_array_of_number_only.from_dict(array_of_array_of_number_only_dict) +array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md index a606e3a54bb..b814d759494 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayOfNumberOnly.md @@ -22,7 +22,7 @@ print(ArrayOfNumberOnly.to_json()) # convert the object into a dict array_of_number_only_dict = array_of_number_only_instance.to_dict() # create an instance of ArrayOfNumberOnly from a dict -array_of_number_only_form_dict = array_of_number_only.from_dict(array_of_number_only_dict) +array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ArrayTest.md b/samples/openapi3/client/petstore/python/docs/ArrayTest.md index a673e8a2893..ed871fae662 100644 --- a/samples/openapi3/client/petstore/python/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python/docs/ArrayTest.md @@ -25,7 +25,7 @@ print(ArrayTest.to_json()) # convert the object into a dict array_test_dict = array_test_instance.to_dict() # create an instance of ArrayTest from a dict -array_test_form_dict = array_test.from_dict(array_test_dict) +array_test_from_dict = ArrayTest.from_dict(array_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python/docs/BaseDiscriminator.md new file mode 100644 index 00000000000..fcdbeb032e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/BaseDiscriminator.md @@ -0,0 +1,29 @@ +# BaseDiscriminator + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type_name** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.base_discriminator import BaseDiscriminator + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseDiscriminator from a JSON string +base_discriminator_instance = BaseDiscriminator.from_json(json) +# print the JSON string representation of the object +print(BaseDiscriminator.to_json()) + +# convert the object into a dict +base_discriminator_dict = base_discriminator_instance.to_dict() +# create an instance of BaseDiscriminator from a dict +base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/BasquePig.md b/samples/openapi3/client/petstore/python/docs/BasquePig.md index aa3b3d28b3e..ee28d628722 100644 --- a/samples/openapi3/client/petstore/python/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python/docs/BasquePig.md @@ -23,7 +23,7 @@ print(BasquePig.to_json()) # convert the object into a dict basque_pig_dict = basque_pig_instance.to_dict() # create an instance of BasquePig from a dict -basque_pig_form_dict = basque_pig.from_dict(basque_pig_dict) +basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Bathing.md b/samples/openapi3/client/petstore/python/docs/Bathing.md index bb8d40ac8ab..6ad70e2f67c 100644 --- a/samples/openapi3/client/petstore/python/docs/Bathing.md +++ b/samples/openapi3/client/petstore/python/docs/Bathing.md @@ -24,7 +24,7 @@ print(Bathing.to_json()) # convert the object into a dict bathing_dict = bathing_instance.to_dict() # create an instance of Bathing from a dict -bathing_form_dict = bathing.from_dict(bathing_dict) +bathing_from_dict = Bathing.from_dict(bathing_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Capitalization.md b/samples/openapi3/client/petstore/python/docs/Capitalization.md index 7f1a36413d5..6f564a8ed8c 100644 --- a/samples/openapi3/client/petstore/python/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python/docs/Capitalization.md @@ -27,7 +27,7 @@ print(Capitalization.to_json()) # convert the object into a dict capitalization_dict = capitalization_instance.to_dict() # create an instance of Capitalization from a dict -capitalization_form_dict = capitalization.from_dict(capitalization_dict) +capitalization_from_dict = Capitalization.from_dict(capitalization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Cat.md b/samples/openapi3/client/petstore/python/docs/Cat.md index a2d4b88805f..d0e39efdb33 100644 --- a/samples/openapi3/client/petstore/python/docs/Cat.md +++ b/samples/openapi3/client/petstore/python/docs/Cat.md @@ -22,7 +22,7 @@ print(Cat.to_json()) # convert the object into a dict cat_dict = cat_instance.to_dict() # create an instance of Cat from a dict -cat_form_dict = cat.from_dict(cat_dict) +cat_from_dict = Cat.from_dict(cat_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python/docs/Category.md index 24160009af4..dbde14b7344 100644 --- a/samples/openapi3/client/petstore/python/docs/Category.md +++ b/samples/openapi3/client/petstore/python/docs/Category.md @@ -23,7 +23,7 @@ print(Category.to_json()) # convert the object into a dict category_dict = category_instance.to_dict() # create an instance of Category from a dict -category_form_dict = category.from_dict(category_dict) +category_from_dict = Category.from_dict(category_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python/docs/CircularAllOfRef.md index a00be37d4d1..65b171177e5 100644 --- a/samples/openapi3/client/petstore/python/docs/CircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python/docs/CircularAllOfRef.md @@ -23,7 +23,7 @@ print(CircularAllOfRef.to_json()) # convert the object into a dict circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict() # create an instance of CircularAllOfRef from a dict -circular_all_of_ref_form_dict = circular_all_of_ref.from_dict(circular_all_of_ref_dict) +circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python/docs/CircularReferenceModel.md index 6695d4a7613..87216f7273a 100644 --- a/samples/openapi3/client/petstore/python/docs/CircularReferenceModel.md +++ b/samples/openapi3/client/petstore/python/docs/CircularReferenceModel.md @@ -23,7 +23,7 @@ print(CircularReferenceModel.to_json()) # convert the object into a dict circular_reference_model_dict = circular_reference_model_instance.to_dict() # create an instance of CircularReferenceModel from a dict -circular_reference_model_form_dict = circular_reference_model.from_dict(circular_reference_model_dict) +circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ClassModel.md b/samples/openapi3/client/petstore/python/docs/ClassModel.md index 25351614fa4..ea76a5c157b 100644 --- a/samples/openapi3/client/petstore/python/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python/docs/ClassModel.md @@ -23,7 +23,7 @@ print(ClassModel.to_json()) # convert the object into a dict class_model_dict = class_model_instance.to_dict() # create an instance of ClassModel from a dict -class_model_form_dict = class_model.from_dict(class_model_dict) +class_model_from_dict = ClassModel.from_dict(class_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Client.md b/samples/openapi3/client/petstore/python/docs/Client.md index b601737b02f..22321c18915 100644 --- a/samples/openapi3/client/petstore/python/docs/Client.md +++ b/samples/openapi3/client/petstore/python/docs/Client.md @@ -22,7 +22,7 @@ print(Client.to_json()) # convert the object into a dict client_dict = client_instance.to_dict() # create an instance of Client from a dict -client_form_dict = client.from_dict(client_dict) +client_from_dict = Client.from_dict(client_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Color.md b/samples/openapi3/client/petstore/python/docs/Color.md index 9bd63f91d7c..9ac3ab2e91f 100644 --- a/samples/openapi3/client/petstore/python/docs/Color.md +++ b/samples/openapi3/client/petstore/python/docs/Color.md @@ -22,7 +22,7 @@ print(Color.to_json()) # convert the object into a dict color_dict = color_instance.to_dict() # create an instance of Color from a dict -color_form_dict = color.from_dict(color_dict) +color_from_dict = Color.from_dict(color_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Creature.md b/samples/openapi3/client/petstore/python/docs/Creature.md index fa1ec65401b..a4710214c19 100644 --- a/samples/openapi3/client/petstore/python/docs/Creature.md +++ b/samples/openapi3/client/petstore/python/docs/Creature.md @@ -23,7 +23,7 @@ print(Creature.to_json()) # convert the object into a dict creature_dict = creature_instance.to_dict() # create an instance of Creature from a dict -creature_form_dict = creature.from_dict(creature_dict) +creature_from_dict = Creature.from_dict(creature_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python/docs/CreatureInfo.md index fe4ab81a807..db3b82bb9ff 100644 --- a/samples/openapi3/client/petstore/python/docs/CreatureInfo.md +++ b/samples/openapi3/client/petstore/python/docs/CreatureInfo.md @@ -22,7 +22,7 @@ print(CreatureInfo.to_json()) # convert the object into a dict creature_info_dict = creature_info_instance.to_dict() # create an instance of CreatureInfo from a dict -creature_info_form_dict = creature_info.from_dict(creature_info_dict) +creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DanishPig.md b/samples/openapi3/client/petstore/python/docs/DanishPig.md index 6aef777ffe0..16941388832 100644 --- a/samples/openapi3/client/petstore/python/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python/docs/DanishPig.md @@ -23,7 +23,7 @@ print(DanishPig.to_json()) # convert the object into a dict danish_pig_dict = danish_pig_instance.to_dict() # create an instance of DanishPig from a dict -danish_pig_form_dict = danish_pig.from_dict(danish_pig_dict) +danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python/docs/DeprecatedObject.md index 5de685050ff..6b362f379ba 100644 --- a/samples/openapi3/client/petstore/python/docs/DeprecatedObject.md +++ b/samples/openapi3/client/petstore/python/docs/DeprecatedObject.md @@ -22,7 +22,7 @@ print(DeprecatedObject.to_json()) # convert the object into a dict deprecated_object_dict = deprecated_object_instance.to_dict() # create an instance of DeprecatedObject from a dict -deprecated_object_form_dict = deprecated_object.from_dict(deprecated_object_dict) +deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md index e7cd36010f5..f72b6e8e68c 100644 --- a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md +++ b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSub.md @@ -21,7 +21,7 @@ print(DiscriminatorAllOfSub.to_json()) # convert the object into a dict discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict() # create an instance of DiscriminatorAllOfSub from a dict -discriminator_all_of_sub_form_dict = discriminator_all_of_sub.from_dict(discriminator_all_of_sub_dict) +discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md index 4859a9a6d40..477c05bfc44 100644 --- a/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md +++ b/samples/openapi3/client/petstore/python/docs/DiscriminatorAllOfSuper.md @@ -22,7 +22,7 @@ print(DiscriminatorAllOfSuper.to_json()) # convert the object into a dict discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict() # create an instance of DiscriminatorAllOfSuper from a dict -discriminator_all_of_super_form_dict = discriminator_all_of_super.from_dict(discriminator_all_of_super_dict) +discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Dog.md b/samples/openapi3/client/petstore/python/docs/Dog.md index ecb20592957..ed23f613d01 100644 --- a/samples/openapi3/client/petstore/python/docs/Dog.md +++ b/samples/openapi3/client/petstore/python/docs/Dog.md @@ -22,7 +22,7 @@ print(Dog.to_json()) # convert the object into a dict dog_dict = dog_instance.to_dict() # create an instance of Dog from a dict -dog_form_dict = dog.from_dict(dog_dict) +dog_from_dict = Dog.from_dict(dog_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/DummyModel.md b/samples/openapi3/client/petstore/python/docs/DummyModel.md index 21a59bef1bf..01b675977f5 100644 --- a/samples/openapi3/client/petstore/python/docs/DummyModel.md +++ b/samples/openapi3/client/petstore/python/docs/DummyModel.md @@ -23,7 +23,7 @@ print(DummyModel.to_json()) # convert the object into a dict dummy_model_dict = dummy_model_instance.to_dict() # create an instance of DummyModel from a dict -dummy_model_form_dict = dummy_model.from_dict(dummy_model_dict) +dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumArrays.md b/samples/openapi3/client/petstore/python/docs/EnumArrays.md index 6a5293dfcc6..f44617497bc 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python/docs/EnumArrays.md @@ -23,7 +23,7 @@ print(EnumArrays.to_json()) # convert the object into a dict enum_arrays_dict = enum_arrays_instance.to_dict() # create an instance of EnumArrays from a dict -enum_arrays_form_dict = enum_arrays.from_dict(enum_arrays_dict) +enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/EnumTest.md b/samples/openapi3/client/petstore/python/docs/EnumTest.md index 494a4d054f0..dd37f9cc7b4 100644 --- a/samples/openapi3/client/petstore/python/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python/docs/EnumTest.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **enum_integer_default** | **int** | | [optional] [default to 5] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] +**enum_number_vendor_ext** | **int** | | [optional] +**enum_string_vendor_ext** | **str** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] **outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] **outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] @@ -30,7 +32,7 @@ print(EnumTest.to_json()) # convert the object into a dict enum_test_dict = enum_test_instance.to_dict() # create an instance of EnumTest from a dict -enum_test_form_dict = enum_test.from_dict(enum_test_dict) +enum_test_from_dict = EnumTest.from_dict(enum_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Feeding.md b/samples/openapi3/client/petstore/python/docs/Feeding.md index 7d1e83627dd..9f92b5d964d 100644 --- a/samples/openapi3/client/petstore/python/docs/Feeding.md +++ b/samples/openapi3/client/petstore/python/docs/Feeding.md @@ -24,7 +24,7 @@ print(Feeding.to_json()) # convert the object into a dict feeding_dict = feeding_instance.to_dict() # create an instance of Feeding from a dict -feeding_form_dict = feeding.from_dict(feeding_dict) +feeding_from_dict = Feeding.from_dict(feeding_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/File.md b/samples/openapi3/client/petstore/python/docs/File.md index 1b03d58761c..23f0567411c 100644 --- a/samples/openapi3/client/petstore/python/docs/File.md +++ b/samples/openapi3/client/petstore/python/docs/File.md @@ -23,7 +23,7 @@ print(File.to_json()) # convert the object into a dict file_dict = file_instance.to_dict() # create an instance of File from a dict -file_form_dict = file.from_dict(file_dict) +file_from_dict = File.from_dict(file_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md index 26a1758abfe..e1118042a8e 100644 --- a/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python/docs/FileSchemaTestClass.md @@ -23,7 +23,7 @@ print(FileSchemaTestClass.to_json()) # convert the object into a dict file_schema_test_class_dict = file_schema_test_class_instance.to_dict() # create an instance of FileSchemaTestClass from a dict -file_schema_test_class_form_dict = file_schema_test_class.from_dict(file_schema_test_class_dict) +file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FirstRef.md b/samples/openapi3/client/petstore/python/docs/FirstRef.md index 5092de432d3..94b8ddc5ac2 100644 --- a/samples/openapi3/client/petstore/python/docs/FirstRef.md +++ b/samples/openapi3/client/petstore/python/docs/FirstRef.md @@ -23,7 +23,7 @@ print(FirstRef.to_json()) # convert the object into a dict first_ref_dict = first_ref_instance.to_dict() # create an instance of FirstRef from a dict -first_ref_form_dict = first_ref.from_dict(first_ref_dict) +first_ref_from_dict = FirstRef.from_dict(first_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python/docs/Foo.md index 020b8d75b76..f635b0daa6d 100644 --- a/samples/openapi3/client/petstore/python/docs/Foo.md +++ b/samples/openapi3/client/petstore/python/docs/Foo.md @@ -22,7 +22,7 @@ print(Foo.to_json()) # convert the object into a dict foo_dict = foo_instance.to_dict() # create an instance of Foo from a dict -foo_form_dict = foo.from_dict(foo_dict) +foo_from_dict = Foo.from_dict(foo_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md index 755c3232bbf..8d84f795b00 100644 --- a/samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md +++ b/samples/openapi3/client/petstore/python/docs/FooGetDefaultResponse.md @@ -22,7 +22,7 @@ print(FooGetDefaultResponse.to_json()) # convert the object into a dict foo_get_default_response_dict = foo_get_default_response_instance.to_dict() # create an instance of FooGetDefaultResponse from a dict -foo_get_default_response_form_dict = foo_get_default_response.from_dict(foo_get_default_response_dict) +foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FormatTest.md b/samples/openapi3/client/petstore/python/docs/FormatTest.md index 3b2f44457f1..6be7fc01757 100644 --- a/samples/openapi3/client/petstore/python/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python/docs/FormatTest.md @@ -38,7 +38,7 @@ print(FormatTest.to_json()) # convert the object into a dict format_test_dict = format_test_instance.to_dict() # create an instance of FormatTest from a dict -format_test_form_dict = format_test.from_dict(format_test_dict) +format_test_from_dict = FormatTest.from_dict(format_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md index 00d2af2fd33..fdc48781b15 100644 --- a/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python/docs/HasOnlyReadOnly.md @@ -23,7 +23,7 @@ print(HasOnlyReadOnly.to_json()) # convert the object into a dict has_only_read_only_dict = has_only_read_only_instance.to_dict() # create an instance of HasOnlyReadOnly from a dict -has_only_read_only_form_dict = has_only_read_only.from_dict(has_only_read_only_dict) +has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md index d32450f4c2e..d4a2b187167 100644 --- a/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python/docs/HealthCheckResult.md @@ -23,7 +23,7 @@ print(HealthCheckResult.to_json()) # convert the object into a dict health_check_result_dict = health_check_result_instance.to_dict() # create an instance of HealthCheckResult from a dict -health_check_result_form_dict = health_check_result.from_dict(health_check_result_dict) +health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Info.md b/samples/openapi3/client/petstore/python/docs/Info.md new file mode 100644 index 00000000000..db88778a914 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/Info.md @@ -0,0 +1,29 @@ +# Info + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional] + +## Example + +```python +from petstore_api.models.info import Info + +# TODO update the JSON string below +json = "{}" +# create an instance of Info from a JSON string +info_instance = Info.from_json(json) +# print the JSON string representation of the object +print(Info.to_json()) + +# convert the object into a dict +info_dict = info_instance.to_dict() +# create an instance of Info from a dict +info_from_dict = Info.from_dict(info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python/docs/InnerDictWithProperty.md index efd91b13f3a..7b82ebb770b 100644 --- a/samples/openapi3/client/petstore/python/docs/InnerDictWithProperty.md +++ b/samples/openapi3/client/petstore/python/docs/InnerDictWithProperty.md @@ -22,7 +22,7 @@ print(InnerDictWithProperty.to_json()) # convert the object into a dict inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict() # create an instance of InnerDictWithProperty from a dict -inner_dict_with_property_form_dict = inner_dict_with_property.from_dict(inner_dict_with_property_dict) +inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InputAllOf.md b/samples/openapi3/client/petstore/python/docs/InputAllOf.md index 7d6404e3f27..45298f5308f 100644 --- a/samples/openapi3/client/petstore/python/docs/InputAllOf.md +++ b/samples/openapi3/client/petstore/python/docs/InputAllOf.md @@ -22,7 +22,7 @@ print(InputAllOf.to_json()) # convert the object into a dict input_all_of_dict = input_all_of_instance.to_dict() # create an instance of InputAllOf from a dict -input_all_of_form_dict = input_all_of.from_dict(input_all_of_dict) +input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/IntOrString.md b/samples/openapi3/client/petstore/python/docs/IntOrString.md index c2f6fd5838e..b4070b9a8c7 100644 --- a/samples/openapi3/client/petstore/python/docs/IntOrString.md +++ b/samples/openapi3/client/petstore/python/docs/IntOrString.md @@ -21,7 +21,7 @@ print(IntOrString.to_json()) # convert the object into a dict int_or_string_dict = int_or_string_instance.to_dict() # create an instance of IntOrString from a dict -int_or_string_form_dict = int_or_string.from_dict(int_or_string_dict) +int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ListClass.md b/samples/openapi3/client/petstore/python/docs/ListClass.md index 3595f39de14..01068b7d22c 100644 --- a/samples/openapi3/client/petstore/python/docs/ListClass.md +++ b/samples/openapi3/client/petstore/python/docs/ListClass.md @@ -22,7 +22,7 @@ print(ListClass.to_json()) # convert the object into a dict list_class_dict = list_class_instance.to_dict() # create an instance of ListClass from a dict -list_class_form_dict = list_class.from_dict(list_class_dict) +list_class_from_dict = ListClass.from_dict(list_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python/docs/MapOfArrayOfModel.md index 2220ab1f7c4..71a4ef66b68 100644 --- a/samples/openapi3/client/petstore/python/docs/MapOfArrayOfModel.md +++ b/samples/openapi3/client/petstore/python/docs/MapOfArrayOfModel.md @@ -22,7 +22,7 @@ print(MapOfArrayOfModel.to_json()) # convert the object into a dict map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict() # create an instance of MapOfArrayOfModel from a dict -map_of_array_of_model_form_dict = map_of_array_of_model.from_dict(map_of_array_of_model_dict) +map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/MapTest.md b/samples/openapi3/client/petstore/python/docs/MapTest.md index bd62a851e92..d04b82e9378 100644 --- a/samples/openapi3/client/petstore/python/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python/docs/MapTest.md @@ -25,7 +25,7 @@ print(MapTest.to_json()) # convert the object into a dict map_test_dict = map_test_instance.to_dict() # create an instance of MapTest from a dict -map_test_form_dict = map_test.from_dict(map_test_dict) +map_test_from_dict = MapTest.from_dict(map_test_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 7cab16af173..0dc994275d1 100644 --- a/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -24,7 +24,7 @@ print(MixedPropertiesAndAdditionalPropertiesClass.to_json()) # convert the object into a dict mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict() # create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict -mixed_properties_and_additional_properties_class_form_dict = mixed_properties_and_additional_properties_class.from_dict(mixed_properties_and_additional_properties_class_dict) +mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Model200Response.md b/samples/openapi3/client/petstore/python/docs/Model200Response.md index 454a4fcf30a..7fdbdefc6ce 100644 --- a/samples/openapi3/client/petstore/python/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python/docs/Model200Response.md @@ -24,7 +24,7 @@ print(Model200Response.to_json()) # convert the object into a dict model200_response_dict = model200_response_instance.to_dict() # create an instance of Model200Response from a dict -model200_response_form_dict = model200_response.from_dict(model200_response_dict) +model200_response_from_dict = Model200Response.from_dict(model200_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ModelApiResponse.md b/samples/openapi3/client/petstore/python/docs/ModelApiResponse.md index 8e0a033bd64..5ddc0db2a0f 100644 --- a/samples/openapi3/client/petstore/python/docs/ModelApiResponse.md +++ b/samples/openapi3/client/petstore/python/docs/ModelApiResponse.md @@ -24,7 +24,7 @@ print(ModelApiResponse.to_json()) # convert the object into a dict model_api_response_dict = model_api_response_instance.to_dict() # create an instance of ModelApiResponse from a dict -model_api_response_form_dict = model_api_response.from_dict(model_api_response_dict) +model_api_response_from_dict = ModelApiResponse.from_dict(model_api_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ModelField.md b/samples/openapi3/client/petstore/python/docs/ModelField.md index f5f03fd82d2..9073b5dbdb0 100644 --- a/samples/openapi3/client/petstore/python/docs/ModelField.md +++ b/samples/openapi3/client/petstore/python/docs/ModelField.md @@ -22,7 +22,7 @@ print(ModelField.to_json()) # convert the object into a dict model_field_dict = model_field_instance.to_dict() # create an instance of ModelField from a dict -model_field_form_dict = model_field.from_dict(model_field_dict) +model_field_from_dict = ModelField.from_dict(model_field_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ModelReturn.md b/samples/openapi3/client/petstore/python/docs/ModelReturn.md index 6b660953e1d..7d327053b0c 100644 --- a/samples/openapi3/client/petstore/python/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python/docs/ModelReturn.md @@ -23,7 +23,7 @@ print(ModelReturn.to_json()) # convert the object into a dict model_return_dict = model_return_instance.to_dict() # create an instance of ModelReturn from a dict -model_return_form_dict = model_return.from_dict(model_return_dict) +model_return_from_dict = ModelReturn.from_dict(model_return_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Name.md b/samples/openapi3/client/petstore/python/docs/Name.md index 5c5986a76d0..5a04ec1ada0 100644 --- a/samples/openapi3/client/petstore/python/docs/Name.md +++ b/samples/openapi3/client/petstore/python/docs/Name.md @@ -26,7 +26,7 @@ print(Name.to_json()) # convert the object into a dict name_dict = name_instance.to_dict() # create an instance of Name from a dict -name_form_dict = name.from_dict(name_dict) +name_from_dict = Name.from_dict(name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NullableClass.md b/samples/openapi3/client/petstore/python/docs/NullableClass.md index 3657d21255c..0387dcc2c67 100644 --- a/samples/openapi3/client/petstore/python/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python/docs/NullableClass.md @@ -34,7 +34,7 @@ print(NullableClass.to_json()) # convert the object into a dict nullable_class_dict = nullable_class_instance.to_dict() # create an instance of NullableClass from a dict -nullable_class_form_dict = nullable_class.from_dict(nullable_class_dict) +nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NullableProperty.md b/samples/openapi3/client/petstore/python/docs/NullableProperty.md index 27ce3192f84..30edaf4844b 100644 --- a/samples/openapi3/client/petstore/python/docs/NullableProperty.md +++ b/samples/openapi3/client/petstore/python/docs/NullableProperty.md @@ -23,7 +23,7 @@ print(NullableProperty.to_json()) # convert the object into a dict nullable_property_dict = nullable_property_instance.to_dict() # create an instance of NullableProperty from a dict -nullable_property_form_dict = nullable_property.from_dict(nullable_property_dict) +nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/NumberOnly.md b/samples/openapi3/client/petstore/python/docs/NumberOnly.md index 72e0a4bfde0..415dd25585d 100644 --- a/samples/openapi3/client/petstore/python/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python/docs/NumberOnly.md @@ -22,7 +22,7 @@ print(NumberOnly.to_json()) # convert the object into a dict number_only_dict = number_only_instance.to_dict() # create an instance of NumberOnly from a dict -number_only_form_dict = number_only.from_dict(number_only_dict) +number_only_from_dict = NumberOnly.from_dict(number_only_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python/docs/ObjectToTestAdditionalProperties.md index 5d2c76c8958..f6bc34c98e6 100644 --- a/samples/openapi3/client/petstore/python/docs/ObjectToTestAdditionalProperties.md +++ b/samples/openapi3/client/petstore/python/docs/ObjectToTestAdditionalProperties.md @@ -23,7 +23,7 @@ print(ObjectToTestAdditionalProperties.to_json()) # convert the object into a dict object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict() # create an instance of ObjectToTestAdditionalProperties from a dict -object_to_test_additional_properties_form_dict = object_to_test_additional_properties.from_dict(object_to_test_additional_properties_dict) +object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python/docs/ObjectWithDeprecatedFields.md index b1077a60b95..6dbd2ace04f 100644 --- a/samples/openapi3/client/petstore/python/docs/ObjectWithDeprecatedFields.md +++ b/samples/openapi3/client/petstore/python/docs/ObjectWithDeprecatedFields.md @@ -25,7 +25,7 @@ print(ObjectWithDeprecatedFields.to_json()) # convert the object into a dict object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict() # create an instance of ObjectWithDeprecatedFields from a dict -object_with_deprecated_fields_form_dict = object_with_deprecated_fields.from_dict(object_with_deprecated_fields_dict) +object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python/docs/OneOfEnumString.md index 25fc402280f..1d385c09293 100644 --- a/samples/openapi3/client/petstore/python/docs/OneOfEnumString.md +++ b/samples/openapi3/client/petstore/python/docs/OneOfEnumString.md @@ -22,7 +22,7 @@ print(OneOfEnumString.to_json()) # convert the object into a dict one_of_enum_string_dict = one_of_enum_string_instance.to_dict() # create an instance of OneOfEnumString from a dict -one_of_enum_string_form_dict = one_of_enum_string.from_dict(one_of_enum_string_dict) +one_of_enum_string_from_dict = OneOfEnumString.from_dict(one_of_enum_string_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Order.md b/samples/openapi3/client/petstore/python/docs/Order.md index 08b602f1669..00526b8d04b 100644 --- a/samples/openapi3/client/petstore/python/docs/Order.md +++ b/samples/openapi3/client/petstore/python/docs/Order.md @@ -27,7 +27,7 @@ print(Order.to_json()) # convert the object into a dict order_dict = order_instance.to_dict() # create an instance of Order from a dict -order_form_dict = order.from_dict(order_dict) +order_from_dict = Order.from_dict(order_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/OuterComposite.md b/samples/openapi3/client/petstore/python/docs/OuterComposite.md index 9d4401d659b..c8242c2d265 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/python/docs/OuterComposite.md @@ -24,7 +24,7 @@ print(OuterComposite.to_json()) # convert the object into a dict outer_composite_dict = outer_composite_instance.to_dict() # create an instance of OuterComposite from a dict -outer_composite_form_dict = outer_composite.from_dict(outer_composite_dict) +outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python/docs/OuterObjectWithEnumProperty.md index beffcbe2545..6137dbd98da 100644 --- a/samples/openapi3/client/petstore/python/docs/OuterObjectWithEnumProperty.md +++ b/samples/openapi3/client/petstore/python/docs/OuterObjectWithEnumProperty.md @@ -23,7 +23,7 @@ print(OuterObjectWithEnumProperty.to_json()) # convert the object into a dict outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict() # create an instance of OuterObjectWithEnumProperty from a dict -outer_object_with_enum_property_form_dict = outer_object_with_enum_property.from_dict(outer_object_with_enum_property_dict) +outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Parent.md b/samples/openapi3/client/petstore/python/docs/Parent.md index 3b71011330d..7387f9250aa 100644 --- a/samples/openapi3/client/petstore/python/docs/Parent.md +++ b/samples/openapi3/client/petstore/python/docs/Parent.md @@ -22,7 +22,7 @@ print(Parent.to_json()) # convert the object into a dict parent_dict = parent_instance.to_dict() # create an instance of Parent from a dict -parent_form_dict = parent.from_dict(parent_dict) +parent_from_dict = Parent.from_dict(parent_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python/docs/ParentWithOptionalDict.md index 23e11a6dd66..bfc8688ea26 100644 --- a/samples/openapi3/client/petstore/python/docs/ParentWithOptionalDict.md +++ b/samples/openapi3/client/petstore/python/docs/ParentWithOptionalDict.md @@ -22,7 +22,7 @@ print(ParentWithOptionalDict.to_json()) # convert the object into a dict parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict() # create an instance of ParentWithOptionalDict from a dict -parent_with_optional_dict_form_dict = parent_with_optional_dict.from_dict(parent_with_optional_dict_dict) +parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Pet.md b/samples/openapi3/client/petstore/python/docs/Pet.md index fa9dc7bf308..5329cf2fb92 100644 --- a/samples/openapi3/client/petstore/python/docs/Pet.md +++ b/samples/openapi3/client/petstore/python/docs/Pet.md @@ -27,7 +27,7 @@ print(Pet.to_json()) # convert the object into a dict pet_dict = pet_instance.to_dict() # create an instance of Pet from a dict -pet_form_dict = pet.from_dict(pet_dict) +pet_from_dict = Pet.from_dict(pet_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Pig.md b/samples/openapi3/client/petstore/python/docs/Pig.md index 9ad7b790494..62593067608 100644 --- a/samples/openapi3/client/petstore/python/docs/Pig.md +++ b/samples/openapi3/client/petstore/python/docs/Pig.md @@ -24,7 +24,7 @@ print(Pig.to_json()) # convert the object into a dict pig_dict = pig_instance.to_dict() # create an instance of Pig from a dict -pig_form_dict = pig.from_dict(pig_dict) +pig_from_dict = Pig.from_dict(pig_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python/docs/PoopCleaning.md index d96a5db0d4c..8f9c25e0831 100644 --- a/samples/openapi3/client/petstore/python/docs/PoopCleaning.md +++ b/samples/openapi3/client/petstore/python/docs/PoopCleaning.md @@ -24,7 +24,7 @@ print(PoopCleaning.to_json()) # convert the object into a dict poop_cleaning_dict = poop_cleaning_instance.to_dict() # create an instance of PoopCleaning from a dict -poop_cleaning_form_dict = poop_cleaning.from_dict(poop_cleaning_dict) +poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python/docs/PrimitiveString.md new file mode 100644 index 00000000000..85ceb632e16 --- /dev/null +++ b/samples/openapi3/client/petstore/python/docs/PrimitiveString.md @@ -0,0 +1,29 @@ +# PrimitiveString + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | [optional] + +## Example + +```python +from petstore_api.models.primitive_string import PrimitiveString + +# TODO update the JSON string below +json = "{}" +# create an instance of PrimitiveString from a JSON string +primitive_string_instance = PrimitiveString.from_json(json) +# print the JSON string representation of the object +print(PrimitiveString.to_json()) + +# convert the object into a dict +primitive_string_dict = primitive_string_instance.to_dict() +# create an instance of PrimitiveString from a dict +primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python/docs/PropertyMap.md b/samples/openapi3/client/petstore/python/docs/PropertyMap.md index 3b4c0a8cc03..a55a0e5c6f0 100644 --- a/samples/openapi3/client/petstore/python/docs/PropertyMap.md +++ b/samples/openapi3/client/petstore/python/docs/PropertyMap.md @@ -22,7 +22,7 @@ print(PropertyMap.to_json()) # convert the object into a dict property_map_dict = property_map_instance.to_dict() # create an instance of PropertyMap from a dict -property_map_form_dict = property_map.from_dict(property_map_dict) +property_map_from_dict = PropertyMap.from_dict(property_map_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python/docs/PropertyNameCollision.md index 1bd7ce5ee2b..40c233670dd 100644 --- a/samples/openapi3/client/petstore/python/docs/PropertyNameCollision.md +++ b/samples/openapi3/client/petstore/python/docs/PropertyNameCollision.md @@ -24,7 +24,7 @@ print(PropertyNameCollision.to_json()) # convert the object into a dict property_name_collision_dict = property_name_collision_instance.to_dict() # create an instance of PropertyNameCollision from a dict -property_name_collision_form_dict = property_name_collision.from_dict(property_name_collision_dict) +property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md index 4644f28f56a..686ec5da41c 100644 --- a/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python/docs/ReadOnlyFirst.md @@ -23,7 +23,7 @@ print(ReadOnlyFirst.to_json()) # convert the object into a dict read_only_first_dict = read_only_first_instance.to_dict() # create an instance of ReadOnlyFirst from a dict -read_only_first_form_dict = read_only_first.from_dict(read_only_first_dict) +read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python/docs/SecondCircularAllOfRef.md index eae28911ed2..65ebdd4c7e1 100644 --- a/samples/openapi3/client/petstore/python/docs/SecondCircularAllOfRef.md +++ b/samples/openapi3/client/petstore/python/docs/SecondCircularAllOfRef.md @@ -23,7 +23,7 @@ print(SecondCircularAllOfRef.to_json()) # convert the object into a dict second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict() # create an instance of SecondCircularAllOfRef from a dict -second_circular_all_of_ref_form_dict = second_circular_all_of_ref.from_dict(second_circular_all_of_ref_dict) +second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SecondRef.md b/samples/openapi3/client/petstore/python/docs/SecondRef.md index 97c65b8ef79..dfb1a0ac6db 100644 --- a/samples/openapi3/client/petstore/python/docs/SecondRef.md +++ b/samples/openapi3/client/petstore/python/docs/SecondRef.md @@ -23,7 +23,7 @@ print(SecondRef.to_json()) # convert the object into a dict second_ref_dict = second_ref_instance.to_dict() # create an instance of SecondRef from a dict -second_ref_form_dict = second_ref.from_dict(second_ref_dict) +second_ref_from_dict = SecondRef.from_dict(second_ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python/docs/SelfReferenceModel.md index 2ca21efd50c..208cdac04b6 100644 --- a/samples/openapi3/client/petstore/python/docs/SelfReferenceModel.md +++ b/samples/openapi3/client/petstore/python/docs/SelfReferenceModel.md @@ -23,7 +23,7 @@ print(SelfReferenceModel.to_json()) # convert the object into a dict self_reference_model_dict = self_reference_model_instance.to_dict() # create an instance of SelfReferenceModel from a dict -self_reference_model_form_dict = self_reference_model.from_dict(self_reference_model_dict) +self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python/docs/SpecialModelName.md index ea1ef0008c8..35303f34efd 100644 --- a/samples/openapi3/client/petstore/python/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python/docs/SpecialModelName.md @@ -22,7 +22,7 @@ print(SpecialModelName.to_json()) # convert the object into a dict special_model_name_dict = special_model_name_instance.to_dict() # create an instance of SpecialModelName from a dict -special_model_name_form_dict = special_model_name.from_dict(special_model_name_dict) +special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/SpecialName.md b/samples/openapi3/client/petstore/python/docs/SpecialName.md index c541b0b3d4b..ccc550b16e3 100644 --- a/samples/openapi3/client/petstore/python/docs/SpecialName.md +++ b/samples/openapi3/client/petstore/python/docs/SpecialName.md @@ -24,7 +24,7 @@ print(SpecialName.to_json()) # convert the object into a dict special_name_dict = special_name_instance.to_dict() # create an instance of SpecialName from a dict -special_name_form_dict = special_name.from_dict(special_name_dict) +special_name_from_dict = SpecialName.from_dict(special_name_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Tag.md b/samples/openapi3/client/petstore/python/docs/Tag.md index a8d1885a938..4106d9cfe5d 100644 --- a/samples/openapi3/client/petstore/python/docs/Tag.md +++ b/samples/openapi3/client/petstore/python/docs/Tag.md @@ -23,7 +23,7 @@ print(Tag.to_json()) # convert the object into a dict tag_dict = tag_instance.to_dict() # create an instance of Tag from a dict -tag_form_dict = tag.from_dict(tag_dict) +tag_from_dict = Tag.from_dict(tag_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Task.md b/samples/openapi3/client/petstore/python/docs/Task.md index 905cc03b65d..211ce76cdfe 100644 --- a/samples/openapi3/client/petstore/python/docs/Task.md +++ b/samples/openapi3/client/petstore/python/docs/Task.md @@ -24,7 +24,7 @@ print(Task.to_json()) # convert the object into a dict task_dict = task_instance.to_dict() # create an instance of Task from a dict -task_form_dict = task.from_dict(task_dict) +task_from_dict = Task.from_dict(task_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TaskActivity.md b/samples/openapi3/client/petstore/python/docs/TaskActivity.md index 36159e069b5..e905a477292 100644 --- a/samples/openapi3/client/petstore/python/docs/TaskActivity.md +++ b/samples/openapi3/client/petstore/python/docs/TaskActivity.md @@ -24,7 +24,7 @@ print(TaskActivity.to_json()) # convert the object into a dict task_activity_dict = task_activity_instance.to_dict() # create an instance of TaskActivity from a dict -task_activity_form_dict = task_activity.from_dict(task_activity_dict) +task_activity_from_dict = TaskActivity.from_dict(task_activity_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel400Response.md index 1ff12d238e0..be416bbad0f 100644 --- a/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel400Response.md +++ b/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel400Response.md @@ -22,7 +22,7 @@ print(TestErrorResponsesWithModel400Response.to_json()) # convert the object into a dict test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel400Response from a dict -test_error_responses_with_model400_response_form_dict = test_error_responses_with_model400_response.from_dict(test_error_responses_with_model400_response_dict) +test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel404Response.md index a62725a99bb..1c984f847bf 100644 --- a/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel404Response.md +++ b/samples/openapi3/client/petstore/python/docs/TestErrorResponsesWithModel404Response.md @@ -22,7 +22,7 @@ print(TestErrorResponsesWithModel404Response.to_json()) # convert the object into a dict test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict() # create an instance of TestErrorResponsesWithModel404Response from a dict -test_error_responses_with_model404_response_form_dict = test_error_responses_with_model404_response.from_dict(test_error_responses_with_model404_response_dict) +test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md index d678aa823e1..511132d689b 100644 --- a/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md +++ b/samples/openapi3/client/petstore/python/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -22,7 +22,7 @@ print(TestInlineFreeformAdditionalPropertiesRequest.to_json()) # convert the object into a dict test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict() # create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict -test_inline_freeform_additional_properties_request_form_dict = test_inline_freeform_additional_properties_request.from_dict(test_inline_freeform_additional_properties_request_dict) +test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python/docs/TestObjectForMultipartRequestsRequestMarker.md index 75cd561ffae..ff0ca9ee00a 100644 --- a/samples/openapi3/client/petstore/python/docs/TestObjectForMultipartRequestsRequestMarker.md +++ b/samples/openapi3/client/petstore/python/docs/TestObjectForMultipartRequestsRequestMarker.md @@ -22,7 +22,7 @@ print(TestObjectForMultipartRequestsRequestMarker.to_json()) # convert the object into a dict test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict() # create an instance of TestObjectForMultipartRequestsRequestMarker from a dict -test_object_for_multipart_requests_request_marker_form_dict = test_object_for_multipart_requests_request_marker.from_dict(test_object_for_multipart_requests_request_marker_dict) +test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Tiger.md b/samples/openapi3/client/petstore/python/docs/Tiger.md index f03552af073..f1cf2133f0f 100644 --- a/samples/openapi3/client/petstore/python/docs/Tiger.md +++ b/samples/openapi3/client/petstore/python/docs/Tiger.md @@ -22,7 +22,7 @@ print(Tiger.to_json()) # convert the object into a dict tiger_dict = tiger_instance.to_dict() # create an instance of Tiger from a dict -tiger_form_dict = tiger.from_dict(tiger_dict) +tiger_from_dict = Tiger.from_dict(tiger_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalModelListProperties.md index 201a2d8d3e8..68cd00ab0a7 100644 --- a/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalModelListProperties.md +++ b/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalModelListProperties.md @@ -22,7 +22,7 @@ print(UnnamedDictWithAdditionalModelListProperties.to_json()) # convert the object into a dict unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalModelListProperties from a dict -unnamed_dict_with_additional_model_list_properties_form_dict = unnamed_dict_with_additional_model_list_properties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) +unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalStringListProperties.md index 534b6bec797..045b0e22ad0 100644 --- a/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalStringListProperties.md +++ b/samples/openapi3/client/petstore/python/docs/UnnamedDictWithAdditionalStringListProperties.md @@ -22,7 +22,7 @@ print(UnnamedDictWithAdditionalStringListProperties.to_json()) # convert the object into a dict unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict() # create an instance of UnnamedDictWithAdditionalStringListProperties from a dict -unnamed_dict_with_additional_string_list_properties_form_dict = unnamed_dict_with_additional_string_list_properties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) +unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/User.md b/samples/openapi3/client/petstore/python/docs/User.md index e9d5051b646..c45d26d2704 100644 --- a/samples/openapi3/client/petstore/python/docs/User.md +++ b/samples/openapi3/client/petstore/python/docs/User.md @@ -29,7 +29,7 @@ print(User.to_json()) # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python/docs/WithNestedOneOf.md index 7fdc6cb3d21..e7bbbc28fc2 100644 --- a/samples/openapi3/client/petstore/python/docs/WithNestedOneOf.md +++ b/samples/openapi3/client/petstore/python/docs/WithNestedOneOf.md @@ -24,7 +24,7 @@ print(WithNestedOneOf.to_json()) # convert the object into a dict with_nested_one_of_dict = with_nested_one_of_instance.to_dict() # create an instance of WithNestedOneOf from a dict -with_nested_one_of_form_dict = with_nested_one_of.from_dict(with_nested_one_of_dict) +with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py index 1d2a609f13b..3f6c3aabf13 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py @@ -52,6 +52,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -84,6 +85,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -114,6 +116,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py index efd9c939d21..30718c766d7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py @@ -27,6 +27,7 @@ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.base_discriminator import BaseDiscriminator from petstore_api.models.basque_pig import BasquePig from petstore_api.models.bathing import Bathing from petstore_api.models.capitalization import Capitalization @@ -59,6 +60,7 @@ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.info import Info from petstore_api.models.inner_dict_with_property import InnerDictWithProperty from petstore_api.models.input_all_of import InputAllOf from petstore_api.models.int_or_string import IntOrString @@ -89,6 +91,7 @@ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict from petstore_api.models.pet import Pet from petstore_api.models.pig import Pig from petstore_api.models.poop_cleaning import PoopCleaning +from petstore_api.models.primitive_string import PrimitiveString from petstore_api.models.property_map import PropertyMap from petstore_api.models.property_name_collision import PropertyNameCollision from petstore_api.models.read_only_first import ReadOnlyFirst diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py new file mode 100644 index 00000000000..40b49a2fca7 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/base_discriminator.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from petstore_api.models.primitive_string import PrimitiveString + from petstore_api.models.info import Info + +class BaseDiscriminator(BaseModel): + """ + BaseDiscriminator + """ # noqa: E501 + type_name: Optional[StrictStr] = Field(default=None, alias="_typeName") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["_typeName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '_typeName' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'string': 'PrimitiveString','Info': 'Info' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[PrimitiveString, Info]]: + """Create an instance of BaseDiscriminator from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'PrimitiveString': + return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj) + if object_type == 'Info': + return import_module("petstore_api.models.info").Info.from_dict(obj) + + raise ValueError("BaseDiscriminator failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py index 0472b7b2981..bd4e7746134 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py @@ -35,12 +35,14 @@ class EnumTest(BaseModel): enum_integer_default: Optional[StrictInt] = 5 enum_integer: Optional[StrictInt] = None enum_number: Optional[StrictFloat] = None + enum_number_vendor_ext: Optional[StrictInt] = None + enum_string_vendor_ext: Optional[StrictStr] = None outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum") outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger") outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=None, alias="outerEnumDefaultValue") outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=None, alias="outerEnumIntegerDefaultValue") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] + __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_number_vendor_ext", "enum_string_vendor_ext", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue"] @field_validator('enum_string') def enum_string_validate_enum(cls, value): @@ -89,6 +91,26 @@ class EnumTest(BaseModel): raise ValueError("must be one of enum values (1.1, -1.2)") return value + @field_validator('enum_number_vendor_ext') + def enum_number_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([42, 18, 56]): + raise ValueError("must be one of enum values (42, 18, 56)") + return value + + @field_validator('enum_string_vendor_ext') + def enum_string_vendor_ext_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FOO', 'Bar', 'baz']): + raise ValueError("must be one of enum values ('FOO', 'Bar', 'baz')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -157,6 +179,8 @@ class EnumTest(BaseModel): "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5, "enum_integer": obj.get("enum_integer"), "enum_number": obj.get("enum_number"), + "enum_number_vendor_ext": obj.get("enum_number_vendor_ext"), + "enum_string_vendor_ext": obj.get("enum_string_vendor_ext"), "outerEnum": obj.get("outerEnum"), "outerEnumInteger": obj.get("outerEnumInteger"), "outerEnumDefaultValue": obj.get("outerEnumDefaultValue"), diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/info.py b/samples/openapi3/client/petstore/python/petstore_api/models/info.py new file mode 100644 index 00000000000..94e663b3aaa --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/info.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class Info(BaseDiscriminator): + """ + Info + """ # noqa: E501 + val: Optional[BaseDiscriminator] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["_typeName", "val"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Info from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of val + if self.val: + _dict['val'] = self.val.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Info from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "val": BaseDiscriminator.from_dict(obj["val"]) if obj.get("val") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py new file mode 100644 index 00000000000..f7a971519f2 --- /dev/null +++ b/samples/openapi3/client/petstore/python/petstore_api/models/primitive_string.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from petstore_api.models.base_discriminator import BaseDiscriminator +from typing import Optional, Set +from typing_extensions import Self + +class PrimitiveString(BaseDiscriminator): + """ + PrimitiveString + """ # noqa: E501 + value: Optional[StrictStr] = Field(default=None, alias="_value") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["_typeName", "_value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrimitiveString from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrimitiveString from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_typeName": obj.get("_typeName"), + "_value": obj.get("_value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/samples/openapi3/client/petstore/python/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python/test/test_base_discriminator.py new file mode 100644 index 00000000000..61c40f7f680 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_base_discriminator.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.base_discriminator import BaseDiscriminator + +class TestBaseDiscriminator(unittest.TestCase): + """BaseDiscriminator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseDiscriminator: + """Test BaseDiscriminator + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BaseDiscriminator` + """ + model = BaseDiscriminator() + if include_optional: + return BaseDiscriminator( + type_name = '' + ) + else: + return BaseDiscriminator( + ) + """ + + def testBaseDiscriminator(self): + """Test BaseDiscriminator""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_info.py b/samples/openapi3/client/petstore/python/test/test_info.py new file mode 100644 index 00000000000..e1fce9f9c1e --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_info.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.info import Info + +class TestInfo(unittest.TestCase): + """Info unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Info: + """Test Info + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Info` + """ + model = Info() + if include_optional: + return Info( + val = petstore_api.models.base_discriminator.BaseDiscriminator() + ) + else: + return Info( + ) + """ + + def testInfo(self): + """Test Info""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/test/test_primitive_string.py b/samples/openapi3/client/petstore/python/test/test_primitive_string.py new file mode 100644 index 00000000000..8b9ccf59893 --- /dev/null +++ b/samples/openapi3/client/petstore/python/test/test_primitive_string.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from petstore_api.models.primitive_string import PrimitiveString + +class TestPrimitiveString(unittest.TestCase): + """PrimitiveString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PrimitiveString: + """Test PrimitiveString + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PrimitiveString` + """ + model = PrimitiveString() + if include_optional: + return PrimitiveString( + value = '' + ) + else: + return PrimitiveString( + ) + """ + + def testPrimitiveString(self): + """Test PrimitiveString""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index f65d6274508..3a0502e4ed8 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -629,6 +629,13 @@ class ModelTests(unittest.TestCase): self.assertEqual(model_a.to_json(), '{"_name": "nameA", "second_circular_all_of_ref": {"name": "nameB"}}') self.assertEqual(model_b.to_json(), '{"_name": "nameB", "circular_all_of_ref": {"name": "nameA"}}') + def test_allof_discriminator_mapping(self): + # for issue 18498 + user_info_json = '{"_typeName": "Info", "val": {"_typeName": "string", "_value": "some string"}}' + user_info = petstore_api.models.Info.from_json(user_info_json) + # shouldn't throw ValueError("BaseDiscriminator failed to lookup discriminator value...") + assert user_info is not None + self.assertEqual(user_info.to_json(), user_info_json) class TestdditionalPropertiesAnyType(unittest.TestCase): def test_additional_properties(self): diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java index 7283e7f9557..ec607e8f31d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java @@ -39,6 +39,10 @@ public class Animal { private String color = "red"; + public Animal() { + super(); + } + public Animal className(String className) { this.className = className; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java index b56ecd08274..a5a5dd1454d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java @@ -68,6 +68,10 @@ public class BigCat extends Cat { private KindEnum kind; + public BigCat() { + super(); + } + public BigCat kind(KindEnum kind) { this.kind = kind; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java index 85641e8b8ad..df238580f57 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java @@ -36,6 +36,10 @@ public class Cat extends Animal { private Boolean declawed; + public Cat() { + super(); + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java index 3b36cb27c60..4459b47ce91 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java @@ -25,6 +25,10 @@ public class Category { private String name = "default-name"; + public Category() { + super(); + } + public Category id(Long id) { this.id = id; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java index e12bf2b0251..7f4b7483bef 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -38,6 +38,10 @@ public class ContainerDefaultValue { @Valid private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined(); + public ContainerDefaultValue() { + super(); + } + public ContainerDefaultValue nullableArray(List nullableArray) { this.nullableArray = JsonNullable.of(nullableArray); return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java index 3f2448102b7..1b342995091 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java @@ -28,6 +28,10 @@ public class Dog extends Animal { private String breed; + public Dog() { + super(); + } + public Dog breed(String breed) { this.breed = breed; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java index 1532eacd202..45eaff540b3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java @@ -179,6 +179,10 @@ public class EnumTest { private OuterEnum outerEnum; + public EnumTest() { + super(); + } + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java index 83c1f359247..72c6e759c97 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java @@ -59,6 +59,10 @@ public class FormatTest { private BigDecimal bigDecimal; + public FormatTest() { + super(); + } + public FormatTest integer(Integer integer) { this.integer = integer; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java index fc7a7fb468d..0d75ad23ed1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java @@ -30,6 +30,10 @@ public class Name { private Integer _123number; + public Name() { + super(); + } + public Name name(Integer name) { this.name = name; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java index 9a053f2851a..bdcca7675d1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -41,7 +41,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index 9899a26a2c4..609a27e0260 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -82,6 +82,10 @@ public class Pet { @Deprecated private StatusEnum status; + public Pet() { + super(); + } + public Pet id(Long id) { this.id = id; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index 9d6b53a098c..af28fdde994 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -36,6 +36,10 @@ public class TypeHolderDefault { @Valid private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + public TypeHolderDefault() { + super(); + } + public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index 85d64ab035d..003970b51c1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -38,6 +38,10 @@ public class TypeHolderExample { @Valid private List arrayItem = new ArrayList<>(); + public TypeHolderExample() { + super(); + } + public TypeHolderExample stringItem(String stringItem) { this.stringItem = stringItem; return this; diff --git a/samples/openapi3/client/petstore/typescript/tests/default/package.json b/samples/openapi3/client/petstore/typescript/tests/default/package.json index 9db286f9532..1f0c9d646bd 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/package.json +++ b/samples/openapi3/client/petstore/typescript/tests/default/package.json @@ -12,10 +12,10 @@ "build": "tsc" }, "devDependencies": { - "@types/chai": "^4.0.1", + "@types/chai": "4.0.1 - 4.1.x", "@types/isomorphic-fetch": "0.0.34", "@types/mocha": "^2.2.41", - "@types/node": "^8.10.38", + "@types/node": "8.10.38 - 8.10.62", "chai": "^4.1.0", "mocha": "^5.2.0", "ts-loader": "^2.3.0", diff --git a/samples/openapi3/client/petstore/typescript/tests/object_params/package.json b/samples/openapi3/client/petstore/typescript/tests/object_params/package.json index c9f65b041ef..4ea28e1074e 100644 --- a/samples/openapi3/client/petstore/typescript/tests/object_params/package.json +++ b/samples/openapi3/client/petstore/typescript/tests/object_params/package.json @@ -12,10 +12,10 @@ "build": "tsc" }, "devDependencies": { - "@types/chai": "^4.0.1", + "@types/chai": "4.0.1 - 4.1.x", "@types/isomorphic-fetch": "0.0.34", "@types/mocha": "^2.2.41", - "@types/node": "^8.10.38", + "@types/node": "8.10.38 - 8.10.62", "chai": "^4.1.0", "mocha": "^5.2.0", "ts-loader": "^2.3.0", diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_pet.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_pet.go index c99a57dfde0..5b043ad51bc 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_pet.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_pet.go @@ -36,7 +36,7 @@ func WithPetAPIErrorHandler(h ErrorHandler) PetAPIOption { } // NewPetAPIController creates a default api controller -func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) Router { +func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) *PetAPIController { controller := &PetAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -119,7 +119,7 @@ func (c *PetAPIController) AddPet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeletePet - Deletes a pet @@ -129,7 +129,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } apiKeyParam := r.Header.Get("api_key") @@ -140,7 +140,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByStatus - Finds Pets by status @@ -161,7 +161,7 @@ func (c *PetAPIController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByTags - Finds Pets by tags @@ -183,7 +183,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetById - Find pet by ID @@ -193,7 +193,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } result, err := c.service.GetPetById(r.Context(), petIdParam) @@ -203,7 +203,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePet - Update an existing pet @@ -230,7 +230,7 @@ func (c *PetAPIController) UpdatePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePetWithForm - Updates a pet in the store with form data @@ -244,7 +244,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -260,7 +260,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UploadFile - uploads an image @@ -274,7 +274,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -284,7 +284,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { { param, err := ReadFormFileToTempFile(r, "file") if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "file", Err: err}, nil) return } @@ -299,5 +299,5 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_pet_service.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_pet_service.go index d1779d11746..cea78ae519a 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_pet_service.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_pet_service.go @@ -24,7 +24,7 @@ type PetAPIService struct { } // NewPetAPIService creates a default api service -func NewPetAPIService() PetAPIServicer { +func NewPetAPIService() *PetAPIService { return &PetAPIService{} } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_store.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_store.go index 51b0c7fbb7c..e364efe3988 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_store.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_store.go @@ -35,7 +35,7 @@ func WithStoreAPIErrorHandler(h ErrorHandler) StoreAPIOption { } // NewStoreAPIController creates a default api controller -func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) Router { +func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) *StoreAPIController { controller := &StoreAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -88,7 +88,7 @@ func (c *StoreAPIController) DeleteOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetInventory - Returns pet inventories by status @@ -100,7 +100,7 @@ func (c *StoreAPIController) GetInventory(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetOrderById - Find purchase order by ID @@ -112,7 +112,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request WithMaximum[int64](5), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "orderId", Err: err}, nil) return } result, err := c.service.GetOrderById(r.Context(), orderIdParam) @@ -122,7 +122,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // PlaceOrder - Place an order for a pet @@ -149,5 +149,5 @@ func (c *StoreAPIController) PlaceOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_store_service.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_store_service.go index ee41bf5fdd3..46671f7a9fd 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_store_service.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_store_service.go @@ -23,7 +23,7 @@ type StoreAPIService struct { } // NewStoreAPIService creates a default api service -func NewStoreAPIService() StoreAPIServicer { +func NewStoreAPIService() *StoreAPIService { return &StoreAPIService{} } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_user.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_user.go index 75cae8959c4..1d28ab73b75 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_user.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_user.go @@ -35,7 +35,7 @@ func WithUserAPIErrorHandler(h ErrorHandler) UserAPIOption { } // NewUserAPIController creates a default api controller -func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) Router { +func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) *UserAPIController { controller := &UserAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -118,7 +118,7 @@ func (c *UserAPIController) CreateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithArrayInput - Creates list of users with given input array @@ -143,7 +143,7 @@ func (c *UserAPIController) CreateUsersWithArrayInput(w http.ResponseWriter, r * return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithListInput - Creates list of users with given input array @@ -168,7 +168,7 @@ func (c *UserAPIController) CreateUsersWithListInput(w http.ResponseWriter, r *h return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeleteUser - Delete user @@ -190,7 +190,7 @@ func (c *UserAPIController) DeleteUser(w http.ResponseWriter, r *http.Request) { WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "boolean_test", Err: err}, nil) return } @@ -204,7 +204,7 @@ func (c *UserAPIController) DeleteUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetUserByName - Get user by user name @@ -221,7 +221,7 @@ func (c *UserAPIController) GetUserByName(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LoginUser - Logs user into the system @@ -256,7 +256,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { WithParse[int32](parseInt32), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "int32_test", Err: err}, nil) return } @@ -270,7 +270,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { WithParse[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "int64_test", Err: err}, nil) return } @@ -284,7 +284,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { WithParse[float32](parseFloat32), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "float32_test", Err: err}, nil) return } @@ -298,7 +298,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { WithParse[float64](parseFloat64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "float64_test", Err: err}, nil) return } @@ -312,7 +312,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "boolean_test", Err: err}, nil) return } @@ -326,7 +326,7 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LogoutUser - Logs out current logged in user session @@ -338,7 +338,7 @@ func (c *UserAPIController) LogoutUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdateUser - Updated user @@ -370,5 +370,5 @@ func (c *UserAPIController) UpdateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/api_user_service.go b/samples/openapi3/server/petstore/go/go-petstore/go/api_user_service.go index 35abd4478ed..4be92131dc0 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/api_user_service.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/api_user_service.go @@ -23,7 +23,7 @@ type UserAPIService struct { } // NewUserAPIService creates a default api service -func NewUserAPIService() UserAPIServicer { +func NewUserAPIService() *UserAPIService { return &UserAPIService{} } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/error.go b/samples/openapi3/server/petstore/go/go-petstore/go/error.go index ee1d5f1f33f..ba23f89b838 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/error.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/error.go @@ -23,7 +23,8 @@ var ( // ParsingError indicates that an error has occurred when parsing request parameters type ParsingError struct { - Err error + Param string + Err error } func (e *ParsingError) Unwrap() error { @@ -31,7 +32,11 @@ func (e *ParsingError) Unwrap() error { } func (e *ParsingError) Error() string { - return e.Err.Error() + if e.Param == "" { + return e.Err.Error() + } + + return e.Param + ": " + e.Err.Error() } // RequiredError indicates that an error has occurred when parsing request parameters @@ -49,15 +54,21 @@ type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result // DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing // request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. -func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) { - if _, ok := err.(*ParsingError); ok { +func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *ImplResponse) { + var parsingErr *ParsingError + if ok := errors.As(err, &parsingErr); ok { // Handle parsing errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) - } else if _, ok := err.(*RequiredError); ok { - // Handle missing required errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) - } else { - // Handle all other errors - EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) + return } + + var requiredErr *RequiredError + if ok := errors.As(err, &requiredErr); ok { + // Handle missing required errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) + return + } + + // Handle all other errors + _ = EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/helpers.go b/samples/openapi3/server/petstore/go/go-petstore/go/helpers.go index 886c0c9a17d..027954b0c9b 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/helpers.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/helpers.go @@ -61,7 +61,7 @@ func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) err // If it is a slice we continue recursion case reflect.Slice: - for i := 0; i < value.Len(); i += 1 { + for i := 0; i < value.Len(); i++ { if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { return err } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/model_an_object.go b/samples/openapi3/server/petstore/go/go-petstore/go/model_an_object.go index e5bdcff2495..b5b8e6c5276 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/model_an_object.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/model_an_object.go @@ -37,5 +37,13 @@ func AssertAnObjectRequired(obj AnObject) error { // AssertAnObjectConstraints checks if the values respects the defined constraints func AssertAnObjectConstraints(obj AnObject) error { + if err := AssertTagConstraints(obj.Tag); err != nil { + return err + } + for _, el := range obj.Pet { + if err := AssertPetConstraints(el); err != nil { + return err + } + } return nil } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/model_pet.go b/samples/openapi3/server/petstore/go/go-petstore/go/model_pet.go index 48537769fb0..38a5af1d393 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/model_pet.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/model_pet.go @@ -60,5 +60,17 @@ func AssertPetRequired(obj Pet) error { // AssertPetConstraints checks if the values respects the defined constraints func AssertPetConstraints(obj Pet) error { + if obj.Category != nil { + if err := AssertCategoryConstraints(*obj.Category); err != nil { + return err + } + } + if obj.Tags != nil { + for _, el := range *obj.Tags { + if err := AssertTagConstraints(el); err != nil { + return err + } + } + } return nil } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/model_user.go b/samples/openapi3/server/petstore/go/go-petstore/go/model_user.go index 973b8986d38..29803083edb 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/model_user.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/model_user.go @@ -64,5 +64,13 @@ func AssertUserRequired(obj User) error { // AssertUserConstraints checks if the values respects the defined constraints func AssertUserConstraints(obj User) error { + if obj.DeepSliceModel != nil { + if err := AssertRecurseInterfaceRequired(*obj.DeepSliceModel, AssertTagConstraints); err != nil { + return err + } + } + if err := AssertRecurseInterfaceRequired(obj.DeepSliceMap, AssertAnObjectConstraints); err != nil { + return err + } return nil } diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/routers.go b/samples/openapi3/server/petstore/go/go-petstore/go/routers.go index ef9200e0a24..4d662e273c5 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/routers.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/routers.go @@ -50,8 +50,7 @@ func NewRouter(routers ...Router) chi.Router { router.Use(middleware.Logger) for _, api := range routers { for _, route := range api.Routes() { - var handler http.Handler - handler = route.HandlerFunc + var handler http.Handler = route.HandlerFunc router.Method(route.Method, route.Pattern, handler) } } @@ -341,7 +340,7 @@ func parseNumericArrayParameter[T Number](param, delim string, required bool, fn } -// parseQuery parses query paramaters and returns an error if any malformed value pairs are encountered. +// parseQuery parses query parameters and returns an error if any malformed value pairs are encountered. func parseQuery(rawQuery string) (url.Values, error) { return url.ParseQuery(rawQuery) } \ No newline at end of file diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java index bad1b28e3f5..005fb526e87 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java @@ -104,5 +104,69 @@ public class Addressable { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Addressable instance; + + public Builder() { + this(new Addressable()); + } + + protected Builder(Addressable instance) { + this.instance = instance; + } + + protected Builder copyOf(Addressable value) { + this.instance.setHref(value.href); + this.instance.setId(value.id); + return this; + } + + public Addressable.Builder href(String href) { + this.instance.href(href); + return this; + } + + public Addressable.Builder id(String id) { + this.instance.id(id); + return this; + } + + /** + * returns a built Addressable instance. + * + * The builder is not reusable (NullPointerException) + */ + public Addressable build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Addressable.Builder builder() { + return new Addressable.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Addressable.Builder toBuilder() { + Addressable.Builder builder = new Addressable.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java index 15b7b2a6215..65ee38b291c 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java @@ -119,5 +119,69 @@ public class Apple implements Fruit { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Apple instance; + + public Builder() { + this(new Apple()); + } + + protected Builder(Apple instance) { + this.instance = instance; + } + + protected Builder copyOf(Apple value) { + this.instance.setSeeds(value.seeds); + this.instance.setFruitType(value.fruitType); + return this; + } + + public Apple.Builder seeds(Integer seeds) { + this.instance.seeds(seeds); + return this; + } + + public Apple.Builder fruitType(FruitType fruitType) { + this.instance.fruitType(fruitType); + return this; + } + + /** + * returns a built Apple instance. + * + * The builder is not reusable (NullPointerException) + */ + public Apple build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Apple.Builder builder() { + return new Apple.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Apple.Builder toBuilder() { + Apple.Builder builder = new Apple.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java index a60afbaf47f..24f20957bf7 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java @@ -119,5 +119,69 @@ public class Banana implements Fruit { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Banana instance; + + public Builder() { + this(new Banana()); + } + + protected Builder(Banana instance) { + this.instance = instance; + } + + protected Builder copyOf(Banana value) { + this.instance.setLength(value.length); + this.instance.setFruitType(value.fruitType); + return this; + } + + public Banana.Builder length(Integer length) { + this.instance.length(length); + return this; + } + + public Banana.Builder fruitType(FruitType fruitType) { + this.instance.fruitType(fruitType); + return this; + } + + /** + * returns a built Banana instance. + * + * The builder is not reusable (NullPointerException) + */ + public Banana build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Banana.Builder builder() { + return new Banana.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Banana.Builder toBuilder() { + Banana.Builder builder = new Banana.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java index 1eaf9643c60..f1df942761c 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java @@ -191,5 +191,108 @@ public class Bar extends Entity implements BarRefOrValue { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Entity.Builder { + + private Bar instance; + + public Builder() { + this(new Bar()); + } + + protected Builder(Bar instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Bar value) { + super.copyOf(instance); + this.instance.setId(value.id); + this.instance.setBarPropA(value.barPropA); + this.instance.setFooPropB(value.fooPropB); + this.instance.setFoo(value.foo); + return this; + } + + public Bar.Builder id(String id) { + this.instance.id(id); + return this; + } + + public Bar.Builder barPropA(String barPropA) { + this.instance.barPropA(barPropA); + return this; + } + + public Bar.Builder fooPropB(String fooPropB) { + this.instance.fooPropB(fooPropB); + return this; + } + + public Bar.Builder foo(FooRefOrValue foo) { + this.instance.foo(foo); + return this; + } + + @Override + public Bar.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public Bar.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public Bar.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public Bar.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Bar instance. + * + * The builder is not reusable (NullPointerException) + */ + public Bar build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Bar.Builder builder() { + return new Bar.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Bar.Builder toBuilder() { + Bar.Builder builder = new Bar.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java index 297c41e5d06..58168243be4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java @@ -173,5 +173,108 @@ public class BarCreate extends Entity { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Entity.Builder { + + private BarCreate instance; + + public Builder() { + this(new BarCreate()); + } + + protected Builder(BarCreate instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(BarCreate value) { + super.copyOf(instance); + this.instance.setBarPropA(value.barPropA); + this.instance.setFooPropB(value.fooPropB); + this.instance.setFoo(value.foo); + return this; + } + + public BarCreate.Builder barPropA(String barPropA) { + this.instance.barPropA(barPropA); + return this; + } + + public BarCreate.Builder fooPropB(String fooPropB) { + this.instance.fooPropB(fooPropB); + return this; + } + + public BarCreate.Builder foo(FooRefOrValue foo) { + this.instance.foo(foo); + return this; + } + + @Override + public BarCreate.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public BarCreate.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public BarCreate.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public BarCreate.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public BarCreate.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built BarCreate instance. + * + * The builder is not reusable (NullPointerException) + */ + public BarCreate build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static BarCreate.Builder builder() { + return new BarCreate.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BarCreate.Builder toBuilder() { + BarCreate.Builder builder = new BarCreate.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java index a7133310e17..58024644a3c 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java @@ -107,5 +107,102 @@ public class BarRef extends EntityRef implements BarRefOrValue { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends EntityRef.Builder { + + private BarRef instance; + + public Builder() { + this(new BarRef()); + } + + protected Builder(BarRef instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(BarRef value) { + super.copyOf(instance); + return this; + } + + @Override + public BarRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + @Override + public BarRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + + @Override + public BarRef.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public BarRef.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public BarRef.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public BarRef.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public BarRef.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built BarRef instance. + * + * The builder is not reusable (NullPointerException) + */ + public BarRef build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static BarRef.Builder builder() { + return new BarRef.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BarRef.Builder toBuilder() { + BarRef.Builder builder = new BarRef.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java index bfc3f17630b..058c8b1796b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java @@ -203,5 +203,87 @@ public class Entity { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Entity instance; + + public Builder() { + this(new Entity()); + } + + protected Builder(Entity instance) { + this.instance = instance; + } + + protected Builder copyOf(Entity value) { + this.instance.setHref(value.href); + this.instance.setId(value.id); + this.instance.setAtSchemaLocation(value.atSchemaLocation); + this.instance.setAtBaseType(value.atBaseType); + this.instance.setAtType(value.atType); + return this; + } + + public Entity.Builder href(String href) { + this.instance.href(href); + return this; + } + + public Entity.Builder id(String id) { + this.instance.id(id); + return this; + } + + public Entity.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + public Entity.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + public Entity.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Entity instance. + * + * The builder is not reusable (NullPointerException) + */ + public Entity build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Entity.Builder builder() { + return new Entity.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Entity.Builder toBuilder() { + Entity.Builder builder = new Entity.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java index ca6471e983d..ab0d329bae2 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java @@ -248,5 +248,99 @@ public class EntityRef { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private EntityRef instance; + + public Builder() { + this(new EntityRef()); + } + + protected Builder(EntityRef instance) { + this.instance = instance; + } + + protected Builder copyOf(EntityRef value) { + this.instance.setName(value.name); + this.instance.setAtReferredType(value.atReferredType); + this.instance.setHref(value.href); + this.instance.setId(value.id); + this.instance.setAtSchemaLocation(value.atSchemaLocation); + this.instance.setAtBaseType(value.atBaseType); + this.instance.setAtType(value.atType); + return this; + } + + public EntityRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + public EntityRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + + public EntityRef.Builder href(String href) { + this.instance.href(href); + return this; + } + + public EntityRef.Builder id(String id) { + this.instance.id(id); + return this; + } + + public EntityRef.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + public EntityRef.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + public EntityRef.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built EntityRef instance. + * + * The builder is not reusable (NullPointerException) + */ + public EntityRef build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static EntityRef.Builder builder() { + return new EntityRef.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EntityRef.Builder toBuilder() { + EntityRef.Builder builder = new EntityRef.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java index 48ac52db9c0..2457d754d8a 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java @@ -138,5 +138,75 @@ public class Extensible { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Extensible instance; + + public Builder() { + this(new Extensible()); + } + + protected Builder(Extensible instance) { + this.instance = instance; + } + + protected Builder copyOf(Extensible value) { + this.instance.setAtSchemaLocation(value.atSchemaLocation); + this.instance.setAtBaseType(value.atBaseType); + this.instance.setAtType(value.atType); + return this; + } + + public Extensible.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + public Extensible.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + public Extensible.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Extensible instance. + * + * The builder is not reusable (NullPointerException) + */ + public Extensible build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Extensible.Builder builder() { + return new Extensible.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Extensible.Builder toBuilder() { + Extensible.Builder builder = new Extensible.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java index 07dc58ff254..7ce6905492c 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java @@ -146,5 +146,102 @@ public class Foo extends Entity implements FooRefOrValue { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Entity.Builder { + + private Foo instance; + + public Builder() { + this(new Foo()); + } + + protected Builder(Foo instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Foo value) { + super.copyOf(instance); + this.instance.setFooPropA(value.fooPropA); + this.instance.setFooPropB(value.fooPropB); + return this; + } + + public Foo.Builder fooPropA(String fooPropA) { + this.instance.fooPropA(fooPropA); + return this; + } + + public Foo.Builder fooPropB(String fooPropB) { + this.instance.fooPropB(fooPropB); + return this; + } + + @Override + public Foo.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public Foo.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public Foo.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public Foo.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public Foo.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Foo instance. + * + * The builder is not reusable (NullPointerException) + */ + public Foo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Foo.Builder builder() { + return new Foo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Foo.Builder toBuilder() { + Foo.Builder builder = new Foo.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java index 44899aad84a..19d47b45135 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java @@ -132,5 +132,108 @@ public class FooRef extends EntityRef implements FooRefOrValue { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends EntityRef.Builder { + + private FooRef instance; + + public Builder() { + this(new FooRef()); + } + + protected Builder(FooRef instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(FooRef value) { + super.copyOf(instance); + this.instance.setFoorefPropA(value.foorefPropA); + return this; + } + + public FooRef.Builder foorefPropA(String foorefPropA) { + this.instance.foorefPropA(foorefPropA); + return this; + } + + @Override + public FooRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + @Override + public FooRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + + @Override + public FooRef.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public FooRef.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public FooRef.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public FooRef.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public FooRef.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built FooRef instance. + * + * The builder is not reusable (NullPointerException) + */ + public FooRef build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static FooRef.Builder builder() { + return new FooRef.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FooRef.Builder toBuilder() { + FooRef.Builder builder = new FooRef.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java index f00426ea06f..52d567d3fe9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java @@ -122,5 +122,96 @@ public class Pasta extends Entity { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Entity.Builder { + + private Pasta instance; + + public Builder() { + this(new Pasta()); + } + + protected Builder(Pasta instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Pasta value) { + super.copyOf(instance); + this.instance.setVendor(value.vendor); + return this; + } + + public Pasta.Builder vendor(String vendor) { + this.instance.vendor(vendor); + return this; + } + + @Override + public Pasta.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public Pasta.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public Pasta.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public Pasta.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public Pasta.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Pasta instance. + * + * The builder is not reusable (NullPointerException) + */ + public Pasta build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Pasta.Builder builder() { + return new Pasta.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pasta.Builder toBuilder() { + Pasta.Builder builder = new Pasta.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java index 9b191dce828..a92051434fe 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java @@ -131,5 +131,96 @@ public class Pizza extends Entity { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Entity.Builder { + + private Pizza instance; + + public Builder() { + this(new Pizza()); + } + + protected Builder(Pizza instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Pizza value) { + super.copyOf(instance); + this.instance.setPizzaSize(value.pizzaSize); + return this; + } + + public Pizza.Builder pizzaSize(BigDecimal pizzaSize) { + this.instance.pizzaSize(pizzaSize); + return this; + } + + @Override + public Pizza.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public Pizza.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public Pizza.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public Pizza.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public Pizza.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built Pizza instance. + * + * The builder is not reusable (NullPointerException) + */ + public Pizza build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Pizza.Builder builder() { + return new Pizza.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pizza.Builder toBuilder() { + Pizza.Builder builder = new Pizza.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java index cc3a49dbfad..2eb670f60e9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java @@ -128,5 +128,102 @@ public class PizzaSpeziale extends Pizza { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Pizza.Builder { + + private PizzaSpeziale instance; + + public Builder() { + this(new PizzaSpeziale()); + } + + protected Builder(PizzaSpeziale instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(PizzaSpeziale value) { + super.copyOf(instance); + this.instance.setToppings(value.toppings); + return this; + } + + public PizzaSpeziale.Builder toppings(String toppings) { + this.instance.toppings(toppings); + return this; + } + + @Override + public PizzaSpeziale.Builder pizzaSize(BigDecimal pizzaSize) { + this.instance.pizzaSize(pizzaSize); + return this; + } + + @Override + public PizzaSpeziale.Builder href(String href) { + this.instance.href(href); + return this; + } + + @Override + public PizzaSpeziale.Builder id(String id) { + this.instance.id(id); + return this; + } + + @Override + public PizzaSpeziale.Builder atSchemaLocation(String atSchemaLocation) { + this.instance.atSchemaLocation(atSchemaLocation); + return this; + } + + @Override + public PizzaSpeziale.Builder atBaseType(String atBaseType) { + this.instance.atBaseType(atBaseType); + return this; + } + + @Override + public PizzaSpeziale.Builder atType(String atType) { + this.instance.atType(atType); + return this; + } + + /** + * returns a built PizzaSpeziale instance. + * + * The builder is not reusable (NullPointerException) + */ + public PizzaSpeziale build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static PizzaSpeziale.Builder builder() { + return new PizzaSpeziale.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public PizzaSpeziale.Builder toBuilder() { + PizzaSpeziale.Builder builder = new PizzaSpeziale.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java index 3ca776dfd07..97216ba5dad 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java @@ -33,6 +33,18 @@ public class Category { private String name; + public Category() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Category(Long id, String name) { + this.id = id; + this.name = name; + } + public Category id(Long id) { this.id = id; return this; @@ -113,5 +125,69 @@ public class Category { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Category instance; + + public Builder() { + this(new Category()); + } + + protected Builder(Category instance) { + this.instance = instance; + } + + protected Builder copyOf(Category value) { + this.instance.setId(value.id); + this.instance.setName(value.name); + return this; + } + + public Category.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Category.Builder name(String name) { + this.instance.name(name); + return this; + } + + /** + * returns a built Category instance. + * + * The builder is not reusable (NullPointerException) + */ + public Category build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Category.Builder builder() { + return new Category.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Category.Builder toBuilder() { + Category.Builder builder = new Category.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java index 52a510b0fe4..710b9d7bfed 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -37,6 +37,19 @@ public class ModelApiResponse { private String message; + public ModelApiResponse() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ModelApiResponse(Integer code, String type, String message) { + this.code = code; + this.type = type; + this.message = message; + } + public ModelApiResponse code(Integer code) { this.code = code; return this; @@ -140,5 +153,75 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ModelApiResponse instance; + + public Builder() { + this(new ModelApiResponse()); + } + + protected Builder(ModelApiResponse instance) { + this.instance = instance; + } + + protected Builder copyOf(ModelApiResponse value) { + this.instance.setCode(value.code); + this.instance.setType(value.type); + this.instance.setMessage(value.message); + return this; + } + + public ModelApiResponse.Builder code(Integer code) { + this.instance.code(code); + return this; + } + + public ModelApiResponse.Builder type(String type) { + this.instance.type(type); + return this; + } + + public ModelApiResponse.Builder message(String message) { + this.instance.message(message); + return this; + } + + /** + * returns a built ModelApiResponse instance. + * + * The builder is not reusable (NullPointerException) + */ + public ModelApiResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ModelApiResponse.Builder builder() { + return new ModelApiResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelApiResponse.Builder toBuilder() { + ModelApiResponse.Builder builder = new ModelApiResponse.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java index b21ad8e3e8f..115ebd1a5fe 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java @@ -82,6 +82,22 @@ public class Order { private Boolean complete = false; + public Order() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Order(Long id, Long petId, Integer quantity, OffsetDateTime shipDate, StatusEnum status, Boolean complete) { + this.id = id; + this.petId = petId; + this.quantity = quantity; + this.shipDate = shipDate; + this.status = status; + this.complete = complete; + } + public Order id(Long id) { this.id = id; return this; @@ -254,5 +270,93 @@ public class Order { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Order instance; + + public Builder() { + this(new Order()); + } + + protected Builder(Order instance) { + this.instance = instance; + } + + protected Builder copyOf(Order value) { + this.instance.setId(value.id); + this.instance.setPetId(value.petId); + this.instance.setQuantity(value.quantity); + this.instance.setShipDate(value.shipDate); + this.instance.setStatus(value.status); + this.instance.setComplete(value.complete); + return this; + } + + public Order.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Order.Builder petId(Long petId) { + this.instance.petId(petId); + return this; + } + + public Order.Builder quantity(Integer quantity) { + this.instance.quantity(quantity); + return this; + } + + public Order.Builder shipDate(OffsetDateTime shipDate) { + this.instance.shipDate(shipDate); + return this; + } + + public Order.Builder status(StatusEnum status) { + this.instance.status(status); + return this; + } + + public Order.Builder complete(Boolean complete) { + this.instance.complete(complete); + return this; + } + + /** + * returns a built Order instance. + * + * The builder is not reusable (NullPointerException) + */ + public Order build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Order.Builder builder() { + return new Order.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Order.Builder toBuilder() { + Order.Builder builder = new Order.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index ac21f961f2c..eef9799ed6f 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -99,6 +99,18 @@ public class Pet { this.photoUrls = photoUrls; } + /** + * Constructor with all args parameters + */ + public Pet(Long id, Category category, String name, List photoUrls, List<@Valid Tag> tags, StatusEnum status) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + public Pet id(Long id) { this.id = id; return this; @@ -293,5 +305,95 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Pet instance; + + public Builder() { + this(new Pet()); + } + + protected Builder(Pet instance) { + this.instance = instance; + } + + protected Builder copyOf(Pet value) { + this.instance.setId(value.id); + this.instance.setCategory(value.category); + this.instance.setName(value.name); + this.instance.setPhotoUrls(value.photoUrls); + this.instance.setTags(value.tags); + this.instance.setStatus(value.status); + return this; + } + + public Pet.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Pet.Builder category(Category category) { + this.instance.category(category); + return this; + } + + public Pet.Builder name(String name) { + this.instance.name(name); + return this; + } + + public Pet.Builder photoUrls(List photoUrls) { + this.instance.photoUrls(photoUrls); + return this; + } + + public Pet.Builder tags(List<@Valid Tag> tags) { + this.instance.tags(tags); + return this; + } + + @Deprecated + public Pet.Builder status(StatusEnum status) { + this.instance.status(status); + return this; + } + @Deprecated + + /** + * returns a built Pet instance. + * + * The builder is not reusable (NullPointerException) + */ + public Pet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Pet.Builder builder() { + return new Pet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pet.Builder toBuilder() { + Pet.Builder builder = new Pet.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java index d36197338fc..3e4f39d2539 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java @@ -33,6 +33,18 @@ public class Tag { private String name; + public Tag() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Tag(Long id, String name) { + this.id = id; + this.name = name; + } + public Tag id(Long id) { this.id = id; return this; @@ -113,5 +125,69 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Tag instance; + + public Builder() { + this(new Tag()); + } + + protected Builder(Tag instance) { + this.instance = instance; + } + + protected Builder copyOf(Tag value) { + this.instance.setId(value.id); + this.instance.setName(value.name); + return this; + } + + public Tag.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Tag.Builder name(String name) { + this.instance.name(name); + return this; + } + + /** + * returns a built Tag instance. + * + * The builder is not reusable (NullPointerException) + */ + public Tag build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Tag.Builder builder() { + return new Tag.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Tag.Builder toBuilder() { + Tag.Builder builder = new Tag.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java index fc4e3c5d7a4..dc9b22aec54 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java @@ -45,6 +45,24 @@ public class User { private Integer userStatus; + public User() { + super(); + } + + /** + * Constructor with all args parameters + */ + public User(Long id, String username, String firstName, String lastName, String email, String password, String phone, Integer userStatus) { + this.id = id; + this.username = username; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.phone = phone; + this.userStatus = userStatus; + } + public User id(Long id) { this.id = id; return this; @@ -263,5 +281,105 @@ public class User { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private User instance; + + public Builder() { + this(new User()); + } + + protected Builder(User instance) { + this.instance = instance; + } + + protected Builder copyOf(User value) { + this.instance.setId(value.id); + this.instance.setUsername(value.username); + this.instance.setFirstName(value.firstName); + this.instance.setLastName(value.lastName); + this.instance.setEmail(value.email); + this.instance.setPassword(value.password); + this.instance.setPhone(value.phone); + this.instance.setUserStatus(value.userStatus); + return this; + } + + public User.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public User.Builder username(String username) { + this.instance.username(username); + return this; + } + + public User.Builder firstName(String firstName) { + this.instance.firstName(firstName); + return this; + } + + public User.Builder lastName(String lastName) { + this.instance.lastName(lastName); + return this; + } + + public User.Builder email(String email) { + this.instance.email(email); + return this; + } + + public User.Builder password(String password) { + this.instance.password(password); + return this; + } + + public User.Builder phone(String phone) { + this.instance.phone(phone); + return this; + } + + public User.Builder userStatus(Integer userStatus) { + this.instance.userStatus(userStatus); + return this; + } + + /** + * returns a built User instance. + * + * The builder is not reusable (NullPointerException) + */ + public User build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static User.Builder builder() { + return new User.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public User.Builder toBuilder() { + User.Builder builder = new User.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index 9a053f2851a..bdcca7675d1 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -41,7 +41,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index 9a053f2851a..bdcca7675d1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -41,7 +41,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/echo_api/kotlin-wiremock/.gitignore b/samples/server/echo_api/kotlin-wiremock/.gitignore new file mode 100644 index 00000000000..2983e3c1db3 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/.gitignore @@ -0,0 +1,106 @@ +./bin/ +# Created by https://www.gitignore.io/api/java,intellij,gradle + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +# End of https://www.gitignore.io/api/java,intellij,gradle diff --git a/samples/server/echo_api/kotlin-wiremock/.openapi-generator-ignore b/samples/server/echo_api/kotlin-wiremock/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES new file mode 100644 index 00000000000..762b5275483 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.gitignore +build.gradle.kts +gradle/libs.versions.toml +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle.kts +src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt +src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt +src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/FormApiStubs.kt +src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/HeaderApiStubs.kt +src/main/kotlin/org/openapitools/apis/PathApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/PathApiStubs.kt +src/main/kotlin/org/openapitools/apis/QueryApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/QueryApiStubs.kt +src/main/kotlin/org/openapitools/models/Bird.kt +src/main/kotlin/org/openapitools/models/Category.kt +src/main/kotlin/org/openapitools/models/DefaultValue.kt +src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt +src/main/kotlin/org/openapitools/models/Pet.kt +src/main/kotlin/org/openapitools/models/Query.kt +src/main/kotlin/org/openapitools/models/StringEnumRef.kt +src/main/kotlin/org/openapitools/models/Tag.kt +src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/server/echo_api/kotlin-wiremock/.openapi-generator/VERSION b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/echo_api/kotlin-wiremock/build.gradle.kts b/samples/server/echo_api/kotlin-wiremock/build.gradle.kts new file mode 100644 index 00000000000..f5d878978f3 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/build.gradle.kts @@ -0,0 +1,21 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "org.openapitools" +version = "1.0.0" + +tasks.wrapper { + gradleVersion = "8.7" +} + +plugins { + alias(libs.plugins.kotlin.jvm) +} + +tasks.withType { + kotlinOptions.jvmTarget = "11" +} + +dependencies { + implementation(libs.wiremock) + implementation(libs.jackson.databind) +} \ No newline at end of file diff --git a/samples/server/echo_api/kotlin-wiremock/gradle/libs.versions.toml b/samples/server/echo_api/kotlin-wiremock/gradle/libs.versions.toml new file mode 100644 index 00000000000..23fdd0ddbc1 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/gradle/libs.versions.toml @@ -0,0 +1,10 @@ +[versions] +kotlin = "1.9.23" +wiremock = "3.5.4" + +[libraries] +wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version = "2.17.1" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } \ No newline at end of file diff --git a/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar b/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..d64cd491770 Binary files /dev/null and b/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties b/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..e7646dead06 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/server/echo_api/kotlin-wiremock/gradlew b/samples/server/echo_api/kotlin-wiremock/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/server/echo_api/kotlin-wiremock/gradlew.bat b/samples/server/echo_api/kotlin-wiremock/gradlew.bat new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/gradlew.bat @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/server/echo_api/kotlin-wiremock/settings.gradle.kts b/samples/server/echo_api/kotlin-wiremock/settings.gradle.kts new file mode 100644 index 00000000000..537908ca655 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/settings.gradle.kts @@ -0,0 +1,7 @@ +rootProject.name = "kotlin-wiremock" + +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} \ No newline at end of file diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt new file mode 100644 index 00000000000..cccbcd94168 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt @@ -0,0 +1,109 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testAuthHttpBasic. + */ +class TestAuthHttpBasicStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testAuthHttpBasic respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testAuthHttpBasic respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testAuthHttpBearer. + */ +class TestAuthHttpBearerStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testAuthHttpBearer respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testAuthHttpBearer respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt new file mode 100644 index 00000000000..2de65e35b68 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt @@ -0,0 +1,42 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class AuthApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testAuthHttpBasic. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestAuthHttpBasicStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testAuthHttpBasic(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestAuthHttpBasicStubBuilder = + TestAuthHttpBasicStubBuilder(objectMapper, post(urlPathTemplate("/auth/http/basic")) + .configurer() + ) + + /** + * Construct a stub for the operation testAuthHttpBearer. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestAuthHttpBearerStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testAuthHttpBearer(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestAuthHttpBearerStubBuilder = + TestAuthHttpBearerStubBuilder(objectMapper, post(urlPathTemplate("/auth/http/bearer")) + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt new file mode 100644 index 00000000000..16286fdec9d --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt @@ -0,0 +1,391 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testBinaryGif. + */ +class TestBinaryGifStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testBinaryGif respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: java.io.File, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testBinaryGif respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testBodyApplicationOctetstreamBinary. + */ +class TestBodyApplicationOctetstreamBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testBodyApplicationOctetstreamBinary respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testBodyApplicationOctetstreamBinary respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testBodyMultipartFormdataArrayOfBinary. + */ +class TestBodyMultipartFormdataArrayOfBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testBodyMultipartFormdataArrayOfBinary respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testBodyMultipartFormdataArrayOfBinary respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testBodyMultipartFormdataSingleBinary. + */ +class TestBodyMultipartFormdataSingleBinaryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testBodyMultipartFormdataSingleBinary respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testBodyMultipartFormdataSingleBinary respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testEchoBodyFreeFormObjectResponseString. + */ +class TestEchoBodyFreeFormObjectResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testEchoBodyFreeFormObjectResponseString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testEchoBodyFreeFormObjectResponseString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testEchoBodyPet. + */ +class TestEchoBodyPetStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testEchoBodyPet respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testEchoBodyPet respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testEchoBodyPetResponseString. + */ +class TestEchoBodyPetResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testEchoBodyPetResponseString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testEchoBodyPetResponseString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testEchoBodyTagResponseString. + */ +class TestEchoBodyTagResponseStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testEchoBodyTagResponseString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testEchoBodyTagResponseString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt new file mode 100644 index 00000000000..9a4f49a9ce0 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt @@ -0,0 +1,108 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class BodyApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testBinaryGif. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestBinaryGifStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testBinaryGif(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBinaryGifStubBuilder = + TestBinaryGifStubBuilder(objectMapper, post(urlPathTemplate("/binary/gif")) + .configurer() + ) + + /** + * Construct a stub for the operation testBodyApplicationOctetstreamBinary. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestBodyApplicationOctetstreamBinaryStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testBodyApplicationOctetstreamBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyApplicationOctetstreamBinaryStubBuilder = + TestBodyApplicationOctetstreamBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/binary")) + .configurer() + ) + + /** + * Construct a stub for the operation testBodyMultipartFormdataArrayOfBinary. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestBodyMultipartFormdataArrayOfBinaryStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testBodyMultipartFormdataArrayOfBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyMultipartFormdataArrayOfBinaryStubBuilder = + TestBodyMultipartFormdataArrayOfBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/array_of_binary")) + .configurer() + ) + + /** + * Construct a stub for the operation testBodyMultipartFormdataSingleBinary. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestBodyMultipartFormdataSingleBinaryStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testBodyMultipartFormdataSingleBinary(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestBodyMultipartFormdataSingleBinaryStubBuilder = + TestBodyMultipartFormdataSingleBinaryStubBuilder(objectMapper, post(urlPathTemplate("/body/application/octetstream/single_binary")) + .configurer() + ) + + /** + * Construct a stub for the operation testEchoBodyFreeFormObjectResponseString. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestEchoBodyFreeFormObjectResponseStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testEchoBodyFreeFormObjectResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyFreeFormObjectResponseStringStubBuilder = + TestEchoBodyFreeFormObjectResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/FreeFormObject/response_string")) + .configurer() + ) + + /** + * Construct a stub for the operation testEchoBodyPet. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestEchoBodyPetStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testEchoBodyPet(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyPetStubBuilder = + TestEchoBodyPetStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Pet")) + .configurer() + ) + + /** + * Construct a stub for the operation testEchoBodyPetResponseString. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestEchoBodyPetResponseStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testEchoBodyPetResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyPetResponseStringStubBuilder = + TestEchoBodyPetResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Pet/response_string")) + .configurer() + ) + + /** + * Construct a stub for the operation testEchoBodyTagResponseString. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestEchoBodyTagResponseStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testEchoBodyTagResponseString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEchoBodyTagResponseStringStubBuilder = + TestEchoBodyTagResponseStringStubBuilder(objectMapper, post(urlPathTemplate("/echo/body/Tag/response_string")) + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt new file mode 100644 index 00000000000..a25e427db01 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt @@ -0,0 +1,109 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testFormIntegerBooleanString. + */ +class TestFormIntegerBooleanStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testFormIntegerBooleanString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testFormIntegerBooleanString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testFormOneof. + */ +class TestFormOneofStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testFormOneof respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testFormOneof respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubs.kt new file mode 100644 index 00000000000..d428eadc7b9 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/FormApiStubs.kt @@ -0,0 +1,42 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class FormApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testFormIntegerBooleanString. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestFormIntegerBooleanStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testFormIntegerBooleanString(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestFormIntegerBooleanStringStubBuilder = + TestFormIntegerBooleanStringStubBuilder(objectMapper, post(urlPathTemplate("/form/integer/boolean/string")) + .configurer() + ) + + /** + * Construct a stub for the operation testFormOneof. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestFormOneofStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testFormOneof(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestFormOneofStubBuilder = + TestFormOneofStubBuilder(objectMapper, post(urlPathTemplate("/form/oneof")) + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt new file mode 100644 index 00000000000..4dbe40addb0 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt @@ -0,0 +1,62 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testHeaderIntegerBooleanStringEnums. + */ +class TestHeaderIntegerBooleanStringEnumsStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testHeaderIntegerBooleanStringEnums respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testHeaderIntegerBooleanStringEnums respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubs.kt new file mode 100644 index 00000000000..3a394fe962e --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/HeaderApiStubs.kt @@ -0,0 +1,31 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class HeaderApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testHeaderIntegerBooleanStringEnums. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestHeaderIntegerBooleanStringEnumsStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testHeaderIntegerBooleanStringEnums(configurer: MappingBuilder.() -> MappingBuilder = { this }): TestHeaderIntegerBooleanStringEnumsStubBuilder = + TestHeaderIntegerBooleanStringEnumsStubBuilder(objectMapper, get(urlPathTemplate("/header/integer/boolean/string/enums")) + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubBuilders.kt new file mode 100644 index 00000000000..c33be23bb98 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubBuilders.kt @@ -0,0 +1,62 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath. + */ +class TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubs.kt new file mode 100644 index 00000000000..011d4e396e0 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PathApiStubs.kt @@ -0,0 +1,39 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class PathApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath. + * + * @param pathString path parameter pathString pattern. + * @param pathInteger path parameter pathInteger pattern. + * @param enumNonrefStringPath path parameter enumNonrefStringPath pattern. + * @param enumRefStringPath path parameter enumRefStringPath pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: StringValuePattern, pathInteger: StringValuePattern, enumNonrefStringPath: StringValuePattern, enumRefStringPath: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder = + TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathStubBuilder(objectMapper, get(urlPathTemplate("/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}")) + .withPathParam("pathString", pathString) + .withPathParam("pathInteger", pathInteger) + .withPathParam("enumNonrefStringPath", enumNonrefStringPath) + .withPathParam("enumRefStringPath", enumRefStringPath) + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubBuilders.kt new file mode 100644 index 00000000000..77e10817e14 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubBuilders.kt @@ -0,0 +1,297 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testEnumRefString. + */ +class TestEnumRefStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testEnumRefString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testEnumRefString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testQueryDatetimeDateString. + */ +class TestQueryDatetimeDateStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testQueryDatetimeDateString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testQueryDatetimeDateString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testQueryIntegerBooleanString. + */ +class TestQueryIntegerBooleanStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testQueryIntegerBooleanString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testQueryIntegerBooleanString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testQueryStyleDeepObjectExplodeTrueObject. + */ +class TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testQueryStyleDeepObjectExplodeTrueObject respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testQueryStyleDeepObjectExplodeTrueObject respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testQueryStyleFormExplodeTrueArrayString. + */ +class TestQueryStyleFormExplodeTrueArrayStringStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testQueryStyleFormExplodeTrueArrayString respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testQueryStyleFormExplodeTrueArrayString respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation testQueryStyleFormExplodeTrueObject. + */ +class TestQueryStyleFormExplodeTrueObjectStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testQueryStyleFormExplodeTrueObject respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testQueryStyleFormExplodeTrueObject respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubs.kt new file mode 100644 index 00000000000..96f7bf35cb2 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/QueryApiStubs.kt @@ -0,0 +1,108 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class QueryApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testEnumRefString. + * + * @param enumNonrefStringQuery query parameter enumNonrefStringQuery pattern. + * @param enumRefStringQuery query parameter enumRefStringQuery pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestEnumRefStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testEnumRefString(enumNonrefStringQuery: StringValuePattern? = null, enumRefStringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestEnumRefStringStubBuilder = + TestEnumRefStringStubBuilder(objectMapper, get(urlPathTemplate("/query/enum_ref_string")) + .apply { enumNonrefStringQuery?.let { withQueryParam("enumNonrefStringQuery", it) } } + .apply { enumRefStringQuery?.let { withQueryParam("enumRefStringQuery", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation testQueryDatetimeDateString. + * + * @param datetimeQuery query parameter datetimeQuery pattern. + * @param dateQuery query parameter dateQuery pattern. + * @param stringQuery query parameter stringQuery pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestQueryDatetimeDateStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testQueryDatetimeDateString(datetimeQuery: StringValuePattern? = null, dateQuery: StringValuePattern? = null, stringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryDatetimeDateStringStubBuilder = + TestQueryDatetimeDateStringStubBuilder(objectMapper, get(urlPathTemplate("/query/datetime/date/string")) + .apply { datetimeQuery?.let { withQueryParam("datetimeQuery", it) } } + .apply { dateQuery?.let { withQueryParam("dateQuery", it) } } + .apply { stringQuery?.let { withQueryParam("stringQuery", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation testQueryIntegerBooleanString. + * + * @param integerQuery query parameter integerQuery pattern. + * @param booleanQuery query parameter booleanQuery pattern. + * @param stringQuery query parameter stringQuery pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestQueryIntegerBooleanStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testQueryIntegerBooleanString(integerQuery: StringValuePattern? = null, booleanQuery: StringValuePattern? = null, stringQuery: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryIntegerBooleanStringStubBuilder = + TestQueryIntegerBooleanStringStubBuilder(objectMapper, get(urlPathTemplate("/query/integer/boolean/string")) + .apply { integerQuery?.let { withQueryParam("integerQuery", it) } } + .apply { booleanQuery?.let { withQueryParam("booleanQuery", it) } } + .apply { stringQuery?.let { withQueryParam("stringQuery", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation testQueryStyleDeepObjectExplodeTrueObject. + * + * @param queryObject query parameter queryObject pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder = + TestQueryStyleDeepObjectExplodeTrueObjectStubBuilder(objectMapper, get(urlPathTemplate("/query/style_deepObject/explode_true/object")) + .apply { queryObject?.let { withQueryParam("queryObject", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation testQueryStyleFormExplodeTrueArrayString. + * + * @param queryObject query parameter queryObject pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestQueryStyleFormExplodeTrueArrayStringStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testQueryStyleFormExplodeTrueArrayString(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleFormExplodeTrueArrayStringStubBuilder = + TestQueryStyleFormExplodeTrueArrayStringStubBuilder(objectMapper, get(urlPathTemplate("/query/style_form/explode_true/array_string")) + .apply { queryObject?.let { withQueryParam("queryObject", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation testQueryStyleFormExplodeTrueObject. + * + * @param queryObject query parameter queryObject pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestQueryStyleFormExplodeTrueObjectStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testQueryStyleFormExplodeTrueObject(queryObject: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestQueryStyleFormExplodeTrueObjectStubBuilder = + TestQueryStyleFormExplodeTrueObjectStubBuilder(objectMapper, get(urlPathTemplate("/query/style_form/explode_true/object")) + .apply { queryObject?.let { withQueryParam("queryObject", it) } } + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Bird.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Bird.kt new file mode 100644 index 00000000000..e98d044343b --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Bird.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Bird( + @field:JsonProperty("size") + val propertySize: kotlin.String? = null, + + @field:JsonProperty("color") + val color: kotlin.String? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt new file mode 100644 index 00000000000..8904ea0c3b8 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Category( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/DefaultValue.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/DefaultValue.kt new file mode 100644 index 00000000000..f9934308010 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/DefaultValue.kt @@ -0,0 +1,35 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class DefaultValue( + @field:JsonProperty("array_string_enum_ref_default") + val arrayStringEnumRefDefault: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_enum_default") + val arrayStringEnumDefault: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_default") + val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), + + @field:JsonProperty("array_integer_default") + val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), + + @field:JsonProperty("array_string") + val arrayString: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_nullable") + val arrayStringNullable: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_extension_nullable") + val arrayStringExtensionNullable: kotlin.collections.List? = null, + + @field:JsonProperty("string_nullable") + val stringNullable: kotlin.String? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt new file mode 100644 index 00000000000..b16a9ec2306 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt @@ -0,0 +1,20 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class NumberPropertiesOnly( + @field:JsonProperty("number") + val number: java.math.BigDecimal? = null, + + @field:JsonProperty("float") + val float: kotlin.Float? = null, + + @field:JsonProperty("double") + val double: kotlin.Double? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt new file mode 100644 index 00000000000..2498edf6052 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt @@ -0,0 +1,29 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Pet( + @field:JsonProperty("name") + val name: kotlin.String, + + @field:JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("category") + val category: Category? = null, + + @field:JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + @field:JsonProperty("status") + val status: kotlin.String? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Query.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Query.kt new file mode 100644 index 00000000000..77b111d9042 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Query.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Query( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("outcomes") + val outcomes: kotlin.collections.List? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEnumRef.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEnumRef.kt new file mode 100644 index 00000000000..8c89d4f7f8d --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEnumRef.kt @@ -0,0 +1,14 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +enum class StringEnumRef { + @JsonProperty(value = "success") success, + @JsonProperty(value = "failure") failure, + @JsonProperty(value = "unclassified") unclassified, +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt new file mode 100644 index 00000000000..b1b72f4cd18 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Tag( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null, + +) diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt new file mode 100644 index 00000000000..4f541fb3458 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -0,0 +1,14 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter( + @field:JsonProperty("values") + val propertyValues: kotlin.collections.List? = null, + +) diff --git a/samples/server/others/go-server/no-body-path-params/.openapi-generator-ignore b/samples/server/others/go-server/no-body-path-params/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/others/go-server/no-body-path-params/.openapi-generator/FILES b/samples/server/others/go-server/no-body-path-params/.openapi-generator/FILES new file mode 100644 index 00000000000..a772660d829 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/.openapi-generator/FILES @@ -0,0 +1,20 @@ +Dockerfile +README.md +api/openapi.yaml +go.mod +go/api.go +go/api_body.go +go/api_body_service.go +go/api_both.go +go/api_both_service.go +go/api_none.go +go/api_none_service.go +go/api_path.go +go/api_path_service.go +go/error.go +go/helpers.go +go/impl.go +go/logger.go +go/model_body_request.go +go/routers.go +main.go diff --git a/samples/server/others/go-server/no-body-path-params/.openapi-generator/VERSION b/samples/server/others/go-server/no-body-path-params/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/others/go-server/no-body-path-params/Dockerfile b/samples/server/others/go-server/no-body-path-params/Dockerfile new file mode 100644 index 00000000000..2a71bb77629 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.19 AS build +WORKDIR /go/src +COPY go ./go +COPY main.go . +COPY go.sum . +COPY go.mod . + +ENV CGO_ENABLED=0 + +RUN go build -o petstoreserver . + +FROM scratch AS runtime +COPY --from=build /go/src/petstoreserver ./ +EXPOSE 8080/tcp +ENTRYPOINT ["./petstoreserver"] diff --git a/samples/server/others/go-server/no-body-path-params/README.md b/samples/server/others/go-server/no-body-path-params/README.md new file mode 100644 index 00000000000..e08eaa35216 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/README.md @@ -0,0 +1,34 @@ +# Go API Server for petstoreserver + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://openapi-generator.tech) + +- API version: 1.0.0 +- Generator version: 8.0.0-SNAPSHOT + + +### Running the server +To run the server, follow these simple steps: + +``` +go run main.go +``` + +To run the server in a docker container +``` +docker build --network=host -t petstoreserver . +``` + +Once image is built use +``` +docker run --rm -it petstoreserver +``` diff --git a/samples/server/others/go-server/no-body-path-params/api/openapi.yaml b/samples/server/others/go-server/no-body-path-params/api/openapi.yaml new file mode 100644 index 00000000000..281f5424039 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/api/openapi.yaml @@ -0,0 +1,90 @@ +openapi: 3.0.0 +info: + title: Simple no path and body param spec + version: 1.0.0 +servers: +- url: / +paths: + /none/endpoint: + get: + description: description + operationId: one + responses: + "204": + description: successful operation + summary: summary + tags: + - none + /path/endpoint/{pathParam}: + get: + description: description + operationId: path + parameters: + - explode: false + in: path + name: pathParam + required: true + schema: + type: string + style: form + responses: + "204": + description: successful operation + summary: summary + tags: + - path + /body/endpoint: + post: + description: description + operationId: body + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/body_request' + text/plain: + schema: + type: string + description: Optional description in *Markdown* + required: true + responses: + "204": + description: successful operation + summary: summary + tags: + - body + /both/endpoint/{pathParam}: + post: + description: description + operationId: both + parameters: + - explode: false + in: path + name: pathParam + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/body_request' + text/plain: + schema: + type: string + description: Optional description in *Markdown* + required: true + responses: + "204": + description: successful operation + summary: summary + tags: + - both +components: + schemas: + body_request: + properties: + param: + type: string + type: object diff --git a/samples/server/others/go-server/no-body-path-params/go.mod b/samples/server/others/go-server/no-body-path-params/go.mod new file mode 100644 index 00000000000..65afa7e7071 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go.mod @@ -0,0 +1,5 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.18 + +require github.com/gorilla/mux v1.8.0 diff --git a/samples/server/others/go-server/no-body-path-params/go/api.go b/samples/server/others/go-server/no-body-path-params/go/api.go new file mode 100644 index 00000000000..c27ecc34176 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api.go @@ -0,0 +1,79 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "context" + "net/http" +) + + + +// BodyAPIRouter defines the required methods for binding the api requests to a responses for the BodyAPI +// The BodyAPIRouter implementation should parse necessary information from the http request, +// pass the data to a BodyAPIServicer to perform the required actions, then write the service results to the http response. +type BodyAPIRouter interface { + Body(http.ResponseWriter, *http.Request) +} +// BothAPIRouter defines the required methods for binding the api requests to a responses for the BothAPI +// The BothAPIRouter implementation should parse necessary information from the http request, +// pass the data to a BothAPIServicer to perform the required actions, then write the service results to the http response. +type BothAPIRouter interface { + Both(http.ResponseWriter, *http.Request) +} +// NoneAPIRouter defines the required methods for binding the api requests to a responses for the NoneAPI +// The NoneAPIRouter implementation should parse necessary information from the http request, +// pass the data to a NoneAPIServicer to perform the required actions, then write the service results to the http response. +type NoneAPIRouter interface { + One(http.ResponseWriter, *http.Request) +} +// PathAPIRouter defines the required methods for binding the api requests to a responses for the PathAPI +// The PathAPIRouter implementation should parse necessary information from the http request, +// pass the data to a PathAPIServicer to perform the required actions, then write the service results to the http response. +type PathAPIRouter interface { + Path(http.ResponseWriter, *http.Request) +} + + +// BodyAPIServicer defines the api actions for the BodyAPI service +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can be ignored with the .openapi-generator-ignore file +// and updated with the logic required for the API. +type BodyAPIServicer interface { + Body(context.Context, BodyRequest) (ImplResponse, error) +} + + +// BothAPIServicer defines the api actions for the BothAPI service +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can be ignored with the .openapi-generator-ignore file +// and updated with the logic required for the API. +type BothAPIServicer interface { + Both(context.Context, string, BodyRequest) (ImplResponse, error) +} + + +// NoneAPIServicer defines the api actions for the NoneAPI service +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can be ignored with the .openapi-generator-ignore file +// and updated with the logic required for the API. +type NoneAPIServicer interface { + One(context.Context) (ImplResponse, error) +} + + +// PathAPIServicer defines the api actions for the PathAPI service +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can be ignored with the .openapi-generator-ignore file +// and updated with the logic required for the API. +type PathAPIServicer interface { + Path(context.Context, string) (ImplResponse, error) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_body.go b/samples/server/others/go-server/no-body-path-params/go/api_body.go new file mode 100644 index 00000000000..02b5ad81f38 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_body.go @@ -0,0 +1,85 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "encoding/json" + "net/http" + "strings" +) + +// BodyAPIController binds http requests to an api service and writes the service results to the http response +type BodyAPIController struct { + service BodyAPIServicer + errorHandler ErrorHandler +} + +// BodyAPIOption for how the controller is set up. +type BodyAPIOption func(*BodyAPIController) + +// WithBodyAPIErrorHandler inject ErrorHandler into controller +func WithBodyAPIErrorHandler(h ErrorHandler) BodyAPIOption { + return func(c *BodyAPIController) { + c.errorHandler = h + } +} + +// NewBodyAPIController creates a default api controller +func NewBodyAPIController(s BodyAPIServicer, opts ...BodyAPIOption) *BodyAPIController { + controller := &BodyAPIController{ + service: s, + errorHandler: DefaultErrorHandler, + } + + for _, opt := range opts { + opt(controller) + } + + return controller +} + +// Routes returns all the api routes for the BodyAPIController +func (c *BodyAPIController) Routes() Routes { + return Routes{ + "Body": Route{ + strings.ToUpper("Post"), + "/body/endpoint", + c.Body, + }, + } +} + +// Body - summary +func (c *BodyAPIController) Body(w http.ResponseWriter, r *http.Request) { + bodyRequestParam := BodyRequest{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&bodyRequestParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertBodyRequestRequired(bodyRequestParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + if err := AssertBodyRequestConstraints(bodyRequestParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.Body(r.Context(), bodyRequestParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_body_service.go b/samples/server/others/go-server/no-body-path-params/go/api_body_service.go new file mode 100644 index 00000000000..2f0c8082935 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_body_service.go @@ -0,0 +1,39 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "context" + "net/http" + "errors" +) + +// BodyAPIService is a service that implements the logic for the BodyAPIServicer +// This service should implement the business logic for every endpoint for the BodyAPI API. +// Include any external packages or services that will be required by this service. +type BodyAPIService struct { +} + +// NewBodyAPIService creates a default api service +func NewBodyAPIService() *BodyAPIService { + return &BodyAPIService{} +} + +// Body - summary +func (s *BodyAPIService) Body(ctx context.Context, bodyRequest BodyRequest) (ImplResponse, error) { + // TODO - update Body with the required logic for this service method. + // Add api_body_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + // TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + // return Response(204, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("Body method not implemented") +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_both.go b/samples/server/others/go-server/no-body-path-params/go/api_both.go new file mode 100644 index 00000000000..c100791a92d --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_both.go @@ -0,0 +1,93 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/gorilla/mux" +) + +// BothAPIController binds http requests to an api service and writes the service results to the http response +type BothAPIController struct { + service BothAPIServicer + errorHandler ErrorHandler +} + +// BothAPIOption for how the controller is set up. +type BothAPIOption func(*BothAPIController) + +// WithBothAPIErrorHandler inject ErrorHandler into controller +func WithBothAPIErrorHandler(h ErrorHandler) BothAPIOption { + return func(c *BothAPIController) { + c.errorHandler = h + } +} + +// NewBothAPIController creates a default api controller +func NewBothAPIController(s BothAPIServicer, opts ...BothAPIOption) *BothAPIController { + controller := &BothAPIController{ + service: s, + errorHandler: DefaultErrorHandler, + } + + for _, opt := range opts { + opt(controller) + } + + return controller +} + +// Routes returns all the api routes for the BothAPIController +func (c *BothAPIController) Routes() Routes { + return Routes{ + "Both": Route{ + strings.ToUpper("Post"), + "/both/endpoint/{pathParam}", + c.Both, + }, + } +} + +// Both - summary +func (c *BothAPIController) Both(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + pathParamParam := params["pathParam"] + if pathParamParam == "" { + c.errorHandler(w, r, &RequiredError{"pathParam"}, nil) + return + } + bodyRequestParam := BodyRequest{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&bodyRequestParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertBodyRequestRequired(bodyRequestParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + if err := AssertBodyRequestConstraints(bodyRequestParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.Both(r.Context(), pathParamParam, bodyRequestParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_both_service.go b/samples/server/others/go-server/no-body-path-params/go/api_both_service.go new file mode 100644 index 00000000000..bb9b26a3862 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_both_service.go @@ -0,0 +1,39 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "context" + "net/http" + "errors" +) + +// BothAPIService is a service that implements the logic for the BothAPIServicer +// This service should implement the business logic for every endpoint for the BothAPI API. +// Include any external packages or services that will be required by this service. +type BothAPIService struct { +} + +// NewBothAPIService creates a default api service +func NewBothAPIService() *BothAPIService { + return &BothAPIService{} +} + +// Both - summary +func (s *BothAPIService) Both(ctx context.Context, pathParam string, bodyRequest BodyRequest) (ImplResponse, error) { + // TODO - update Both with the required logic for this service method. + // Add api_both_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + // TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + // return Response(204, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("Both method not implemented") +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_none.go b/samples/server/others/go-server/no-body-path-params/go/api_none.go new file mode 100644 index 00000000000..54bbc5ad85d --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_none.go @@ -0,0 +1,69 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "net/http" + "strings" +) + +// NoneAPIController binds http requests to an api service and writes the service results to the http response +type NoneAPIController struct { + service NoneAPIServicer + errorHandler ErrorHandler +} + +// NoneAPIOption for how the controller is set up. +type NoneAPIOption func(*NoneAPIController) + +// WithNoneAPIErrorHandler inject ErrorHandler into controller +func WithNoneAPIErrorHandler(h ErrorHandler) NoneAPIOption { + return func(c *NoneAPIController) { + c.errorHandler = h + } +} + +// NewNoneAPIController creates a default api controller +func NewNoneAPIController(s NoneAPIServicer, opts ...NoneAPIOption) *NoneAPIController { + controller := &NoneAPIController{ + service: s, + errorHandler: DefaultErrorHandler, + } + + for _, opt := range opts { + opt(controller) + } + + return controller +} + +// Routes returns all the api routes for the NoneAPIController +func (c *NoneAPIController) Routes() Routes { + return Routes{ + "One": Route{ + strings.ToUpper("Get"), + "/none/endpoint", + c.One, + }, + } +} + +// One - summary +func (c *NoneAPIController) One(w http.ResponseWriter, r *http.Request) { + result, err := c.service.One(r.Context()) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_none_service.go b/samples/server/others/go-server/no-body-path-params/go/api_none_service.go new file mode 100644 index 00000000000..b259fe8198f --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_none_service.go @@ -0,0 +1,39 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "context" + "net/http" + "errors" +) + +// NoneAPIService is a service that implements the logic for the NoneAPIServicer +// This service should implement the business logic for every endpoint for the NoneAPI API. +// Include any external packages or services that will be required by this service. +type NoneAPIService struct { +} + +// NewNoneAPIService creates a default api service +func NewNoneAPIService() *NoneAPIService { + return &NoneAPIService{} +} + +// One - summary +func (s *NoneAPIService) One(ctx context.Context) (ImplResponse, error) { + // TODO - update One with the required logic for this service method. + // Add api_none_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + // TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + // return Response(204, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("One method not implemented") +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_path.go b/samples/server/others/go-server/no-body-path-params/go/api_path.go new file mode 100644 index 00000000000..beb6dbd6e7a --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_path.go @@ -0,0 +1,77 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "net/http" + "strings" + + "github.com/gorilla/mux" +) + +// PathAPIController binds http requests to an api service and writes the service results to the http response +type PathAPIController struct { + service PathAPIServicer + errorHandler ErrorHandler +} + +// PathAPIOption for how the controller is set up. +type PathAPIOption func(*PathAPIController) + +// WithPathAPIErrorHandler inject ErrorHandler into controller +func WithPathAPIErrorHandler(h ErrorHandler) PathAPIOption { + return func(c *PathAPIController) { + c.errorHandler = h + } +} + +// NewPathAPIController creates a default api controller +func NewPathAPIController(s PathAPIServicer, opts ...PathAPIOption) *PathAPIController { + controller := &PathAPIController{ + service: s, + errorHandler: DefaultErrorHandler, + } + + for _, opt := range opts { + opt(controller) + } + + return controller +} + +// Routes returns all the api routes for the PathAPIController +func (c *PathAPIController) Routes() Routes { + return Routes{ + "Path": Route{ + strings.ToUpper("Get"), + "/path/endpoint/{pathParam}", + c.Path, + }, + } +} + +// Path - summary +func (c *PathAPIController) Path(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + pathParamParam := params["pathParam"] + if pathParamParam == "" { + c.errorHandler(w, r, &RequiredError{"pathParam"}, nil) + return + } + result, err := c.service.Path(r.Context(), pathParamParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/api_path_service.go b/samples/server/others/go-server/no-body-path-params/go/api_path_service.go new file mode 100644 index 00000000000..706e9780501 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/api_path_service.go @@ -0,0 +1,39 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "context" + "net/http" + "errors" +) + +// PathAPIService is a service that implements the logic for the PathAPIServicer +// This service should implement the business logic for every endpoint for the PathAPI API. +// Include any external packages or services that will be required by this service. +type PathAPIService struct { +} + +// NewPathAPIService creates a default api service +func NewPathAPIService() *PathAPIService { + return &PathAPIService{} +} + +// Path - summary +func (s *PathAPIService) Path(ctx context.Context, pathParam string) (ImplResponse, error) { + // TODO - update Path with the required logic for this service method. + // Add api_path_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + // TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + // return Response(204, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("Path method not implemented") +} diff --git a/samples/server/others/go-server/no-body-path-params/go/error.go b/samples/server/others/go-server/no-body-path-params/go/error.go new file mode 100644 index 00000000000..6da8e9adacb --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/error.go @@ -0,0 +1,74 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "errors" + "fmt" + "net/http" +) + +var ( + // ErrTypeAssertionError is thrown when type an interface does not match the asserted type + ErrTypeAssertionError = errors.New("unable to assert type") +) + +// ParsingError indicates that an error has occurred when parsing request parameters +type ParsingError struct { + Param string + Err error +} + +func (e *ParsingError) Unwrap() error { + return e.Err +} + +func (e *ParsingError) Error() string { + if e.Param == "" { + return e.Err.Error() + } + + return e.Param + ": " + e.Err.Error() +} + +// RequiredError indicates that an error has occurred when parsing request parameters +type RequiredError struct { + Field string +} + +func (e *RequiredError) Error() string { + return fmt.Sprintf("required field '%s' is zero value.", e.Field) +} + +// ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if +// you would like errors to be handled differently from the DefaultErrorHandler +type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) + +// DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing +// request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. +func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *ImplResponse) { + var parsingErr *ParsingError + if ok := errors.As(err, &parsingErr); ok { + // Handle parsing errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) + return + } + + var requiredErr *RequiredError + if ok := errors.As(err, &requiredErr); ok { + // Handle missing required errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) + return + } + + // Handle all other errors + _ = EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/helpers.go b/samples/server/others/go-server/no-body-path-params/go/helpers.go new file mode 100644 index 00000000000..9c9664853e6 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/helpers.go @@ -0,0 +1,71 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "reflect" +) + +// Response return a ImplResponse struct filled +func Response(code int, body interface{}) ImplResponse { + return ImplResponse { + Code: code, + Headers: nil, + Body: body, + } +} + +// ResponseWithHeaders return a ImplResponse struct filled, including headers +func ResponseWithHeaders(code int, headers map[string][]string, body interface{}) ImplResponse { + return ImplResponse { + Code: code, + Headers: headers, + Body: body, + } +} + +// IsZeroValue checks if the val is the zero-ed value. +func IsZeroValue(val interface{}) bool { + return val == nil || reflect.DeepEqual(val, reflect.Zero(reflect.TypeOf(val)).Interface()) +} + +// AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. +// This method traverse nested slices in a preorder fashion. +func AssertRecurseInterfaceRequired[T any](obj interface{}, callback func(T) error) error { + return AssertRecurseValueRequired(reflect.ValueOf(obj), callback) +} + +// AssertRecurseValueRequired checks each struct in the nested slice against the callback. +// This method traverse nested slices in a preorder fashion. ErrTypeAssertionError is thrown if +// the underlying struct does not match type T. +func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) error) error { + switch value.Kind() { + // If it is a struct we check using callback + case reflect.Struct: + obj, ok := value.Interface().(T) + if !ok { + return ErrTypeAssertionError + } + + if err := callback(obj); err != nil { + return err + } + + // If it is a slice we continue recursion + case reflect.Slice: + for i := 0; i < value.Len(); i++ { + if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { + return err + } + } + } + return nil +} diff --git a/samples/server/others/go-server/no-body-path-params/go/impl.go b/samples/server/others/go-server/no-body-path-params/go/impl.go new file mode 100644 index 00000000000..f03a4af7f41 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/impl.go @@ -0,0 +1,18 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +// ImplResponse defines an implementation response with error code and the associated body +type ImplResponse struct { + Code int + Headers map[string][]string + Body interface{} +} diff --git a/samples/server/others/go-server/no-body-path-params/go/logger.go b/samples/server/others/go-server/no-body-path-params/go/logger.go new file mode 100644 index 00000000000..09211a7dc10 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/logger.go @@ -0,0 +1,33 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "log" + "net/http" + "time" +) + +func Logger(inner http.Handler, name string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + + inner.ServeHTTP(w, r) + + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) +} diff --git a/samples/server/others/go-server/no-body-path-params/go/model_body_request.go b/samples/server/others/go-server/no-body-path-params/go/model_body_request.go new file mode 100644 index 00000000000..92b220c01b2 --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/model_body_request.go @@ -0,0 +1,29 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + + + + +type BodyRequest struct { + + Param string `json:"param,omitempty"` +} + +// AssertBodyRequestRequired checks if the required fields are not zero-ed +func AssertBodyRequestRequired(obj BodyRequest) error { + return nil +} + +// AssertBodyRequestConstraints checks if the values respects the defined constraints +func AssertBodyRequestConstraints(obj BodyRequest) error { + return nil +} diff --git a/samples/server/others/go-server/no-body-path-params/go/routers.go b/samples/server/others/go-server/no-body-path-params/go/routers.go new file mode 100644 index 00000000000..249c28f9e3b --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/go/routers.go @@ -0,0 +1,350 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package petstoreserver + +import ( + "encoding/json" + "errors" + "time" + "github.com/gorilla/mux" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "strconv" + "strings" +) + +// A Route defines the parameters for an api endpoint +type Route struct { + Method string + Pattern string + HandlerFunc http.HandlerFunc +} + +// Routes is a map of defined api endpoints +type Routes map[string]Route + +// Router defines the required methods for retrieving api routes +type Router interface { + Routes() Routes +} + +const errMsgRequiredMissing = "required parameter is missing" +const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint" +const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint" + +// NewRouter creates a new router for any number of api routers +func NewRouter(routers ...Router) *mux.Router { + router := mux.NewRouter().StrictSlash(true) + for _, api := range routers { + for name, route := range api.Routes() { + var handler http.Handler = route.HandlerFunc + handler = Logger(handler, name) + + router. + Methods(route.Method). + Path(route.Pattern). + Name(name). + Handler(handler) + } + } + + return router +} + +// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code +func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, w http.ResponseWriter) error { + wHeader := w.Header() + for key, values := range headers { + for _, value := range values { + wHeader.Add(key, value) + } + } + + f, ok := i.(*os.File) + if ok { + data, err := io.ReadAll(f) + if err != nil { + return err + } + wHeader.Set("Content-Type", http.DetectContentType(data)) + wHeader.Set("Content-Disposition", "attachment; filename="+f.Name()) + if status != nil { + w.WriteHeader(*status) + } else { + w.WriteHeader(http.StatusOK) + } + _, err = w.Write(data) + return err + } + wHeader.Set("Content-Type", "application/json; charset=UTF-8") + + if status != nil { + w.WriteHeader(*status) + } else { + w.WriteHeader(http.StatusOK) + } + + if i != nil { + return json.NewEncoder(w).Encode(i) + } + + return nil +} + +// ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file +func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error) { + _, fileHeader, err := r.FormFile(key) + if err != nil { + return nil, err + } + + return readFileHeaderToTempFile(fileHeader) +} + +// ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files +func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error) { + if err := r.ParseMultipartForm(32 << 20); err != nil { + return nil, err + } + + files := make([]*os.File, 0, len(r.MultipartForm.File[key])) + + for _, fileHeader := range r.MultipartForm.File[key] { + file, err := readFileHeaderToTempFile(fileHeader) + if err != nil { + return nil, err + } + + files = append(files, file) + } + + return files, nil +} + +// readFileHeaderToTempFile reads multipart.FileHeader and writes it to a temporary file +func readFileHeaderToTempFile(fileHeader *multipart.FileHeader) (*os.File, error) { + formFile, err := fileHeader.Open() + if err != nil { + return nil, err + } + + defer formFile.Close() + + // Use .* as suffix, because the asterisk is a placeholder for the random value, + // and the period allows consumers of this file to remove the suffix to obtain the original file name + file, err := os.CreateTemp("", fileHeader.Filename+".*") + if err != nil { + return nil, err + } + + defer file.Close() + + _, err = io.Copy(file, formFile) + if err != nil { + return nil, err + } + + return file, nil +} + +func parseTimes(param string) ([]time.Time, error) { + splits := strings.Split(param, ",") + times := make([]time.Time, 0, len(splits)) + for _, v := range splits { + t, err := parseTime(v) + if err != nil { + return nil, err + } + times = append(times, t) + } + return times, nil +} + +// parseTime will parses a string parameter into a time.Time using the RFC3339 format +func parseTime(param string) (time.Time, error) { + if param == "" { + return time.Time{}, nil + } + return time.Parse(time.RFC3339, param) +} + +type Number interface { + ~int32 | ~int64 | ~float32 | ~float64 +} + +type ParseString[T Number | string | bool] func(v string) (T, error) + +// parseFloat64 parses a string parameter to an float64. +func parseFloat64(param string) (float64, error) { + if param == "" { + return 0, nil + } + + return strconv.ParseFloat(param, 64) +} + +// parseFloat32 parses a string parameter to an float32. +func parseFloat32(param string) (float32, error) { + if param == "" { + return 0, nil + } + + v, err := strconv.ParseFloat(param, 32) + return float32(v), err +} + +// parseInt64 parses a string parameter to an int64. +func parseInt64(param string) (int64, error) { + if param == "" { + return 0, nil + } + + return strconv.ParseInt(param, 10, 64) +} + +// parseInt32 parses a string parameter to an int32. +func parseInt32(param string) (int32, error) { + if param == "" { + return 0, nil + } + + val, err := strconv.ParseInt(param, 10, 32) + return int32(val), err +} + +// parseBool parses a string parameter to an bool. +func parseBool(param string) (bool, error) { + if param == "" { + return false, nil + } + + return strconv.ParseBool(param) +} + +type Operation[T Number | string | bool] func(actual string) (T, bool, error) + +func WithRequire[T Number | string | bool](parse ParseString[T]) Operation[T] { + var empty T + return func(actual string) (T, bool, error) { + if actual == "" { + return empty, false, errors.New(errMsgRequiredMissing) + } + + v, err := parse(actual) + return v, false, err + } +} + +func WithDefaultOrParse[T Number | string | bool](def T, parse ParseString[T]) Operation[T] { + return func(actual string) (T, bool, error) { + if actual == "" { + return def, true, nil + } + + v, err := parse(actual) + return v, false, err + } +} + +func WithParse[T Number | string | bool](parse ParseString[T]) Operation[T] { + return func(actual string) (T, bool, error) { + v, err := parse(actual) + return v, false, err + } +} + +type Constraint[T Number | string | bool] func(actual T) error + +func WithMinimum[T Number](expected T) Constraint[T] { + return func(actual T) error { + if actual < expected { + return errors.New(errMsgMinValueConstraint) + } + + return nil + } +} + +func WithMaximum[T Number](expected T) Constraint[T] { + return func(actual T) error { + if actual > expected { + return errors.New(errMsgMaxValueConstraint) + } + + return nil + } +} + +// parseNumericParameter parses a numeric parameter to its respective type. +func parseNumericParameter[T Number](param string, fn Operation[T], checks ...Constraint[T]) (T, error) { + v, ok, err := fn(param) + if err != nil { + return 0, err + } + + if !ok { + for _, check := range checks { + if err := check(v); err != nil { + return 0, err + } + } + } + + return v, nil +} + +// parseBoolParameter parses a string parameter to a bool +func parseBoolParameter(param string, fn Operation[bool]) (bool, error) { + v, _, err := fn(param) + return v, err +} + +// parseNumericArrayParameter parses a string parameter containing array of values to its respective type. +func parseNumericArrayParameter[T Number](param, delim string, required bool, fn Operation[T], checks ...Constraint[T]) ([]T, error) { + if param == "" { + if required { + return nil, errors.New(errMsgRequiredMissing) + } + + return nil, nil + } + + str := strings.Split(param, delim) + values := make([]T, len(str)) + + for i, s := range str { + v, ok, err := fn(s) + if err != nil { + return nil, err + } + + if !ok { + for _, check := range checks { + if err := check(v); err != nil { + return nil, err + } + } + } + + values[i] = v + } + + return values, nil +} + + +// parseQuery parses query parameters and returns an error if any malformed value pairs are encountered. +func parseQuery(rawQuery string) (url.Values, error) { + return url.ParseQuery(rawQuery) +} \ No newline at end of file diff --git a/samples/server/others/go-server/no-body-path-params/main.go b/samples/server/others/go-server/no-body-path-params/main.go new file mode 100644 index 00000000000..cdd7b015aaf --- /dev/null +++ b/samples/server/others/go-server/no-body-path-params/main.go @@ -0,0 +1,38 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +/* + * Simple no path and body param spec + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * API version: 1.0.0 + */ + +package main + +import ( + "log" + "net/http" + + petstoreserver "github.com/GIT_USER_ID/GIT_REPO_ID/go" +) + +func main() { + log.Printf("Server started") + + BodyAPIService := petstoreserver.NewBodyAPIService() + BodyAPIController := petstoreserver.NewBodyAPIController(BodyAPIService) + + BothAPIService := petstoreserver.NewBothAPIService() + BothAPIController := petstoreserver.NewBothAPIController(BothAPIService) + + NoneAPIService := petstoreserver.NewNoneAPIService() + NoneAPIController := petstoreserver.NewNoneAPIController(NoneAPIService) + + PathAPIService := petstoreserver.NewPathAPIService() + PathAPIController := petstoreserver.NewPathAPIController(PathAPIService) + + router := petstoreserver.NewRouter(BodyAPIController, BothAPIController, NoneAPIController, PathAPIController) + + log.Fatal(http.ListenAndServe(":8080", router)) +} diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Order.cs index 5da36e6f1fd..5076e34732a 100644 --- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Order.cs index 5da36e6f1fd..5076e34732a 100644 --- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Order.cs index 5da36e6f1fd..5076e34732a 100644 --- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs index b7385cfe794..cbf41566ae1 100644 --- a/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -194,7 +194,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs index 9c63ce71286..626ad7c4e84 100644 --- a/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime? ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs index e45bab015c4..7a68506eaa4 100644 --- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Order.cs index 5da36e6f1fd..5076e34732a 100644 --- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs index 8b2c83a9c01..5b3d6c1aaac 100644 --- a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs index 5da36e6f1fd..5076e34732a 100644 --- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Order.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Models /// /// Gets or Sets ShipDate /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] + [DataMember(Name="shipDate", EmitDefaultValue=true)] public DateTime ShipDate { get; set; } @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs index e9013f0ed0d..c570b90ac84 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs @@ -159,7 +159,7 @@ namespace Org.OpenAPITools.Models ) && ( ShipDate == other.ShipDate || - ShipDate != null && + ShipDate.Equals(other.ShipDate) ) && ( @@ -190,7 +190,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + PetId.GetHashCode(); hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); diff --git a/samples/server/petstore/cpp-pistache-everything/.openapi-generator-ignore b/samples/server/petstore/cpp-pistache-everything/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/cpp-pistache-everything/.openapi-generator/FILES b/samples/server/petstore/cpp-pistache-everything/.openapi-generator/FILES new file mode 100644 index 00000000000..8d2d9fc5243 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/.openapi-generator/FILES @@ -0,0 +1,34 @@ +CMakeLists.txt +README.md +api/ApiBase.h +api/PetApi.cpp +api/PetApi.h +api/StoreApi.cpp +api/StoreApi.h +api/UserApi.cpp +api/UserApi.h +impl/PetApiImpl.cpp +impl/PetApiImpl.h +impl/StoreApiImpl.cpp +impl/StoreApiImpl.h +impl/UserApiImpl.cpp +impl/UserApiImpl.h +main-api-server.cpp +model/ApiResponse.cpp +model/ApiResponse.h +model/Category.cpp +model/Category.h +model/Helpers.cpp +model/Helpers.h +model/Order.cpp +model/Order.h +model/Pet.cpp +model/Pet.h +model/Pet_vaccinationBook.cpp +model/Pet_vaccinationBook.h +model/Tag.cpp +model/Tag.h +model/User.cpp +model/User.h +model/Vaccine.cpp +model/Vaccine.h diff --git a/samples/server/petstore/cpp-pistache-everything/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache-everything/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/cpp-pistache-everything/CMakeLists.txt b/samples/server/petstore/cpp-pistache-everything/CMakeLists.txt new file mode 100644 index 00000000000..23269deb0ff --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required (VERSION 3.2) + +project(api-server) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) + +include(ExternalProject) + +set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) + +ExternalProject_Add(PISTACHE + GIT_REPOSITORY https://github.com/pistacheio/pistache.git + BUILD_IN_SOURCE true + INSTALL_COMMAND meson setup build --prefix=${EXTERNAL_INSTALL_LOCATION} --libdir=lib && meson install -C build +) + +ExternalProject_Add(NLOHMANN + GIT_REPOSITORY https://github.com/nlohmann/json.git + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DJSON_BuildTests=OFF +) + +include_directories(${EXTERNAL_INSTALL_LOCATION}/include) +link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) + +include_directories(model) +include_directories(api) +include_directories(impl) + +file(GLOB SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp +) + +add_executable(${PROJECT_NAME} ${SRCS} ) +add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN) +target_link_libraries(${PROJECT_NAME} pistache pthread) diff --git a/samples/server/petstore/cpp-pistache-everything/README.md b/samples/server/petstore/cpp-pistache-everything/README.md new file mode 100644 index 00000000000..7d4392fde7e --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/README.md @@ -0,0 +1,48 @@ +# REST API Server for OpenAPI Petstore + +## Overview +This API Server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +It uses the [Pistache](https://github.com/oktal/pistache) Framework. + +## Files organization +The Pistache C++ REST server generator creates three folders: +- `api`: This folder contains the handlers for each method specified in the OpenAPI definition. Every handler extracts +the path and body parameters (if any) from the requests and tries to parse and possibly validate them. +Once this step is completed, the main API class calls the corresponding abstract method that should be implemented +by the developer (a basic implementation is provided under the `impl` folder) +- `impl`: As written above, the implementation folder contains, for each API, the corresponding implementation class, +which extends the main API class and implements the abstract methods. +Every method receives the path and body parameters as constant reference variables and a reference to the response +object, that should be filled with the right response and sent at the end of the method with the command: +response.send(returnCode, responseBody, [mimeType]) +- `model`: This folder contains the corresponding class for every object schema found in the OpenAPI specification. + +The main folder contains also a file with a main that can be used to start the server. +Of course, is you should customize this file based on your needs + +## Installation +First of all, you need to download and install the libraries listed [here](#libraries-required). + +Once the libraries are installed, in order to compile and run the server please follow the steps below: +```bash +mkdir build +cd build +cmake .. +make +``` + +Once compiled run the server: + +```bash +cd build +./api-server +``` + +## Libraries required +- [pistache](http://pistache.io/quickstart) +- [JSON for Modern C++](https://github.com/nlohmann/json/#integration): Please download the `json.hpp` file and +put it under the model/nlohmann folder + +## Namespaces +org.openapitools.server.api +org.openapitools.server.model diff --git a/samples/server/petstore/cpp-pistache-everything/api/ApiBase.h b/samples/server/petstore/cpp-pistache-everything/api/ApiBase.h new file mode 100644 index 00000000000..5911d87c2d4 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/ApiBase.h @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * ApiBase.h + * + * Generalization of the Api classes + */ + +#ifndef ApiBase_H_ +#define ApiBase_H_ + +#include +#include + +namespace org::openapitools::server::api +{ + +class ApiBase { +public: + explicit ApiBase(const std::shared_ptr& rtr) : router(rtr) {}; + virtual ~ApiBase() = default; + virtual void init() = 0; + +protected: + const std::shared_ptr router; +}; + +} // namespace org::openapitools::server::api + +#endif /* ApiBase_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/api/PetApi.cpp b/samples/server/petstore/cpp-pistache-everything/api/PetApi.cpp new file mode 100644 index 00000000000..0267ad305ca --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/PetApi.cpp @@ -0,0 +1,284 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "PetApi.h" +#include "Helpers.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::helpers; +using namespace org::openapitools::server::model; + +const std::string PetApi::base = "/v2"; + +PetApi::PetApi(const std::shared_ptr& rtr) + : ApiBase(rtr) +{ +} + +void PetApi::init() { + setupRoutes(); +} + +void PetApi::setupRoutes() { + using namespace Pistache::Rest; + + Routes::Post(*router, base + "/pet", Routes::bind(&PetApi::add_pet_handler, this)); + Routes::Delete(*router, base + "/pet/:petId", Routes::bind(&PetApi::delete_pet_handler, this)); + Routes::Get(*router, base + "/pet/findByStatus", Routes::bind(&PetApi::find_pets_by_status_handler, this)); + Routes::Get(*router, base + "/pet/findByTags", Routes::bind(&PetApi::find_pets_by_tags_handler, this)); + Routes::Get(*router, base + "/pet/:petId", Routes::bind(&PetApi::get_pet_by_id_handler, this)); + Routes::Put(*router, base + "/pet", Routes::bind(&PetApi::update_pet_handler, this)); + Routes::Post(*router, base + "/pet/:petId", Routes::bind(&PetApi::update_pet_with_form_handler, this)); + Routes::Post(*router, base + "/pet/:petId/uploadImage", Routes::bind(&PetApi::upload_file_handler, this)); + + // Default handler, called when a route is not found + router->addCustomHandler(Routes::bind(&PetApi::pet_api_default_handler, this)); +} + +std::pair PetApi::handleParsingException(const std::exception& ex) const noexcept +{ + try { + throw; + } catch (nlohmann::detail::exception &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (org::openapitools::server::helpers::ValidationException &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (std::exception &e) { + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); + } +} + +std::pair PetApi::handleOperationException(const std::exception& ex) const noexcept +{ + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); +} + +void PetApi::add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Pet pet; + + try { + nlohmann::json::parse(request.body()).get_to(pet); + pet.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->add_pet(pet, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::delete_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto petId = request.param(":petId").as(); + + // Getting the header params + auto apiKey = request.headers().tryGetRaw("api_key"); + + try { + this->delete_pet(petId, apiKey, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto statusQuery = request.query().get("status"); + std::optional> status; + if(statusQuery.has_value()){ + std::vector valueQuery_instance; + if(fromStringValue(statusQuery.value(), valueQuery_instance)){ + status = valueQuery_instance; + } + } + + try { + this->find_pets_by_status(status, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto tagsQuery = request.query().get("tags"); + std::optional> tags; + if(tagsQuery.has_value()){ + std::vector valueQuery_instance; + if(fromStringValue(tagsQuery.value(), valueQuery_instance)){ + tags = valueQuery_instance; + } + } + + try { + this->find_pets_by_tags(tags, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::get_pet_by_id_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto petId = request.param(":petId").as(); + + try { + this->get_pet_by_id(petId, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Pet pet; + + try { + nlohmann::json::parse(request.body()).get_to(pet); + pet.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->update_pet(pet, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::update_pet_with_form_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->update_pet_with_form(request, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void PetApi::upload_file_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + try { + this->upload_file(request, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} + +void PetApi::pet_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); +} + +} // namespace org::openapitools::server::api + diff --git a/samples/server/petstore/cpp-pistache-everything/api/PetApi.h b/samples/server/petstore/cpp-pistache-everything/api/PetApi.h new file mode 100644 index 00000000000..5d2d3bc00cb --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/PetApi.h @@ -0,0 +1,143 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * PetApi.h + * + * + */ + +#ifndef PetApi_H_ +#define PetApi_H_ + + +#include "ApiBase.h" + +#include +#include +#include + +#include +#include + +#include "ApiResponse.h" +#include "Pet.h" +#include +#include + +namespace org::openapitools::server::api +{ + +class PetApi : public ApiBase { +public: + explicit PetApi(const std::shared_ptr& rtr); + ~PetApi() override = default; + void init() override; + + static const std::string base; + +private: + void setupRoutes(); + + void add_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void delete_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void find_pets_by_status_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void find_pets_by_tags_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void get_pet_by_id_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void update_pet_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void update_pet_with_form_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void upload_file_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void pet_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + + /// + /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleParsingException(const std::exception& ex) const noexcept; + + /// + /// Helper function to handle unexpected Exceptions during processing of the request in handler functions. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleOperationException(const std::exception& ex) const noexcept; + + /// + /// Add a new pet to the store + /// + /// + /// + /// + /// Pet object that needs to be added to the store + virtual void add_pet(const org::openapitools::server::model::Pet &pet, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Deletes a pet + /// + /// + /// + /// + /// Pet id to delete + /// (optional, default to "") + virtual void delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Finds Pets by status + /// + /// + /// Multiple status values can be provided with comma separated strings + /// + /// Status values that need to be considered for filter + virtual void find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Finds Pets by tags + /// + /// + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// + /// Tags to filter by + virtual void find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Find pet by ID + /// + /// + /// Returns a single pet + /// + /// ID of pet to return + virtual void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Update an existing pet + /// + /// + /// + /// + /// Pet object that needs to be added to the store + virtual void update_pet(const org::openapitools::server::model::Pet &pet, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Updates a pet in the store with form data + /// + /// + /// + /// + virtual void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0; + /// + /// uploads an image + /// + /// + /// + /// + virtual void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0; + +}; + +} // namespace org::openapitools::server::api + +#endif /* PetApi_H_ */ + diff --git a/samples/server/petstore/cpp-pistache-everything/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache-everything/api/StoreApi.cpp new file mode 100644 index 00000000000..522313849b2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/StoreApi.cpp @@ -0,0 +1,166 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApi.h" +#include "Helpers.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::helpers; +using namespace org::openapitools::server::model; + +const std::string StoreApi::base = "/v2"; + +StoreApi::StoreApi(const std::shared_ptr& rtr) + : ApiBase(rtr) +{ +} + +void StoreApi::init() { + setupRoutes(); +} + +void StoreApi::setupRoutes() { + using namespace Pistache::Rest; + + Routes::Delete(*router, base + "/store/order/:orderId", Routes::bind(&StoreApi::delete_order_handler, this)); + Routes::Get(*router, base + "/store/inventory", Routes::bind(&StoreApi::get_inventory_handler, this)); + Routes::Get(*router, base + "/store/order/:orderId", Routes::bind(&StoreApi::get_order_by_id_handler, this)); + Routes::Post(*router, base + "/store/order", Routes::bind(&StoreApi::place_order_handler, this)); + + // Default handler, called when a route is not found + router->addCustomHandler(Routes::bind(&StoreApi::store_api_default_handler, this)); +} + +std::pair StoreApi::handleParsingException(const std::exception& ex) const noexcept +{ + try { + throw; + } catch (nlohmann::detail::exception &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (org::openapitools::server::helpers::ValidationException &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (std::exception &e) { + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); + } +} + +std::pair StoreApi::handleOperationException(const std::exception& ex) const noexcept +{ + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); +} + +void StoreApi::delete_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto orderId = request.param(":orderId").as(); + + try { + this->delete_order(orderId, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void StoreApi::get_inventory_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->get_inventory(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void StoreApi::get_order_by_id_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto orderId = request.param(":orderId").as(); + + try { + this->get_order_by_id(orderId, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + Order order; + + try { + nlohmann::json::parse(request.body()).get_to(order); + order.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->place_order(order, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} + +void StoreApi::store_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); +} + +} // namespace org::openapitools::server::api + diff --git a/samples/server/petstore/cpp-pistache-everything/api/StoreApi.h b/samples/server/petstore/cpp-pistache-everything/api/StoreApi.h new file mode 100644 index 00000000000..69c490d7014 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/StoreApi.h @@ -0,0 +1,106 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * StoreApi.h + * + * + */ + +#ifndef StoreApi_H_ +#define StoreApi_H_ + + +#include "ApiBase.h" + +#include +#include +#include + +#include +#include + +#include "Order.h" +#include +#include + +namespace org::openapitools::server::api +{ + +class StoreApi : public ApiBase { +public: + explicit StoreApi(const std::shared_ptr& rtr); + ~StoreApi() override = default; + void init() override; + + static const std::string base; + +private: + void setupRoutes(); + + void delete_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void get_inventory_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void get_order_by_id_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void place_order_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + + /// + /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleParsingException(const std::exception& ex) const noexcept; + + /// + /// Helper function to handle unexpected Exceptions during processing of the request in handler functions. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleOperationException(const std::exception& ex) const noexcept; + + /// + /// Delete purchase order by ID + /// + /// + /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + /// + /// ID of the order that needs to be deleted + virtual void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Returns pet inventories by status + /// + /// + /// Returns a map of status codes to quantities + /// + virtual void get_inventory(Pistache::Http::ResponseWriter &response) = 0; + /// + /// Find purchase order by ID + /// + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + /// + /// ID of pet that needs to be fetched + virtual void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Place an order for a pet + /// + /// + /// + /// + /// order placed for purchasing the pet + virtual void place_order(const org::openapitools::server::model::Order &order, Pistache::Http::ResponseWriter &response) = 0; + +}; + +} // namespace org::openapitools::server::api + +#endif /* StoreApi_H_ */ + diff --git a/samples/server/petstore/cpp-pistache-everything/api/UserApi.cpp b/samples/server/petstore/cpp-pistache-everything/api/UserApi.cpp new file mode 100644 index 00000000000..92b26089eda --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/UserApi.cpp @@ -0,0 +1,309 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "UserApi.h" +#include "Helpers.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::helpers; +using namespace org::openapitools::server::model; + +const std::string UserApi::base = "/v2"; + +UserApi::UserApi(const std::shared_ptr& rtr) + : ApiBase(rtr) +{ +} + +void UserApi::init() { + setupRoutes(); +} + +void UserApi::setupRoutes() { + using namespace Pistache::Rest; + + Routes::Post(*router, base + "/user", Routes::bind(&UserApi::create_user_handler, this)); + Routes::Post(*router, base + "/user/createWithArray", Routes::bind(&UserApi::create_users_with_array_input_handler, this)); + Routes::Post(*router, base + "/user/createWithList", Routes::bind(&UserApi::create_users_with_list_input_handler, this)); + Routes::Delete(*router, base + "/user/:username", Routes::bind(&UserApi::delete_user_handler, this)); + Routes::Get(*router, base + "/user/:username", Routes::bind(&UserApi::get_user_by_name_handler, this)); + Routes::Get(*router, base + "/user/login", Routes::bind(&UserApi::login_user_handler, this)); + Routes::Get(*router, base + "/user/logout", Routes::bind(&UserApi::logout_user_handler, this)); + Routes::Put(*router, base + "/user/:username", Routes::bind(&UserApi::update_user_handler, this)); + + // Default handler, called when a route is not found + router->addCustomHandler(Routes::bind(&UserApi::user_api_default_handler, this)); +} + +std::pair UserApi::handleParsingException(const std::exception& ex) const noexcept +{ + try { + throw; + } catch (nlohmann::detail::exception &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (org::openapitools::server::helpers::ValidationException &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (std::exception &e) { + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); + } +} + +std::pair UserApi::handleOperationException(const std::exception& ex) const noexcept +{ + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); +} + +void UserApi::create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + + User user; + + try { + nlohmann::json::parse(request.body()).get_to(user); + user.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->create_user(user, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + std::vector user; + + try { + nlohmann::json::parse(request.body()).get_to(user); + for (const auto& validationParam : user) + validationParam.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->create_users_with_array_input(user, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the body param + std::vector user; + + try { + nlohmann::json::parse(request.body()).get_to(user); + for (const auto& validationParam : user) + validationParam.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->create_users_with_list_input(user, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::delete_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto username = request.param(":username").as(); + + try { + this->delete_user(username, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::get_user_by_name_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto username = request.param(":username").as(); + + try { + this->get_user_by_name(username, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + + // Getting the query params + auto usernameQuery = request.query().get("username"); + std::optional username; + if(usernameQuery.has_value()){ + std::string valueQuery_instance; + if(fromStringValue(usernameQuery.value(), valueQuery_instance)){ + username = valueQuery_instance; + } + } + auto passwordQuery = request.query().get("password"); + std::optional password; + if(passwordQuery.has_value()){ + std::string valueQuery_instance; + if(fromStringValue(passwordQuery.value(), valueQuery_instance)){ + password = valueQuery_instance; + } + } + + try { + this->login_user(username, password, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::logout_user_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->logout_user(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} +void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { + try { + + // Getting the path params + auto username = request.param(":username").as(); + + // Getting the body param + + User user; + + try { + nlohmann::json::parse(request.body()).get_to(user); + user.validate(); + } catch (std::exception &e) { + const std::pair errorInfo = this->handleParsingException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + try { + this->update_user(username, user, response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} + +void UserApi::user_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); +} + +} // namespace org::openapitools::server::api + diff --git a/samples/server/petstore/cpp-pistache-everything/api/UserApi.h b/samples/server/petstore/cpp-pistache-everything/api/UserApi.h new file mode 100644 index 00000000000..8ca97145d5b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/api/UserApi.h @@ -0,0 +1,144 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * UserApi.h + * + * + */ + +#ifndef UserApi_H_ +#define UserApi_H_ + + +#include "ApiBase.h" + +#include +#include +#include + +#include +#include + +#include "User.h" +#include +#include + +namespace org::openapitools::server::api +{ + +class UserApi : public ApiBase { +public: + explicit UserApi(const std::shared_ptr& rtr); + ~UserApi() override = default; + void init() override; + + static const std::string base; + +private: + void setupRoutes(); + + void create_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void create_users_with_array_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void create_users_with_list_input_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void delete_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void get_user_by_name_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void login_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void logout_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void update_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void user_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + + /// + /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleParsingException(const std::exception& ex) const noexcept; + + /// + /// Helper function to handle unexpected Exceptions during processing of the request in handler functions. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleOperationException(const std::exception& ex) const noexcept; + + /// + /// Create user + /// + /// + /// This can only be done by the logged in user. + /// + /// Created user object + virtual void create_user(const org::openapitools::server::model::User &user, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + virtual void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Creates list of users with given input array + /// + /// + /// + /// + /// List of user object + virtual void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Delete user + /// + /// + /// This can only be done by the logged in user. + /// + /// The name that needs to be deleted + virtual void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Get user by user name + /// + /// + /// + /// + /// The name that needs to be fetched. Use user1 for testing. + virtual void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Logs user into the system + /// + /// + /// + /// + /// The user name for login + /// The password for login in clear text + virtual void login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response) = 0; + /// + /// Logs out current logged in user session + /// + /// + /// + /// + virtual void logout_user(Pistache::Http::ResponseWriter &response) = 0; + /// + /// Updated user + /// + /// + /// This can only be done by the logged in user. + /// + /// name that need to be deleted + /// Updated user object + virtual void update_user(const std::string &username, const org::openapitools::server::model::User &user, Pistache::Http::ResponseWriter &response) = 0; + +}; + +} // namespace org::openapitools::server::api + +#endif /* UserApi_H_ */ + diff --git a/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.cpp b/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.cpp new file mode 100644 index 00000000000..9841c6d2454 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.cpp @@ -0,0 +1,56 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "PetApiImpl.h" + +namespace org { +namespace openapitools { +namespace server { +namespace api { + +using namespace org::openapitools::server::model; + +PetApiImpl::PetApiImpl(const std::shared_ptr& rtr) + : PetApi(rtr) +{ +} + +void PetApiImpl::add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){ + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void PetApiImpl::upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response){ + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.h b/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.h new file mode 100644 index 00000000000..07eb6101e2f --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/PetApiImpl.h @@ -0,0 +1,62 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +/* +* PetApiImpl.h +* +* +*/ + +#ifndef PET_API_IMPL_H_ +#define PET_API_IMPL_H_ + + +#include +#include +#include +#include +#include + +#include + + +#include "ApiResponse.h" +#include "Pet.h" +#include +#include + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::model; + +class PetApiImpl : public org::openapitools::server::api::PetApi { +public: + explicit PetApiImpl(const std::shared_ptr& rtr); + ~PetApiImpl() override = default; + + void add_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); + void delete_pet(const int64_t &petId, const std::optional &apiKey, Pistache::Http::ResponseWriter &response); + void find_pets_by_status(const std::optional> &status, Pistache::Http::ResponseWriter &response); + void find_pets_by_tags(const std::optional> &tags, Pistache::Http::ResponseWriter &response); + void get_pet_by_id(const int64_t &petId, Pistache::Http::ResponseWriter &response); + void update_pet(const Pet &pet, Pistache::Http::ResponseWriter &response); + void update_pet_with_form(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); + void upload_file(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response); + +}; + +} // namespace org::openapitools::server::api + + + +#endif diff --git a/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.cpp b/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.cpp new file mode 100644 index 00000000000..f36debfb4c3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.cpp @@ -0,0 +1,44 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApiImpl.h" + +namespace org { +namespace openapitools { +namespace server { +namespace api { + +using namespace org::openapitools::server::model; + +StoreApiImpl::StoreApiImpl(const std::shared_ptr& rtr) + : StoreApi(rtr) +{ +} + +void StoreApiImpl::delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void StoreApiImpl::get_inventory(Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void StoreApiImpl::get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void StoreApiImpl::place_order(const Order &order, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.h new file mode 100644 index 00000000000..fd654ae9e1b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/StoreApiImpl.h @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +/* +* StoreApiImpl.h +* +* +*/ + +#ifndef STORE_API_IMPL_H_ +#define STORE_API_IMPL_H_ + + +#include +#include +#include +#include +#include + +#include + + +#include "Order.h" +#include +#include + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::model; + +class StoreApiImpl : public org::openapitools::server::api::StoreApi { +public: + explicit StoreApiImpl(const std::shared_ptr& rtr); + ~StoreApiImpl() override = default; + + void delete_order(const std::string &orderId, Pistache::Http::ResponseWriter &response); + void get_inventory(Pistache::Http::ResponseWriter &response); + void get_order_by_id(const int64_t &orderId, Pistache::Http::ResponseWriter &response); + void place_order(const Order &order, Pistache::Http::ResponseWriter &response); + +}; + +} // namespace org::openapitools::server::api + + + +#endif diff --git a/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.cpp b/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.cpp new file mode 100644 index 00000000000..97a3b845120 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.cpp @@ -0,0 +1,56 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "UserApiImpl.h" + +namespace org { +namespace openapitools { +namespace server { +namespace api { + +using namespace org::openapitools::server::model; + +UserApiImpl::UserApiImpl(const std::shared_ptr& rtr) + : UserApi(rtr) +{ +} + +void UserApiImpl::create_user(const User &user, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::delete_user(const std::string &username, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::logout_user(Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} +void UserApiImpl::update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.h b/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.h new file mode 100644 index 00000000000..c0d3ea27617 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/impl/UserApiImpl.h @@ -0,0 +1,61 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +/* +* UserApiImpl.h +* +* +*/ + +#ifndef USER_API_IMPL_H_ +#define USER_API_IMPL_H_ + + +#include +#include +#include +#include +#include + +#include + + +#include "User.h" +#include +#include + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::model; + +class UserApiImpl : public org::openapitools::server::api::UserApi { +public: + explicit UserApiImpl(const std::shared_ptr& rtr); + ~UserApiImpl() override = default; + + void create_user(const User &user, Pistache::Http::ResponseWriter &response); + void create_users_with_array_input(const std::vector &user, Pistache::Http::ResponseWriter &response); + void create_users_with_list_input(const std::vector &user, Pistache::Http::ResponseWriter &response); + void delete_user(const std::string &username, Pistache::Http::ResponseWriter &response); + void get_user_by_name(const std::string &username, Pistache::Http::ResponseWriter &response); + void login_user(const std::optional &username, const std::optional &password, Pistache::Http::ResponseWriter &response); + void logout_user(Pistache::Http::ResponseWriter &response); + void update_user(const std::string &username, const User &user, Pistache::Http::ResponseWriter &response); + +}; + +} // namespace org::openapitools::server::api + + + +#endif diff --git a/samples/server/petstore/cpp-pistache-everything/main-api-server.cpp b/samples/server/petstore/cpp-pistache-everything/main-api-server.cpp new file mode 100644 index 00000000000..167176c3399 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/main-api-server.cpp @@ -0,0 +1,97 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "pistache/endpoint.h" +#include "pistache/http.h" +#include "pistache/router.h" +#ifdef __linux__ +#include +#include +#include +#endif + +#include "ApiBase.h" + +#include "PetApiImpl.h" +#include "StoreApiImpl.h" +#include "UserApiImpl.h" + +#define PISTACHE_SERVER_THREADS 2 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 + +static Pistache::Http::Endpoint *httpEndpoint; +#ifdef __linux__ +static void sigHandler [[noreturn]] (int sig){ + switch(sig){ + case SIGINT: + case SIGQUIT: + case SIGTERM: + case SIGHUP: + default: + httpEndpoint->shutdown(); + break; + } + exit(0); +} + +static void setUpUnixSignals(std::vector quitSignals) { + sigset_t blocking_mask; + sigemptyset(&blocking_mask); + for (auto sig : quitSignals) + sigaddset(&blocking_mask, sig); + + struct sigaction sa; + sa.sa_handler = sigHandler; + sa.sa_mask = blocking_mask; + sa.sa_flags = 0; + + for (auto sig : quitSignals) + sigaction(sig, &sa, nullptr); +} +#endif + +using namespace org::openapitools::server::api; + +int main() { +#ifdef __linux__ + std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; + setUpUnixSignals(sigs); +#endif + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(8080)); + + httpEndpoint = new Pistache::Http::Endpoint((addr)); + auto router = std::make_shared(); + + auto opts = Pistache::Http::Endpoint::options() + .threads(PISTACHE_SERVER_THREADS); + opts.flags(Pistache::Tcp::Options::ReuseAddr); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); + httpEndpoint->init(opts); + + auto apiImpls = std::vector>(); + + apiImpls.push_back(std::make_shared(router)); + apiImpls.push_back(std::make_shared(router)); + apiImpls.push_back(std::make_shared(router)); + + for (auto api : apiImpls) { + api->init(); + } + + httpEndpoint->setHandler(router->handler()); + httpEndpoint->serve(); + + httpEndpoint->shutdown(); +} diff --git a/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.cpp b/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.cpp new file mode 100644 index 00000000000..1513f3f34ad --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.cpp @@ -0,0 +1,164 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "ApiResponse.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +ApiResponse::ApiResponse() +{ + m_Code = 0; + m_CodeIsSet = false; + m_Type = ""; + m_TypeIsSet = false; + m_Message = ""; + m_MessageIsSet = false; + +} + +void ApiResponse::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool ApiResponse::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool ApiResponse::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "ApiResponse" : pathPrefix; + + + return success; +} + +bool ApiResponse::operator==(const ApiResponse& rhs) const +{ + return + + + + ((!codeIsSet() && !rhs.codeIsSet()) || (codeIsSet() && rhs.codeIsSet() && getCode() == rhs.getCode())) && + + + ((!typeIsSet() && !rhs.typeIsSet()) || (typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType())) && + + + ((!messageIsSet() && !rhs.messageIsSet()) || (messageIsSet() && rhs.messageIsSet() && getMessage() == rhs.getMessage())) + + ; +} + +bool ApiResponse::operator!=(const ApiResponse& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const ApiResponse& o) +{ + j = nlohmann::json::object(); + if(o.codeIsSet()) + j["code"] = o.m_Code; + if(o.typeIsSet()) + j["type"] = o.m_Type; + if(o.messageIsSet()) + j["message"] = o.m_Message; + +} + +void from_json(const nlohmann::json& j, ApiResponse& o) +{ + if(j.find("code") != j.end()) + { + j.at("code").get_to(o.m_Code); + o.m_CodeIsSet = true; + } + if(j.find("type") != j.end()) + { + j.at("type").get_to(o.m_Type); + o.m_TypeIsSet = true; + } + if(j.find("message") != j.end()) + { + j.at("message").get_to(o.m_Message); + o.m_MessageIsSet = true; + } + +} + +int32_t ApiResponse::getCode() const +{ + return m_Code; +} +void ApiResponse::setCode(int32_t const value) +{ + m_Code = value; + m_CodeIsSet = true; +} +bool ApiResponse::codeIsSet() const +{ + return m_CodeIsSet; +} +void ApiResponse::unsetCode() +{ + m_CodeIsSet = false; +} +std::string ApiResponse::getType() const +{ + return m_Type; +} +void ApiResponse::setType(std::string const& value) +{ + m_Type = value; + m_TypeIsSet = true; +} +bool ApiResponse::typeIsSet() const +{ + return m_TypeIsSet; +} +void ApiResponse::unsetType() +{ + m_TypeIsSet = false; +} +std::string ApiResponse::getMessage() const +{ + return m_Message; +} +void ApiResponse::setMessage(std::string const& value) +{ + m_Message = value; + m_MessageIsSet = true; +} +bool ApiResponse::messageIsSet() const +{ + return m_MessageIsSet; +} +void ApiResponse::unsetMessage() +{ + m_MessageIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.h b/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.h new file mode 100644 index 00000000000..1daca218408 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/ApiResponse.h @@ -0,0 +1,97 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * ApiResponse.h + * + * Describes the result of uploading an image resource + */ + +#ifndef ApiResponse_H_ +#define ApiResponse_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// Describes the result of uploading an image resource +/// +class ApiResponse +{ +public: + ApiResponse(); + virtual ~ApiResponse() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const ApiResponse& rhs) const; + bool operator!=(const ApiResponse& rhs) const; + + ///////////////////////////////////////////// + /// ApiResponse members + + /// + /// + /// + int32_t getCode() const; + void setCode(int32_t const value); + bool codeIsSet() const; + void unsetCode(); + /// + /// + /// + std::string getType() const; + void setType(std::string const& value); + bool typeIsSet() const; + void unsetType(); + /// + /// + /// + std::string getMessage() const; + void setMessage(std::string const& value); + bool messageIsSet() const; + void unsetMessage(); + + friend void to_json(nlohmann::json& j, const ApiResponse& o); + friend void from_json(const nlohmann::json& j, ApiResponse& o); +protected: + int32_t m_Code; + bool m_CodeIsSet; + std::string m_Type; + bool m_TypeIsSet; + std::string m_Message; + bool m_MessageIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* ApiResponse_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Category.cpp b/samples/server/petstore/cpp-pistache-everything/model/Category.cpp new file mode 100644 index 00000000000..bd76b4cd663 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Category.cpp @@ -0,0 +1,144 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Category.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Category::Category() +{ + m_Id = 0L; + m_IdIsSet = false; + m_Name = ""; + m_NameIsSet = false; + +} + +void Category::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Category::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Category::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Category" : pathPrefix; + + + if (nameIsSet()) + { + const std::string& value = m_Name; + const std::string currentValuePath = _pathPrefix + ".name"; + + + + } + + return success; +} + +bool Category::operator==(const Category& rhs) const +{ + return + + + + ((!idIsSet() && !rhs.idIsSet()) || (idIsSet() && rhs.idIsSet() && getId() == rhs.getId())) && + + + ((!nameIsSet() && !rhs.nameIsSet()) || (nameIsSet() && rhs.nameIsSet() && getName() == rhs.getName())) + + ; +} + +bool Category::operator!=(const Category& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Category& o) +{ + j = nlohmann::json::object(); + if(o.idIsSet()) + j["id"] = o.m_Id; + if(o.nameIsSet()) + j["name"] = o.m_Name; + +} + +void from_json(const nlohmann::json& j, Category& o) +{ + if(j.find("id") != j.end()) + { + j.at("id").get_to(o.m_Id); + o.m_IdIsSet = true; + } + if(j.find("name") != j.end()) + { + j.at("name").get_to(o.m_Name); + o.m_NameIsSet = true; + } + +} + +int64_t Category::getId() const +{ + return m_Id; +} +void Category::setId(int64_t const value) +{ + m_Id = value; + m_IdIsSet = true; +} +bool Category::idIsSet() const +{ + return m_IdIsSet; +} +void Category::unsetId() +{ + m_IdIsSet = false; +} +std::string Category::getName() const +{ + return m_Name; +} +void Category::setName(std::string const& value) +{ + m_Name = value; + m_NameIsSet = true; +} +bool Category::nameIsSet() const +{ + return m_NameIsSet; +} +void Category::unsetName() +{ + m_NameIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Category.h b/samples/server/petstore/cpp-pistache-everything/model/Category.h new file mode 100644 index 00000000000..1e083c8ae3e --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Category.h @@ -0,0 +1,88 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Category.h + * + * A category for a pet + */ + +#ifndef Category_H_ +#define Category_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// A category for a pet +/// +class Category +{ +public: + Category(); + virtual ~Category() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Category& rhs) const; + bool operator!=(const Category& rhs) const; + + ///////////////////////////////////////////// + /// Category members + + /// + /// + /// + int64_t getId() const; + void setId(int64_t const value); + bool idIsSet() const; + void unsetId(); + /// + /// + /// + std::string getName() const; + void setName(std::string const& value); + bool nameIsSet() const; + void unsetName(); + + friend void to_json(nlohmann::json& j, const Category& o); + friend void from_json(const nlohmann::json& j, Category& o); +protected: + int64_t m_Id; + bool m_IdIsSet; + std::string m_Name; + bool m_NameIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Category_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Helpers.cpp b/samples/server/petstore/cpp-pistache-everything/model/Helpers.cpp new file mode 100644 index 00000000000..f78e0a1b40a --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Helpers.cpp @@ -0,0 +1,148 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +#include "Helpers.h" +#include + +namespace org::openapitools::server::helpers +{ + +const std::regex regexRfc3339_date(R"(^(\d{4})\-(\d{2})\-(\d{2})$)"); +const std::regex regexRfc3339_date_time( + R"(^(\d{4})\-(\d{2})\-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|([\+\-])(\d{2}):(\d{2}))$)" +); + + +namespace +{ + // Determine if given year is a leap year + // See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C + bool isLeapYear(const uint16_t year) { + return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); + } + + bool validateDateValues(const uint16_t year, const uint16_t month, const uint16_t day) { + return !( + (month == 0 || month > 12) + || (day == 0) + || (month == 2 && day > (28 + (isLeapYear(year) ? 1 : 0))) + || (month <= 7 && day > (30 + month % 2)) + || (month >= 8 && day > (31 - month % 2)) + ); + } + + bool validateTimeValues(const uint16_t hours, const uint16_t minutes, const uint16_t seconds) { + return (hours <= 23) && (minutes <= 59) && (seconds <= 60); + } +} + +bool validateRfc3339_date(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date); + return found && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))); +} + +bool validateRfc3339_date_time(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date_time); + return found + && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))) + && validateTimeValues(static_cast(std::stoi(match[4])), + static_cast(std::stoi(match[5])), + static_cast(std::stoi(match[6]))); +} + +std::string toStringValue(const std::string &value){ + return std::string(value); +} + +std::string toStringValue(const int32_t value){ + return std::to_string(value); +} + +std::string toStringValue(const int64_t value){ + return std::to_string(value); +} + +std::string toStringValue(const bool value){ + return value ? std::string("true") : std::string("false"); +} + +std::string toStringValue(const float value){ + return std::to_string(value); +} + +std::string toStringValue(const double value){ + return std::to_string(value); +} + +bool fromStringValue(const std::string &inStr, std::string &value){ + value = std::string(inStr); + return true; +} + +bool fromStringValue(const std::string &inStr, int32_t &value){ + try { + value = std::stoi( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, int64_t &value){ + try { + value = std::stol( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, bool &value){ + if (inStr == "true") { + value = true; + return true; + } + if (inStr == "false") { + value = false; + return true; + } + return false; +} + +bool fromStringValue(const std::string &inStr, float &value){ + try { + value = std::stof( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, double &value){ + try { + value = std::stod( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +} // namespace org::openapitools::server::helpers diff --git a/samples/server/petstore/cpp-pistache-everything/model/Helpers.h b/samples/server/petstore/cpp-pistache-everything/model/Helpers.h new file mode 100644 index 00000000000..832ac04c98e --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Helpers.h @@ -0,0 +1,146 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Helpers.h + * + * This is the helper class for models and primitives + */ + +#ifndef Helpers_H_ +#define Helpers_H_ + +#include +#include +#include +#include +#include +#include + +namespace org::openapitools::server::helpers +{ + + class ValidationException : public std::runtime_error + { + public: + explicit ValidationException(const std::string& what) + : std::runtime_error(what) + { } + ~ValidationException() override = default; + }; + + /// + /// Validate a string against the full-date definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date(const std::string& str); + + /// + /// Validate a string against the date-time definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date_time(const std::string& str); + + namespace sfinae_helpers + { + struct NoType {}; + template NoType operator==(const T1&, const T2&); + + template class EqualsOperatorAvailable + { + public: + enum + { + value = !std::is_same< decltype(std::declval() == std::declval()), NoType >::value + }; + }; + } // namespace sfinae_helpers + + + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::vector& vec) + { + static_assert(sfinae_helpers::EqualsOperatorAvailable::value, + "hasOnlyUniqueItems cannot be called, passed template type does not provide == operator."); + if (vec.size() <= 1) + { + return true; + } + // Compare every element of vec to every other element of vec. + // This isn't an elegant way to do this, since it's O(n^2), + // but it's the best solution working only with the == operator. + // This could be greatly improved if our models provided a valid hash + // and/or the < operator + for (size_t i = 0; i < vec.size() - 1; i++) + { + for (size_t j = i + 1; j < vec.size(); j++) + { + if (vec[i] == vec[j]) + { + return false; + } + } + } + return true; + } + + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::set& set) + { + return true; + } + + std::string toStringValue(const std::string &value); + std::string toStringValue(const int32_t value); + std::string toStringValue(const int64_t value); + std::string toStringValue(const bool value); + std::string toStringValue(const float value); + std::string toStringValue(const double value); + + bool fromStringValue(const std::string &inStr, std::string &value); + bool fromStringValue(const std::string &inStr, int32_t &value); + bool fromStringValue(const std::string &inStr, int64_t &value); + bool fromStringValue(const std::string &inStr, bool &value); + bool fromStringValue(const std::string &inStr, float &value); + bool fromStringValue(const std::string &inStr, double &value); + template + bool fromStringValue(const std::vector &inStr, std::vector &value){ + try{ + for(auto & item : inStr){ + T itemValue; + if(fromStringValue(item, itemValue)){ + value.push_back(itemValue); + } + } + } + catch(...){ + return false; + } + return value.size() > 0; + } + template + bool fromStringValue(const std::string &inStr, std::vector &value, char separator = ','){ + std::vector inStrings; + std::istringstream f(inStr); + std::string s; + while (std::getline(f, s, separator)) { + inStrings.push_back(s); + } + return fromStringValue(inStrings, value); + } + +} // namespace org::openapitools::server::helpers + +#endif // Helpers_H_ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Order.cpp b/samples/server/petstore/cpp-pistache-everything/model/Order.cpp new file mode 100644 index 00000000000..459d6ee5d69 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Order.cpp @@ -0,0 +1,251 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Order.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Order::Order() +{ + m_Id = 0L; + m_IdIsSet = false; + m_PetId = 0L; + m_PetIdIsSet = false; + m_Quantity = 0; + m_QuantityIsSet = false; + m_ShipDate = ""; + m_ShipDateIsSet = false; + m_Status = ""; + m_StatusIsSet = false; + m_Complete = false; + m_CompleteIsSet = false; + +} + +void Order::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Order::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Order::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Order" : pathPrefix; + + + return success; +} + +bool Order::operator==(const Order& rhs) const +{ + return + + + + ((!idIsSet() && !rhs.idIsSet()) || (idIsSet() && rhs.idIsSet() && getId() == rhs.getId())) && + + + ((!petIdIsSet() && !rhs.petIdIsSet()) || (petIdIsSet() && rhs.petIdIsSet() && getPetId() == rhs.getPetId())) && + + + ((!quantityIsSet() && !rhs.quantityIsSet()) || (quantityIsSet() && rhs.quantityIsSet() && getQuantity() == rhs.getQuantity())) && + + + ((!shipDateIsSet() && !rhs.shipDateIsSet()) || (shipDateIsSet() && rhs.shipDateIsSet() && getShipDate() == rhs.getShipDate())) && + + + ((!statusIsSet() && !rhs.statusIsSet()) || (statusIsSet() && rhs.statusIsSet() && getStatus() == rhs.getStatus())) && + + + ((!completeIsSet() && !rhs.completeIsSet()) || (completeIsSet() && rhs.completeIsSet() && isComplete() == rhs.isComplete())) + + ; +} + +bool Order::operator!=(const Order& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Order& o) +{ + j = nlohmann::json::object(); + if(o.idIsSet()) + j["id"] = o.m_Id; + if(o.petIdIsSet()) + j["petId"] = o.m_PetId; + if(o.quantityIsSet()) + j["quantity"] = o.m_Quantity; + if(o.shipDateIsSet()) + j["shipDate"] = o.m_ShipDate; + if(o.statusIsSet()) + j["status"] = o.m_Status; + if(o.completeIsSet()) + j["complete"] = o.m_Complete; + +} + +void from_json(const nlohmann::json& j, Order& o) +{ + if(j.find("id") != j.end()) + { + j.at("id").get_to(o.m_Id); + o.m_IdIsSet = true; + } + if(j.find("petId") != j.end()) + { + j.at("petId").get_to(o.m_PetId); + o.m_PetIdIsSet = true; + } + if(j.find("quantity") != j.end()) + { + j.at("quantity").get_to(o.m_Quantity); + o.m_QuantityIsSet = true; + } + if(j.find("shipDate") != j.end()) + { + j.at("shipDate").get_to(o.m_ShipDate); + o.m_ShipDateIsSet = true; + } + if(j.find("status") != j.end()) + { + j.at("status").get_to(o.m_Status); + o.m_StatusIsSet = true; + } + if(j.find("complete") != j.end()) + { + j.at("complete").get_to(o.m_Complete); + o.m_CompleteIsSet = true; + } + +} + +int64_t Order::getId() const +{ + return m_Id; +} +void Order::setId(int64_t const value) +{ + m_Id = value; + m_IdIsSet = true; +} +bool Order::idIsSet() const +{ + return m_IdIsSet; +} +void Order::unsetId() +{ + m_IdIsSet = false; +} +int64_t Order::getPetId() const +{ + return m_PetId; +} +void Order::setPetId(int64_t const value) +{ + m_PetId = value; + m_PetIdIsSet = true; +} +bool Order::petIdIsSet() const +{ + return m_PetIdIsSet; +} +void Order::unsetPetId() +{ + m_PetIdIsSet = false; +} +int32_t Order::getQuantity() const +{ + return m_Quantity; +} +void Order::setQuantity(int32_t const value) +{ + m_Quantity = value; + m_QuantityIsSet = true; +} +bool Order::quantityIsSet() const +{ + return m_QuantityIsSet; +} +void Order::unsetQuantity() +{ + m_QuantityIsSet = false; +} +std::string Order::getShipDate() const +{ + return m_ShipDate; +} +void Order::setShipDate(std::string const& value) +{ + m_ShipDate = value; + m_ShipDateIsSet = true; +} +bool Order::shipDateIsSet() const +{ + return m_ShipDateIsSet; +} +void Order::unsetShipDate() +{ + m_ShipDateIsSet = false; +} +std::string Order::getStatus() const +{ + return m_Status; +} +void Order::setStatus(std::string const& value) +{ + m_Status = value; + m_StatusIsSet = true; +} +bool Order::statusIsSet() const +{ + return m_StatusIsSet; +} +void Order::unsetStatus() +{ + m_StatusIsSet = false; +} +bool Order::isComplete() const +{ + return m_Complete; +} +void Order::setComplete(bool const value) +{ + m_Complete = value; + m_CompleteIsSet = true; +} +bool Order::completeIsSet() const +{ + return m_CompleteIsSet; +} +void Order::unsetComplete() +{ + m_CompleteIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Order.h b/samples/server/petstore/cpp-pistache-everything/model/Order.h new file mode 100644 index 00000000000..78a6c8805bb --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Order.h @@ -0,0 +1,124 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Order.h + * + * An order for a pets from the pet store + */ + +#ifndef Order_H_ +#define Order_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// An order for a pets from the pet store +/// +class Order +{ +public: + Order(); + virtual ~Order() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Order& rhs) const; + bool operator!=(const Order& rhs) const; + + ///////////////////////////////////////////// + /// Order members + + /// + /// + /// + int64_t getId() const; + void setId(int64_t const value); + bool idIsSet() const; + void unsetId(); + /// + /// + /// + int64_t getPetId() const; + void setPetId(int64_t const value); + bool petIdIsSet() const; + void unsetPetId(); + /// + /// + /// + int32_t getQuantity() const; + void setQuantity(int32_t const value); + bool quantityIsSet() const; + void unsetQuantity(); + /// + /// + /// + std::string getShipDate() const; + void setShipDate(std::string const& value); + bool shipDateIsSet() const; + void unsetShipDate(); + /// + /// Order Status + /// + std::string getStatus() const; + void setStatus(std::string const& value); + bool statusIsSet() const; + void unsetStatus(); + /// + /// + /// + bool isComplete() const; + void setComplete(bool const value); + bool completeIsSet() const; + void unsetComplete(); + + friend void to_json(nlohmann::json& j, const Order& o); + friend void from_json(const nlohmann::json& j, Order& o); +protected: + int64_t m_Id; + bool m_IdIsSet; + int64_t m_PetId; + bool m_PetIdIsSet; + int32_t m_Quantity; + bool m_QuantityIsSet; + std::string m_ShipDate; + bool m_ShipDateIsSet; + std::string m_Status; + bool m_StatusIsSet; + bool m_Complete; + bool m_CompleteIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Order_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet.cpp b/samples/server/petstore/cpp-pistache-everything/model/Pet.cpp new file mode 100644 index 00000000000..e1bc313982b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet.cpp @@ -0,0 +1,419 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Pet.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Pet::Pet() +{ + m_Id = 0L; + m_IdIsSet = false; + m_CategoryIsSet = false; + m_Name = ""; + m_TagsIsSet = false; + m_Status = ""; + m_StatusIsSet = false; + m_VeterinarianVisitIsSet = false; + m_GoodiesIsSet = false; + m_CertificatesIsSet = false; + m_VaccinationBookIsSet = false; + +} + +void Pet::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Pet::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Pet::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Pet" : pathPrefix; + + + + /* PhotoUrls */ { + const std::vector& value = m_PhotoUrls; + const std::string currentValuePath = _pathPrefix + ".photoUrls"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const std::string& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + if (tagsIsSet()) + { + const std::vector& value = m_Tags; + const std::string currentValuePath = _pathPrefix + ".tags"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const org::openapitools::server::model::Tag& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + success = value.validate(msg, currentValuePath + ".tags") && success; + + i++; + } + } + + } + + if (goodiesIsSet()) + { + const std::vector& value = m_Goodies; + const std::string currentValuePath = _pathPrefix + ".goodies"; + + + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const nlohmann::json& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + if (certificatesIsSet()) + { + const std::set& value = m_Certificates; + const std::string currentValuePath = _pathPrefix + ".certificates"; + + + if (!org::openapitools::server::helpers::hasOnlyUniqueItems(value)) + { + success = false; + msg << currentValuePath << ": may not contain the same item more than once;"; + } + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const std::string& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + return success; +} + +bool Pet::operator==(const Pet& rhs) const +{ + return + + + + ((!idIsSet() && !rhs.idIsSet()) || (idIsSet() && rhs.idIsSet() && getId() == rhs.getId())) && + + + ((!categoryIsSet() && !rhs.categoryIsSet()) || (categoryIsSet() && rhs.categoryIsSet() && getCategory() == rhs.getCategory())) && + + (getName() == rhs.getName()) + && + + (getPhotoUrls() == rhs.getPhotoUrls()) + && + + + ((!tagsIsSet() && !rhs.tagsIsSet()) || (tagsIsSet() && rhs.tagsIsSet() && getTags() == rhs.getTags())) && + + + ((!statusIsSet() && !rhs.statusIsSet()) || (statusIsSet() && rhs.statusIsSet() && getStatus() == rhs.getStatus())) && + + + ((!veterinarianVisitIsSet() && !rhs.veterinarianVisitIsSet()) || (veterinarianVisitIsSet() && rhs.veterinarianVisitIsSet() && getVeterinarianVisit() == rhs.getVeterinarianVisit())) && + + + ((!goodiesIsSet() && !rhs.goodiesIsSet()) || (goodiesIsSet() && rhs.goodiesIsSet() && getGoodies() == rhs.getGoodies())) && + + + ((!certificatesIsSet() && !rhs.certificatesIsSet()) || (certificatesIsSet() && rhs.certificatesIsSet() && getCertificates() == rhs.getCertificates())) && + + + ((!vaccinationBookIsSet() && !rhs.vaccinationBookIsSet()) || (vaccinationBookIsSet() && rhs.vaccinationBookIsSet() && getVaccinationBook() == rhs.getVaccinationBook())) + + ; +} + +bool Pet::operator!=(const Pet& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Pet& o) +{ + j = nlohmann::json::object(); + if(o.idIsSet()) + j["id"] = o.m_Id; + if(o.categoryIsSet()) + j["category"] = o.m_Category; + j["name"] = o.m_Name; + j["photoUrls"] = o.m_PhotoUrls; + if(o.tagsIsSet() || !o.m_Tags.empty()) + j["tags"] = o.m_Tags; + if(o.statusIsSet()) + j["status"] = o.m_Status; + if(o.veterinarianVisitIsSet()) + j["veterinarianVisit"] = o.m_VeterinarianVisit; + if(o.goodiesIsSet() || !o.m_Goodies.empty()) + j["goodies"] = o.m_Goodies; + if(o.certificatesIsSet() || !o.m_Certificates.empty()) + j["certificates"] = o.m_Certificates; + if(o.vaccinationBookIsSet()) + j["vaccinationBook"] = o.m_VaccinationBook; + +} + +void from_json(const nlohmann::json& j, Pet& o) +{ + if(j.find("id") != j.end()) + { + j.at("id").get_to(o.m_Id); + o.m_IdIsSet = true; + } + if(j.find("category") != j.end()) + { + j.at("category").get_to(o.m_Category); + o.m_CategoryIsSet = true; + } + j.at("name").get_to(o.m_Name); + j.at("photoUrls").get_to(o.m_PhotoUrls); + if(j.find("tags") != j.end()) + { + j.at("tags").get_to(o.m_Tags); + o.m_TagsIsSet = true; + } + if(j.find("status") != j.end()) + { + j.at("status").get_to(o.m_Status); + o.m_StatusIsSet = true; + } + if(j.find("veterinarianVisit") != j.end()) + { + j.at("veterinarianVisit").get_to(o.m_VeterinarianVisit); + o.m_VeterinarianVisitIsSet = true; + } + if(j.find("goodies") != j.end()) + { + j.at("goodies").get_to(o.m_Goodies); + o.m_GoodiesIsSet = true; + } + if(j.find("certificates") != j.end()) + { + j.at("certificates").get_to(o.m_Certificates); + o.m_CertificatesIsSet = true; + } + if(j.find("vaccinationBook") != j.end()) + { + j.at("vaccinationBook").get_to(o.m_VaccinationBook); + o.m_VaccinationBookIsSet = true; + } + +} + +int64_t Pet::getId() const +{ + return m_Id; +} +void Pet::setId(int64_t const value) +{ + m_Id = value; + m_IdIsSet = true; +} +bool Pet::idIsSet() const +{ + return m_IdIsSet; +} +void Pet::unsetId() +{ + m_IdIsSet = false; +} +org::openapitools::server::model::Category Pet::getCategory() const +{ + return m_Category; +} +void Pet::setCategory(org::openapitools::server::model::Category const& value) +{ + m_Category = value; + m_CategoryIsSet = true; +} +bool Pet::categoryIsSet() const +{ + return m_CategoryIsSet; +} +void Pet::unsetCategory() +{ + m_CategoryIsSet = false; +} +std::string Pet::getName() const +{ + return m_Name; +} +void Pet::setName(std::string const& value) +{ + m_Name = value; +} +std::vector Pet::getPhotoUrls() const +{ + return m_PhotoUrls; +} +void Pet::setPhotoUrls(std::vector const& value) +{ + m_PhotoUrls = value; +} +std::vector Pet::getTags() const +{ + return m_Tags; +} +void Pet::setTags(std::vector const& value) +{ + m_Tags = value; + m_TagsIsSet = true; +} +bool Pet::tagsIsSet() const +{ + return m_TagsIsSet; +} +void Pet::unsetTags() +{ + m_TagsIsSet = false; +} +std::string Pet::getStatus() const +{ + return m_Status; +} +void Pet::setStatus(std::string const& value) +{ + m_Status = value; + m_StatusIsSet = true; +} +bool Pet::statusIsSet() const +{ + return m_StatusIsSet; +} +void Pet::unsetStatus() +{ + m_StatusIsSet = false; +} +nlohmann::json Pet::getVeterinarianVisit() const +{ + return m_VeterinarianVisit; +} +void Pet::setVeterinarianVisit(nlohmann::json const& value) +{ + m_VeterinarianVisit = value; + m_VeterinarianVisitIsSet = true; +} +bool Pet::veterinarianVisitIsSet() const +{ + return m_VeterinarianVisitIsSet; +} +void Pet::unsetVeterinarianVisit() +{ + m_VeterinarianVisitIsSet = false; +} +std::vector Pet::getGoodies() const +{ + return m_Goodies; +} +void Pet::setGoodies(std::vector const& value) +{ + m_Goodies = value; + m_GoodiesIsSet = true; +} +bool Pet::goodiesIsSet() const +{ + return m_GoodiesIsSet; +} +void Pet::unsetGoodies() +{ + m_GoodiesIsSet = false; +} +std::set Pet::getCertificates() const +{ + return m_Certificates; +} +void Pet::setCertificates(std::set const& value) +{ + m_Certificates = value; + m_CertificatesIsSet = true; +} +bool Pet::certificatesIsSet() const +{ + return m_CertificatesIsSet; +} +void Pet::unsetCertificates() +{ + m_CertificatesIsSet = false; +} +org::openapitools::server::model::Pet_vaccinationBook Pet::getVaccinationBook() const +{ + return m_VaccinationBook; +} +void Pet::setVaccinationBook(org::openapitools::server::model::Pet_vaccinationBook const& value) +{ + m_VaccinationBook = value; + m_VaccinationBookIsSet = true; +} +bool Pet::vaccinationBookIsSet() const +{ + return m_VaccinationBookIsSet; +} +void Pet::unsetVaccinationBook() +{ + m_VaccinationBookIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet.h b/samples/server/petstore/cpp-pistache-everything/model/Pet.h new file mode 100644 index 00000000000..e3c5986e2d2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet.h @@ -0,0 +1,162 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Pet.h + * + * A pet for sale in the pet store + */ + +#ifndef Pet_H_ +#define Pet_H_ + + +#include "Tag.h" +#include +#include "Pet_vaccinationBook.h" +#include +#include "Category.h" +#include +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// A pet for sale in the pet store +/// +class Pet +{ +public: + Pet(); + virtual ~Pet() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Pet& rhs) const; + bool operator!=(const Pet& rhs) const; + + ///////////////////////////////////////////// + /// Pet members + + /// + /// + /// + int64_t getId() const; + void setId(int64_t const value); + bool idIsSet() const; + void unsetId(); + /// + /// + /// + org::openapitools::server::model::Category getCategory() const; + void setCategory(org::openapitools::server::model::Category const& value); + bool categoryIsSet() const; + void unsetCategory(); + /// + /// + /// + std::string getName() const; + void setName(std::string const& value); + /// + /// + /// + std::vector getPhotoUrls() const; + void setPhotoUrls(std::vector const& value); + /// + /// + /// + std::vector getTags() const; + void setTags(std::vector const& value); + bool tagsIsSet() const; + void unsetTags(); + /// + /// pet status in the store + /// + std::string getStatus() const; + void setStatus(std::string const& value); + bool statusIsSet() const; + void unsetStatus(); + /// + /// last veterinarian visit advice + /// + nlohmann::json getVeterinarianVisit() const; + void setVeterinarianVisit(nlohmann::json const& value); + bool veterinarianVisitIsSet() const; + void unsetVeterinarianVisit(); + /// + /// to help you installing your pet at home + /// + std::vector getGoodies() const; + void setGoodies(std::vector const& value); + bool goodiesIsSet() const; + void unsetGoodies(); + /// + /// pedigree and other certificates + /// + std::set getCertificates() const; + void setCertificates(std::set const& value); + bool certificatesIsSet() const; + void unsetCertificates(); + /// + /// + /// + org::openapitools::server::model::Pet_vaccinationBook getVaccinationBook() const; + void setVaccinationBook(org::openapitools::server::model::Pet_vaccinationBook const& value); + bool vaccinationBookIsSet() const; + void unsetVaccinationBook(); + + friend void to_json(nlohmann::json& j, const Pet& o); + friend void from_json(const nlohmann::json& j, Pet& o); +protected: + int64_t m_Id; + bool m_IdIsSet; + org::openapitools::server::model::Category m_Category; + bool m_CategoryIsSet; + std::string m_Name; + + std::vector m_PhotoUrls; + + std::vector m_Tags; + bool m_TagsIsSet; + std::string m_Status; + bool m_StatusIsSet; + nlohmann::json m_VeterinarianVisit; + bool m_VeterinarianVisitIsSet; + std::vector m_Goodies; + bool m_GoodiesIsSet; + std::set m_Certificates; + bool m_CertificatesIsSet; + org::openapitools::server::model::Pet_vaccinationBook m_VaccinationBook; + bool m_VaccinationBookIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Pet_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.cpp b/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.cpp new file mode 100644 index 00000000000..bc2ec6b6af6 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.cpp @@ -0,0 +1,116 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Pet_bestFriends.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Pet_bestFriends::Pet_bestFriends() +{ + +} + +void Pet_bestFriends::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Pet_bestFriends::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Pet_bestFriends::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Pet_bestFriends" : pathPrefix; + + + + /* BestFriends */ { + const std::vector& value = m_BestFriends; + const std::string currentValuePath = _pathPrefix + ".bestFriends"; + + + if (!org::openapitools::server::helpers::hasOnlyUniqueItems(value)) + { + success = false; + msg << currentValuePath << ": may not contain the same item more than once;"; + } + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const std::string& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + + + i++; + } + } + + } + + return success; +} + +bool Pet_bestFriends::operator==(const Pet_bestFriends& rhs) const +{ + return + + + (getBestFriends() == rhs.getBestFriends()) + + + ; +} + +bool Pet_bestFriends::operator!=(const Pet_bestFriends& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Pet_bestFriends& o) +{ + j = nlohmann::json::object(); + j["bestFriends"] = o.m_BestFriends; + +} + +void from_json(const nlohmann::json& j, Pet_bestFriends& o) +{ + j.at("bestFriends").get_to(o.m_BestFriends); + +} + +std::vector Pet_bestFriends::getBestFriends() const +{ + return m_BestFriends; +} +void Pet_bestFriends::setBestFriends(std::vector const& value) +{ + m_BestFriends = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.h b/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.h new file mode 100644 index 00000000000..fc6ad4b9af3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet_bestFriends.h @@ -0,0 +1,78 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Pet_bestFriends.h + * + * Pet best friends! + */ + +#ifndef Pet_bestFriends_H_ +#define Pet_bestFriends_H_ + + +#include +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// Pet best friends! +/// +class Pet_bestFriends +{ +public: + Pet_bestFriends(); + virtual ~Pet_bestFriends() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Pet_bestFriends& rhs) const; + bool operator!=(const Pet_bestFriends& rhs) const; + + ///////////////////////////////////////////// + /// Pet_bestFriends members + + /// + /// + /// + std::vector getBestFriends() const; + void setBestFriends(std::vector const& value); + + friend void to_json(nlohmann::json& j, const Pet_bestFriends& o); + friend void from_json(const nlohmann::json& j, Pet_bestFriends& o); +protected: + std::vector m_BestFriends; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Pet_bestFriends_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.cpp b/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.cpp new file mode 100644 index 00000000000..9117677c43c --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.cpp @@ -0,0 +1,116 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Pet_vaccinationBook.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Pet_vaccinationBook::Pet_vaccinationBook() +{ + +} + +void Pet_vaccinationBook::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Pet_vaccinationBook::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Pet_vaccinationBook::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Pet_vaccinationBook" : pathPrefix; + + + + /* Vaccines */ { + const std::set& value = m_Vaccines; + const std::string currentValuePath = _pathPrefix + ".vaccines"; + + + if (!org::openapitools::server::helpers::hasOnlyUniqueItems(value)) + { + success = false; + msg << currentValuePath << ": may not contain the same item more than once;"; + } + { // Recursive validation of array elements + const std::string oldValuePath = currentValuePath; + int i = 0; + for (const org::openapitools::server::model::Vaccine& value : value) + { + const std::string currentValuePath = oldValuePath + "[" + std::to_string(i) + "]"; + + success = value.validate(msg, currentValuePath + ".vaccines") && success; + + i++; + } + } + + } + + return success; +} + +bool Pet_vaccinationBook::operator==(const Pet_vaccinationBook& rhs) const +{ + return + + + (getVaccines() == rhs.getVaccines()) + + + ; +} + +bool Pet_vaccinationBook::operator!=(const Pet_vaccinationBook& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Pet_vaccinationBook& o) +{ + j = nlohmann::json::object(); + j["vaccines"] = o.m_Vaccines; + +} + +void from_json(const nlohmann::json& j, Pet_vaccinationBook& o) +{ + j.at("vaccines").get_to(o.m_Vaccines); + +} + +std::set Pet_vaccinationBook::getVaccines() const +{ + return m_Vaccines; +} +void Pet_vaccinationBook::setVaccines(std::set const& value) +{ + m_Vaccines = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.h b/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.h new file mode 100644 index 00000000000..47977d741c4 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Pet_vaccinationBook.h @@ -0,0 +1,78 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Pet_vaccinationBook.h + * + * Vaccination book of the pet + */ + +#ifndef Pet_vaccinationBook_H_ +#define Pet_vaccinationBook_H_ + + +#include "Vaccine.h" +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// Vaccination book of the pet +/// +class Pet_vaccinationBook +{ +public: + Pet_vaccinationBook(); + virtual ~Pet_vaccinationBook() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Pet_vaccinationBook& rhs) const; + bool operator!=(const Pet_vaccinationBook& rhs) const; + + ///////////////////////////////////////////// + /// Pet_vaccinationBook members + + /// + /// + /// + std::set getVaccines() const; + void setVaccines(std::set const& value); + + friend void to_json(nlohmann::json& j, const Pet_vaccinationBook& o); + friend void from_json(const nlohmann::json& j, Pet_vaccinationBook& o); +protected: + std::set m_Vaccines; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Pet_vaccinationBook_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Tag.cpp b/samples/server/petstore/cpp-pistache-everything/model/Tag.cpp new file mode 100644 index 00000000000..8310b73b29b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Tag.cpp @@ -0,0 +1,135 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Tag.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Tag::Tag() +{ + m_Id = 0L; + m_IdIsSet = false; + m_Name = ""; + m_NameIsSet = false; + +} + +void Tag::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Tag::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Tag::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Tag" : pathPrefix; + + + return success; +} + +bool Tag::operator==(const Tag& rhs) const +{ + return + + + + ((!idIsSet() && !rhs.idIsSet()) || (idIsSet() && rhs.idIsSet() && getId() == rhs.getId())) && + + + ((!nameIsSet() && !rhs.nameIsSet()) || (nameIsSet() && rhs.nameIsSet() && getName() == rhs.getName())) + + ; +} + +bool Tag::operator!=(const Tag& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Tag& o) +{ + j = nlohmann::json::object(); + if(o.idIsSet()) + j["id"] = o.m_Id; + if(o.nameIsSet()) + j["name"] = o.m_Name; + +} + +void from_json(const nlohmann::json& j, Tag& o) +{ + if(j.find("id") != j.end()) + { + j.at("id").get_to(o.m_Id); + o.m_IdIsSet = true; + } + if(j.find("name") != j.end()) + { + j.at("name").get_to(o.m_Name); + o.m_NameIsSet = true; + } + +} + +int64_t Tag::getId() const +{ + return m_Id; +} +void Tag::setId(int64_t const value) +{ + m_Id = value; + m_IdIsSet = true; +} +bool Tag::idIsSet() const +{ + return m_IdIsSet; +} +void Tag::unsetId() +{ + m_IdIsSet = false; +} +std::string Tag::getName() const +{ + return m_Name; +} +void Tag::setName(std::string const& value) +{ + m_Name = value; + m_NameIsSet = true; +} +bool Tag::nameIsSet() const +{ + return m_NameIsSet; +} +void Tag::unsetName() +{ + m_NameIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Tag.h b/samples/server/petstore/cpp-pistache-everything/model/Tag.h new file mode 100644 index 00000000000..c9947cf6d7b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Tag.h @@ -0,0 +1,88 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Tag.h + * + * A tag for a pet + */ + +#ifndef Tag_H_ +#define Tag_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// A tag for a pet +/// +class Tag +{ +public: + Tag(); + virtual ~Tag() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Tag& rhs) const; + bool operator!=(const Tag& rhs) const; + + ///////////////////////////////////////////// + /// Tag members + + /// + /// + /// + int64_t getId() const; + void setId(int64_t const value); + bool idIsSet() const; + void unsetId(); + /// + /// + /// + std::string getName() const; + void setName(std::string const& value); + bool nameIsSet() const; + void unsetName(); + + friend void to_json(nlohmann::json& j, const Tag& o); + friend void from_json(const nlohmann::json& j, Tag& o); +protected: + int64_t m_Id; + bool m_IdIsSet; + std::string m_Name; + bool m_NameIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* Tag_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/User.cpp b/samples/server/petstore/cpp-pistache-everything/model/User.cpp new file mode 100644 index 00000000000..dc80d26a721 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/User.cpp @@ -0,0 +1,309 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "User.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +User::User() +{ + m_Id = 0L; + m_IdIsSet = false; + m_Username = ""; + m_UsernameIsSet = false; + m_FirstName = ""; + m_FirstNameIsSet = false; + m_LastName = ""; + m_LastNameIsSet = false; + m_Email = ""; + m_EmailIsSet = false; + m_Password = ""; + m_PasswordIsSet = false; + m_Phone = ""; + m_PhoneIsSet = false; + m_UserStatus = 0; + m_UserStatusIsSet = false; + +} + +void User::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool User::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool User::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "User" : pathPrefix; + + + return success; +} + +bool User::operator==(const User& rhs) const +{ + return + + + + ((!idIsSet() && !rhs.idIsSet()) || (idIsSet() && rhs.idIsSet() && getId() == rhs.getId())) && + + + ((!usernameIsSet() && !rhs.usernameIsSet()) || (usernameIsSet() && rhs.usernameIsSet() && getUsername() == rhs.getUsername())) && + + + ((!firstNameIsSet() && !rhs.firstNameIsSet()) || (firstNameIsSet() && rhs.firstNameIsSet() && getFirstName() == rhs.getFirstName())) && + + + ((!lastNameIsSet() && !rhs.lastNameIsSet()) || (lastNameIsSet() && rhs.lastNameIsSet() && getLastName() == rhs.getLastName())) && + + + ((!emailIsSet() && !rhs.emailIsSet()) || (emailIsSet() && rhs.emailIsSet() && getEmail() == rhs.getEmail())) && + + + ((!passwordIsSet() && !rhs.passwordIsSet()) || (passwordIsSet() && rhs.passwordIsSet() && getPassword() == rhs.getPassword())) && + + + ((!phoneIsSet() && !rhs.phoneIsSet()) || (phoneIsSet() && rhs.phoneIsSet() && getPhone() == rhs.getPhone())) && + + + ((!userStatusIsSet() && !rhs.userStatusIsSet()) || (userStatusIsSet() && rhs.userStatusIsSet() && getUserStatus() == rhs.getUserStatus())) + + ; +} + +bool User::operator!=(const User& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const User& o) +{ + j = nlohmann::json::object(); + if(o.idIsSet()) + j["id"] = o.m_Id; + if(o.usernameIsSet()) + j["username"] = o.m_Username; + if(o.firstNameIsSet()) + j["firstName"] = o.m_FirstName; + if(o.lastNameIsSet()) + j["lastName"] = o.m_LastName; + if(o.emailIsSet()) + j["email"] = o.m_Email; + if(o.passwordIsSet()) + j["password"] = o.m_Password; + if(o.phoneIsSet()) + j["phone"] = o.m_Phone; + if(o.userStatusIsSet()) + j["userStatus"] = o.m_UserStatus; + +} + +void from_json(const nlohmann::json& j, User& o) +{ + if(j.find("id") != j.end()) + { + j.at("id").get_to(o.m_Id); + o.m_IdIsSet = true; + } + if(j.find("username") != j.end()) + { + j.at("username").get_to(o.m_Username); + o.m_UsernameIsSet = true; + } + if(j.find("firstName") != j.end()) + { + j.at("firstName").get_to(o.m_FirstName); + o.m_FirstNameIsSet = true; + } + if(j.find("lastName") != j.end()) + { + j.at("lastName").get_to(o.m_LastName); + o.m_LastNameIsSet = true; + } + if(j.find("email") != j.end()) + { + j.at("email").get_to(o.m_Email); + o.m_EmailIsSet = true; + } + if(j.find("password") != j.end()) + { + j.at("password").get_to(o.m_Password); + o.m_PasswordIsSet = true; + } + if(j.find("phone") != j.end()) + { + j.at("phone").get_to(o.m_Phone); + o.m_PhoneIsSet = true; + } + if(j.find("userStatus") != j.end()) + { + j.at("userStatus").get_to(o.m_UserStatus); + o.m_UserStatusIsSet = true; + } + +} + +int64_t User::getId() const +{ + return m_Id; +} +void User::setId(int64_t const value) +{ + m_Id = value; + m_IdIsSet = true; +} +bool User::idIsSet() const +{ + return m_IdIsSet; +} +void User::unsetId() +{ + m_IdIsSet = false; +} +std::string User::getUsername() const +{ + return m_Username; +} +void User::setUsername(std::string const& value) +{ + m_Username = value; + m_UsernameIsSet = true; +} +bool User::usernameIsSet() const +{ + return m_UsernameIsSet; +} +void User::unsetUsername() +{ + m_UsernameIsSet = false; +} +std::string User::getFirstName() const +{ + return m_FirstName; +} +void User::setFirstName(std::string const& value) +{ + m_FirstName = value; + m_FirstNameIsSet = true; +} +bool User::firstNameIsSet() const +{ + return m_FirstNameIsSet; +} +void User::unsetFirstName() +{ + m_FirstNameIsSet = false; +} +std::string User::getLastName() const +{ + return m_LastName; +} +void User::setLastName(std::string const& value) +{ + m_LastName = value; + m_LastNameIsSet = true; +} +bool User::lastNameIsSet() const +{ + return m_LastNameIsSet; +} +void User::unsetLastName() +{ + m_LastNameIsSet = false; +} +std::string User::getEmail() const +{ + return m_Email; +} +void User::setEmail(std::string const& value) +{ + m_Email = value; + m_EmailIsSet = true; +} +bool User::emailIsSet() const +{ + return m_EmailIsSet; +} +void User::unsetEmail() +{ + m_EmailIsSet = false; +} +std::string User::getPassword() const +{ + return m_Password; +} +void User::setPassword(std::string const& value) +{ + m_Password = value; + m_PasswordIsSet = true; +} +bool User::passwordIsSet() const +{ + return m_PasswordIsSet; +} +void User::unsetPassword() +{ + m_PasswordIsSet = false; +} +std::string User::getPhone() const +{ + return m_Phone; +} +void User::setPhone(std::string const& value) +{ + m_Phone = value; + m_PhoneIsSet = true; +} +bool User::phoneIsSet() const +{ + return m_PhoneIsSet; +} +void User::unsetPhone() +{ + m_PhoneIsSet = false; +} +int32_t User::getUserStatus() const +{ + return m_UserStatus; +} +void User::setUserStatus(int32_t const value) +{ + m_UserStatus = value; + m_UserStatusIsSet = true; +} +bool User::userStatusIsSet() const +{ + return m_UserStatusIsSet; +} +void User::unsetUserStatus() +{ + m_UserStatusIsSet = false; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/User.h b/samples/server/petstore/cpp-pistache-everything/model/User.h new file mode 100644 index 00000000000..fdd5ace216d --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/User.h @@ -0,0 +1,142 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * User.h + * + * A User who is purchasing from the pet store + */ + +#ifndef User_H_ +#define User_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// A User who is purchasing from the pet store +/// +class User +{ +public: + User(); + virtual ~User() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const User& rhs) const; + bool operator!=(const User& rhs) const; + + ///////////////////////////////////////////// + /// User members + + /// + /// + /// + int64_t getId() const; + void setId(int64_t const value); + bool idIsSet() const; + void unsetId(); + /// + /// + /// + std::string getUsername() const; + void setUsername(std::string const& value); + bool usernameIsSet() const; + void unsetUsername(); + /// + /// + /// + std::string getFirstName() const; + void setFirstName(std::string const& value); + bool firstNameIsSet() const; + void unsetFirstName(); + /// + /// + /// + std::string getLastName() const; + void setLastName(std::string const& value); + bool lastNameIsSet() const; + void unsetLastName(); + /// + /// + /// + std::string getEmail() const; + void setEmail(std::string const& value); + bool emailIsSet() const; + void unsetEmail(); + /// + /// + /// + std::string getPassword() const; + void setPassword(std::string const& value); + bool passwordIsSet() const; + void unsetPassword(); + /// + /// + /// + std::string getPhone() const; + void setPhone(std::string const& value); + bool phoneIsSet() const; + void unsetPhone(); + /// + /// User Status + /// + int32_t getUserStatus() const; + void setUserStatus(int32_t const value); + bool userStatusIsSet() const; + void unsetUserStatus(); + + friend void to_json(nlohmann::json& j, const User& o); + friend void from_json(const nlohmann::json& j, User& o); +protected: + int64_t m_Id; + bool m_IdIsSet; + std::string m_Username; + bool m_UsernameIsSet; + std::string m_FirstName; + bool m_FirstNameIsSet; + std::string m_LastName; + bool m_LastNameIsSet; + std::string m_Email; + bool m_EmailIsSet; + std::string m_Password; + bool m_PasswordIsSet; + std::string m_Phone; + bool m_PhoneIsSet; + int32_t m_UserStatus; + bool m_UserStatusIsSet; + +}; + +} // namespace org::openapitools::server::model + +#endif /* User_H_ */ diff --git a/samples/server/petstore/cpp-pistache-everything/model/Vaccine.cpp b/samples/server/petstore/cpp-pistache-everything/model/Vaccine.cpp new file mode 100644 index 00000000000..ae81354eb06 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Vaccine.cpp @@ -0,0 +1,104 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "Vaccine.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +Vaccine::Vaccine() +{ + m_BoosterRequired = false; + +} + +void Vaccine::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool Vaccine::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool Vaccine::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "Vaccine" : pathPrefix; + + + return success; +} + +bool Vaccine::operator==(const Vaccine& rhs) const +{ + return + + + (getDate() == rhs.getDate()) + && + + (isBoosterRequired() == rhs.isBoosterRequired()) + + + ; +} + +bool Vaccine::operator!=(const Vaccine& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const Vaccine& o) +{ + j = nlohmann::json::object(); + j["date"] = o.m_date; + j["boosterRequired"] = o.m_BoosterRequired; + +} + +void from_json(const nlohmann::json& j, Vaccine& o) +{ + j.at("date").get_to(o.m_date); + j.at("boosterRequired").get_to(o.m_BoosterRequired); + +} + +nlohmann::json Vaccine::getDate() const +{ + return m_date; +} +void Vaccine::setDate(nlohmann::json const& value) +{ + m_date = value; +} +bool Vaccine::isBoosterRequired() const +{ + return m_BoosterRequired; +} +void Vaccine::setBoosterRequired(bool const value) +{ + m_BoosterRequired = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-everything/model/Vaccine.h b/samples/server/petstore/cpp-pistache-everything/model/Vaccine.h new file mode 100644 index 00000000000..da87ece1a0c --- /dev/null +++ b/samples/server/petstore/cpp-pistache-everything/model/Vaccine.h @@ -0,0 +1,84 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Vaccine.h + * + * + */ + +#ifndef Vaccine_H_ +#define Vaccine_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class Vaccine +{ +public: + Vaccine(); + virtual ~Vaccine() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const Vaccine& rhs) const; + bool operator!=(const Vaccine& rhs) const; + + ///////////////////////////////////////////// + /// Vaccine members + + /// + /// vaccination date + /// + nlohmann::json getDate() const; + void setDate(nlohmann::json const& value); + /// + /// true if a booster is still needed to complete the vaccination + /// + bool isBoosterRequired() const; + void setBoosterRequired(bool const value); + + friend void to_json(nlohmann::json& j, const Vaccine& o); + friend void from_json(const nlohmann::json& j, Vaccine& o); +protected: + nlohmann::json m_date; + + bool m_BoosterRequired; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* Vaccine_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore b/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore new file mode 100644 index 00000000000..6268881d980 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore @@ -0,0 +1,3 @@ +build/ +external/ +pistache/ \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES new file mode 100644 index 00000000000..1abc72ab7df --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES @@ -0,0 +1,14 @@ +CMakeLists.txt +README.md +api/ApiBase.h +api/StoreApi.cpp +api/StoreApi.h +impl/StoreApiImpl.cpp +impl/StoreApiImpl.h +main-api-server.cpp +model/Helpers.cpp +model/Helpers.h +model/MiddleType.cpp +model/MiddleType.h +model/OuterType.cpp +model/OuterType.h diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt b/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt new file mode 100644 index 00000000000..23269deb0ff --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required (VERSION 3.2) + +project(api-server) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) + +include(ExternalProject) + +set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) + +ExternalProject_Add(PISTACHE + GIT_REPOSITORY https://github.com/pistacheio/pistache.git + BUILD_IN_SOURCE true + INSTALL_COMMAND meson setup build --prefix=${EXTERNAL_INSTALL_LOCATION} --libdir=lib && meson install -C build +) + +ExternalProject_Add(NLOHMANN + GIT_REPOSITORY https://github.com/nlohmann/json.git + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DJSON_BuildTests=OFF +) + +include_directories(${EXTERNAL_INSTALL_LOCATION}/include) +link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) + +include_directories(model) +include_directories(api) +include_directories(impl) + +file(GLOB SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp +) + +add_executable(${PROJECT_NAME} ${SRCS} ) +add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN) +target_link_libraries(${PROJECT_NAME} pistache pthread) diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md b/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md new file mode 100644 index 00000000000..626ce4cc8a8 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md @@ -0,0 +1,48 @@ +# REST API Server for Test swagger file + +## Overview +This API Server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +It uses the [Pistache](https://github.com/oktal/pistache) Framework. + +## Files organization +The Pistache C++ REST server generator creates three folders: +- `api`: This folder contains the handlers for each method specified in the OpenAPI definition. Every handler extracts +the path and body parameters (if any) from the requests and tries to parse and possibly validate them. +Once this step is completed, the main API class calls the corresponding abstract method that should be implemented +by the developer (a basic implementation is provided under the `impl` folder) +- `impl`: As written above, the implementation folder contains, for each API, the corresponding implementation class, +which extends the main API class and implements the abstract methods. +Every method receives the path and body parameters as constant reference variables and a reference to the response +object, that should be filled with the right response and sent at the end of the method with the command: +response.send(returnCode, responseBody, [mimeType]) +- `model`: This folder contains the corresponding class for every object schema found in the OpenAPI specification. + +The main folder contains also a file with a main that can be used to start the server. +Of course, is you should customize this file based on your needs + +## Installation +First of all, you need to download and install the libraries listed [here](#libraries-required). + +Once the libraries are installed, in order to compile and run the server please follow the steps below: +```bash +mkdir build +cd build +cmake .. +make +``` + +Once compiled run the server: + +```bash +cd build +./api-server +``` + +## Libraries required +- [pistache](http://pistache.io/quickstart) +- [JSON for Modern C++](https://github.com/nlohmann/json/#integration): Please download the `json.hpp` file and +put it under the model/nlohmann folder + +## Namespaces +org.openapitools.server.api +org.openapitools.server.model diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h new file mode 100644 index 00000000000..21ce41d1fd6 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h @@ -0,0 +1,39 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * ApiBase.h + * + * Generalization of the Api classes + */ + +#ifndef ApiBase_H_ +#define ApiBase_H_ + +#include +#include + +namespace org::openapitools::server::api +{ + +class ApiBase { +public: + explicit ApiBase(const std::shared_ptr& rtr) : router(rtr) {}; + virtual ~ApiBase() = default; + virtual void init() = 0; + +protected: + const std::shared_ptr router; +}; + +} // namespace org::openapitools::server::api + +#endif /* ApiBase_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp new file mode 100644 index 00000000000..afeb584db41 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp @@ -0,0 +1,86 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApi.h" +#include "Helpers.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::helpers; +using namespace org::openapitools::server::model; + +const std::string StoreApi::base = ""; + +StoreApi::StoreApi(const std::shared_ptr& rtr) + : ApiBase(rtr) +{ +} + +void StoreApi::init() { + setupRoutes(); +} + +void StoreApi::setupRoutes() { + using namespace Pistache::Rest; + + Routes::Get(*router, base + "/pet", Routes::bind(&StoreApi::get_nested_object_handler, this)); + + // Default handler, called when a route is not found + router->addCustomHandler(Routes::bind(&StoreApi::store_api_default_handler, this)); +} + +std::pair StoreApi::handleParsingException(const std::exception& ex) const noexcept +{ + try { + throw; + } catch (nlohmann::detail::exception &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (org::openapitools::server::helpers::ValidationException &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (std::exception &e) { + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); + } +} + +std::pair StoreApi::handleOperationException(const std::exception& ex) const noexcept +{ + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); +} + +void StoreApi::get_nested_object_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->get_nested_object(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} + +void StoreApi::store_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); +} + +} // namespace org::openapitools::server::api + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h new file mode 100644 index 00000000000..c6b96d2c77b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * StoreApi.h + * + * + */ + +#ifndef StoreApi_H_ +#define StoreApi_H_ + + +#include "ApiBase.h" + +#include +#include +#include + +#include +#include + +#include "OuterType.h" + +namespace org::openapitools::server::api +{ + +class StoreApi : public ApiBase { +public: + explicit StoreApi(const std::shared_ptr& rtr); + ~StoreApi() override = default; + void init() override; + + static const std::string base; + +private: + void setupRoutes(); + + void get_nested_object_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + + /// + /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleParsingException(const std::exception& ex) const noexcept; + + /// + /// Helper function to handle unexpected Exceptions during processing of the request in handler functions. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleOperationException(const std::exception& ex) const noexcept; + + /// + /// + /// + /// + /// + /// + virtual void get_nested_object(Pistache::Http::ResponseWriter &response) = 0; + +}; + +} // namespace org::openapitools::server::api + +#endif /* StoreApi_H_ */ + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh b/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh new file mode 100644 index 00000000000..f7b8d02d3d2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# build C++ pistache petstore +# + +mkdir -p build +cd build +cmake .. +make -j diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp new file mode 100644 index 00000000000..93d057d023a --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp @@ -0,0 +1,35 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApiImpl.h" + +namespace org { +namespace openapitools { +namespace server { +namespace api { + +using namespace org::openapitools::server::model; + +StoreApiImpl::StoreApiImpl(const std::shared_ptr& rtr) + : StoreApi(rtr) +{ +} + +void StoreApiImpl::get_nested_object(Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h new file mode 100644 index 00000000000..29e63657ee3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h @@ -0,0 +1,52 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +/* +* StoreApiImpl.h +* +* +*/ + +#ifndef STORE_API_IMPL_H_ +#define STORE_API_IMPL_H_ + + +#include +#include +#include +#include +#include + +#include + + +#include "OuterType.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::model; + +class StoreApiImpl : public org::openapitools::server::api::StoreApi { +public: + explicit StoreApiImpl(const std::shared_ptr& rtr); + ~StoreApiImpl() override = default; + + void get_nested_object(Pistache::Http::ResponseWriter &response); + +}; + +} // namespace org::openapitools::server::api + + + +#endif diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp new file mode 100644 index 00000000000..017c4e493f4 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp @@ -0,0 +1,93 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "pistache/endpoint.h" +#include "pistache/http.h" +#include "pistache/router.h" +#ifdef __linux__ +#include +#include +#include +#endif + +#include "ApiBase.h" + +#include "StoreApiImpl.h" + +#define PISTACHE_SERVER_THREADS 2 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 + +static Pistache::Http::Endpoint *httpEndpoint; +#ifdef __linux__ +static void sigHandler [[noreturn]] (int sig){ + switch(sig){ + case SIGINT: + case SIGQUIT: + case SIGTERM: + case SIGHUP: + default: + httpEndpoint->shutdown(); + break; + } + exit(0); +} + +static void setUpUnixSignals(std::vector quitSignals) { + sigset_t blocking_mask; + sigemptyset(&blocking_mask); + for (auto sig : quitSignals) + sigaddset(&blocking_mask, sig); + + struct sigaction sa; + sa.sa_handler = sigHandler; + sa.sa_mask = blocking_mask; + sa.sa_flags = 0; + + for (auto sig : quitSignals) + sigaction(sig, &sa, nullptr); +} +#endif + +using namespace org::openapitools::server::api; + +int main() { +#ifdef __linux__ + std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; + setUpUnixSignals(sigs); +#endif + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(8080)); + + httpEndpoint = new Pistache::Http::Endpoint((addr)); + auto router = std::make_shared(); + + auto opts = Pistache::Http::Endpoint::options() + .threads(PISTACHE_SERVER_THREADS); + opts.flags(Pistache::Tcp::Options::ReuseAddr); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); + httpEndpoint->init(opts); + + auto apiImpls = std::vector>(); + + apiImpls.push_back(std::make_shared(router)); + + for (auto api : apiImpls) { + api->init(); + } + + httpEndpoint->setHandler(router->handler()); + httpEndpoint->serve(); + + httpEndpoint->shutdown(); +} diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp new file mode 100644 index 00000000000..57f0f285cf5 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp @@ -0,0 +1,148 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +#include "Helpers.h" +#include + +namespace org::openapitools::server::helpers +{ + +const std::regex regexRfc3339_date(R"(^(\d{4})\-(\d{2})\-(\d{2})$)"); +const std::regex regexRfc3339_date_time( + R"(^(\d{4})\-(\d{2})\-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|([\+\-])(\d{2}):(\d{2}))$)" +); + + +namespace +{ + // Determine if given year is a leap year + // See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C + bool isLeapYear(const uint16_t year) { + return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); + } + + bool validateDateValues(const uint16_t year, const uint16_t month, const uint16_t day) { + return !( + (month == 0 || month > 12) + || (day == 0) + || (month == 2 && day > (28 + (isLeapYear(year) ? 1 : 0))) + || (month <= 7 && day > (30 + month % 2)) + || (month >= 8 && day > (31 - month % 2)) + ); + } + + bool validateTimeValues(const uint16_t hours, const uint16_t minutes, const uint16_t seconds) { + return (hours <= 23) && (minutes <= 59) && (seconds <= 60); + } +} + +bool validateRfc3339_date(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date); + return found && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))); +} + +bool validateRfc3339_date_time(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date_time); + return found + && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))) + && validateTimeValues(static_cast(std::stoi(match[4])), + static_cast(std::stoi(match[5])), + static_cast(std::stoi(match[6]))); +} + +std::string toStringValue(const std::string &value){ + return std::string(value); +} + +std::string toStringValue(const int32_t value){ + return std::to_string(value); +} + +std::string toStringValue(const int64_t value){ + return std::to_string(value); +} + +std::string toStringValue(const bool value){ + return value ? std::string("true") : std::string("false"); +} + +std::string toStringValue(const float value){ + return std::to_string(value); +} + +std::string toStringValue(const double value){ + return std::to_string(value); +} + +bool fromStringValue(const std::string &inStr, std::string &value){ + value = std::string(inStr); + return true; +} + +bool fromStringValue(const std::string &inStr, int32_t &value){ + try { + value = std::stoi( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, int64_t &value){ + try { + value = std::stol( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, bool &value){ + if (inStr == "true") { + value = true; + return true; + } + if (inStr == "false") { + value = false; + return true; + } + return false; +} + +bool fromStringValue(const std::string &inStr, float &value){ + try { + value = std::stof( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, double &value){ + try { + value = std::stod( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +} // namespace org::openapitools::server::helpers diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h new file mode 100644 index 00000000000..f053b1a91a3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h @@ -0,0 +1,146 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Helpers.h + * + * This is the helper class for models and primitives + */ + +#ifndef Helpers_H_ +#define Helpers_H_ + +#include +#include +#include +#include +#include +#include + +namespace org::openapitools::server::helpers +{ + + class ValidationException : public std::runtime_error + { + public: + explicit ValidationException(const std::string& what) + : std::runtime_error(what) + { } + ~ValidationException() override = default; + }; + + /// + /// Validate a string against the full-date definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date(const std::string& str); + + /// + /// Validate a string against the date-time definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date_time(const std::string& str); + + namespace sfinae_helpers + { + struct NoType {}; + template NoType operator==(const T1&, const T2&); + + template class EqualsOperatorAvailable + { + public: + enum + { + value = !std::is_same< decltype(std::declval() == std::declval()), NoType >::value + }; + }; + } // namespace sfinae_helpers + + + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::vector& vec) + { + static_assert(sfinae_helpers::EqualsOperatorAvailable::value, + "hasOnlyUniqueItems cannot be called, passed template type does not provide == operator."); + if (vec.size() <= 1) + { + return true; + } + // Compare every element of vec to every other element of vec. + // This isn't an elegant way to do this, since it's O(n^2), + // but it's the best solution working only with the == operator. + // This could be greatly improved if our models provided a valid hash + // and/or the < operator + for (size_t i = 0; i < vec.size() - 1; i++) + { + for (size_t j = i + 1; j < vec.size(); j++) + { + if (vec[i] == vec[j]) + { + return false; + } + } + } + return true; + } + + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::set& set) + { + return true; + } + + std::string toStringValue(const std::string &value); + std::string toStringValue(const int32_t value); + std::string toStringValue(const int64_t value); + std::string toStringValue(const bool value); + std::string toStringValue(const float value); + std::string toStringValue(const double value); + + bool fromStringValue(const std::string &inStr, std::string &value); + bool fromStringValue(const std::string &inStr, int32_t &value); + bool fromStringValue(const std::string &inStr, int64_t &value); + bool fromStringValue(const std::string &inStr, bool &value); + bool fromStringValue(const std::string &inStr, float &value); + bool fromStringValue(const std::string &inStr, double &value); + template + bool fromStringValue(const std::vector &inStr, std::vector &value){ + try{ + for(auto & item : inStr){ + T itemValue; + if(fromStringValue(item, itemValue)){ + value.push_back(itemValue); + } + } + } + catch(...){ + return false; + } + return value.size() > 0; + } + template + bool fromStringValue(const std::string &inStr, std::vector &value, char separator = ','){ + std::vector inStrings; + std::istringstream f(inStr); + std::string s; + while (std::getline(f, s, separator)) { + inStrings.push_back(s); + } + return fromStringValue(inStrings, value); + } + +} // namespace org::openapitools::server::helpers + +#endif // Helpers_H_ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp new file mode 100644 index 00000000000..aa4251d3bc0 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp @@ -0,0 +1,91 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "MiddleType.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +MiddleType::MiddleType() +{ + m_Inner = ""; + +} + +void MiddleType::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool MiddleType::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool MiddleType::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "MiddleType" : pathPrefix; + + + return success; +} + +bool MiddleType::operator==(const MiddleType& rhs) const +{ + return + + + (getInner() == rhs.getInner()) + + + ; +} + +bool MiddleType::operator!=(const MiddleType& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const MiddleType& o) +{ + j = nlohmann::json::object(); + j["inner"] = o.m_Inner; + +} + +void from_json(const nlohmann::json& j, MiddleType& o) +{ + j.at("inner").get_to(o.m_Inner); + +} + +std::string MiddleType::getInner() const +{ + return m_Inner; +} +void MiddleType::setInner(std::string const& value) +{ + m_Inner = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h new file mode 100644 index 00000000000..795d2989f87 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * MiddleType.h + * + * + */ + +#ifndef MiddleType_H_ +#define MiddleType_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class MiddleType +{ +public: + MiddleType(); + virtual ~MiddleType() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const MiddleType& rhs) const; + bool operator!=(const MiddleType& rhs) const; + + ///////////////////////////////////////////// + /// MiddleType members + + /// + /// + /// + std::string getInner() const; + void setInner(std::string const& value); + + friend void to_json(nlohmann::json& j, const MiddleType& o); + friend void from_json(const nlohmann::json& j, MiddleType& o); +protected: + std::string m_Inner; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* MiddleType_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp new file mode 100644 index 00000000000..f3cc1f8076b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp @@ -0,0 +1,94 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "OuterType.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +OuterType::OuterType() +{ + +} + +void OuterType::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool OuterType::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool OuterType::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "OuterType" : pathPrefix; + + + if (!m_Middle.validate(msg, _pathPrefix + ".middle")) { + msg << _pathPrefix << ": Middle is invalid;"; + success = false; + } + return success; +} + +bool OuterType::operator==(const OuterType& rhs) const +{ + return + + + (getMiddle() == rhs.getMiddle()) + + + ; +} + +bool OuterType::operator!=(const OuterType& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const OuterType& o) +{ + j = nlohmann::json::object(); + j["middle"] = o.m_Middle; + +} + +void from_json(const nlohmann::json& j, OuterType& o) +{ + j.at("middle").get_to(o.m_Middle); + +} + +org::openapitools::server::model::MiddleType OuterType::getMiddle() const +{ + return m_Middle; +} +void OuterType::setMiddle(org::openapitools::server::model::MiddleType const& value) +{ + m_Middle = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h new file mode 100644 index 00000000000..df53df3c2be --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * OuterType.h + * + * + */ + +#ifndef OuterType_H_ +#define OuterType_H_ + + +#include "MiddleType.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class OuterType +{ +public: + OuterType(); + virtual ~OuterType() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const OuterType& rhs) const; + bool operator!=(const OuterType& rhs) const; + + ///////////////////////////////////////////// + /// OuterType members + + /// + /// + /// + org::openapitools::server::model::MiddleType getMiddle() const; + void setMiddle(org::openapitools::server::model::MiddleType const& value); + + friend void to_json(nlohmann::json& j, const OuterType& o); + friend void from_json(const nlohmann::json& j, OuterType& o); +protected: + org::openapitools::server::model::MiddleType m_Middle; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* OuterType_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml b/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml new file mode 100644 index 00000000000..66effbbbfd2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + CppPistacheServerTests_container_type_import + pom + 1.0-SNAPSHOT + C++ Pistache Petstore Server (Container Type Import) + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + build-pistache + integration-test + + exec + + + ./build_petstore.sh + + + + + + + diff --git a/samples/server/petstore/cpp-pistache/.gitignore b/samples/server/petstore/cpp-pistache/.gitignore new file mode 100644 index 00000000000..6268881d980 --- /dev/null +++ b/samples/server/petstore/cpp-pistache/.gitignore @@ -0,0 +1,3 @@ +build/ +external/ +pistache/ \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/build_petstore.sh b/samples/server/petstore/cpp-pistache/build_petstore.sh index 665f09a5054..f7b8d02d3d2 100755 --- a/samples/server/petstore/cpp-pistache/build_petstore.sh +++ b/samples/server/petstore/cpp-pistache/build_petstore.sh @@ -2,7 +2,7 @@ # build C++ pistache petstore # -mkdir build +mkdir -p build cd build cmake .. -make +make -j diff --git a/samples/server/petstore/cpp-pistache/install_pistache.sh b/samples/server/petstore/cpp-pistache/install_pistache.sh deleted file mode 100755 index d10e3f19b37..00000000000 --- a/samples/server/petstore/cpp-pistache/install_pistache.sh +++ /dev/null @@ -1,13 +0,0 @@ -#/bin/bash -# ref: http://pistache.io/quickstart#installing-pistache -# -echo "Installing Pistache ..." - -git clone https://github.com/oktal/pistache.git || true -cd pistache -git submodule update --init -mkdir -p build -cd build -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. -make -sudo make install diff --git a/samples/server/petstore/cpp-pistache/model/Helpers.h b/samples/server/petstore/cpp-pistache/model/Helpers.h index 176b817de1e..832ac04c98e 100644 --- a/samples/server/petstore/cpp-pistache/model/Helpers.h +++ b/samples/server/petstore/cpp-pistache/model/Helpers.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace org::openapitools::server::helpers { @@ -92,6 +93,15 @@ namespace org::openapitools::server::helpers return true; } + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::set& set) + { + return true; + } + std::string toStringValue(const std::string &value); std::string toStringValue(const int32_t value); std::string toStringValue(const int64_t value); diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object.cpp b/samples/server/petstore/cpp-pistache/model/Inline_object.cpp deleted file mode 100644 index 89638a84566..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#include "Inline_object.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Inline_object::Inline_object() -{ - m_Name = ""; - m_NameIsSet = false; - m_Status = ""; - m_StatusIsSet = false; - -} - -Inline_object::~Inline_object() -{ -} - -void Inline_object::validate() -{ - // TODO: implement validation -} - -void to_json(nlohmann::json& j, const Inline_object& o) -{ - j = nlohmann::json(); - if(o.nameIsSet()) - j["name"] = o.m_Name; - if(o.statusIsSet()) - j["status"] = o.m_Status; -} - -void from_json(const nlohmann::json& j, Inline_object& o) -{ - if(j.find("name") != j.end()) - { - j.at("name").get_to(o.m_Name); - o.m_NameIsSet = true; - } - if(j.find("status") != j.end()) - { - j.at("status").get_to(o.m_Status); - o.m_StatusIsSet = true; - } -} - -std::string Inline_object::getName() const -{ - return m_Name; -} -void Inline_object::setName(std::string const& value) -{ - m_Name = value; - m_NameIsSet = true; -} -bool Inline_object::nameIsSet() const -{ - return m_NameIsSet; -} -void Inline_object::unsetName() -{ - m_NameIsSet = false; -} -std::string Inline_object::getStatus() const -{ - return m_Status; -} -void Inline_object::setStatus(std::string const& value) -{ - m_Status = value; - m_StatusIsSet = true; -} -bool Inline_object::statusIsSet() const -{ - return m_StatusIsSet; -} -void Inline_object::unsetStatus() -{ - m_StatusIsSet = false; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object.h b/samples/server/petstore/cpp-pistache/model/Inline_object.h deleted file mode 100644 index f407884cd88..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object.h +++ /dev/null @@ -1,73 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -/* - * Inline_object.h - * - * - */ - -#ifndef Inline_object_H_ -#define Inline_object_H_ - - -#include -#include - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Inline_object -{ -public: - Inline_object(); - virtual ~Inline_object(); - - void validate(); - - ///////////////////////////////////////////// - /// Inline_object members - - /// - /// Updated name of the pet - /// - std::string getName() const; - void setName(std::string const& value); - bool nameIsSet() const; - void unsetName(); - /// - /// Updated status of the pet - /// - std::string getStatus() const; - void setStatus(std::string const& value); - bool statusIsSet() const; - void unsetStatus(); - - friend void to_json(nlohmann::json& j, const Inline_object& o); - friend void from_json(const nlohmann::json& j, Inline_object& o); -protected: - std::string m_Name; - bool m_NameIsSet; - std::string m_Status; - bool m_StatusIsSet; -}; - -} -} -} -} - -#endif /* Inline_object_H_ */ diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp b/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp deleted file mode 100644 index 0da3bdba2b8..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#include "Inline_object_1.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Inline_object_1::Inline_object_1() -{ - m_AdditionalMetadata = ""; - m_AdditionalMetadataIsSet = false; - m_fileIsSet = false; - -} - -Inline_object_1::~Inline_object_1() -{ -} - -void Inline_object_1::validate() -{ - // TODO: implement validation -} - -void to_json(nlohmann::json& j, const Inline_object_1& o) -{ - j = nlohmann::json(); - if(o.additionalMetadataIsSet()) - j["additionalMetadata"] = o.m_AdditionalMetadata; - if(o.fileIsSet()) - j["file"] = o.m_file; -} - -void from_json(const nlohmann::json& j, Inline_object_1& o) -{ - if(j.find("additionalMetadata") != j.end()) - { - j.at("additionalMetadata").get_to(o.m_AdditionalMetadata); - o.m_AdditionalMetadataIsSet = true; - } - if(j.find("file") != j.end()) - { - j.at("file").get_to(o.m_file); - o.m_fileIsSet = true; - } -} - -std::string Inline_object_1::getAdditionalMetadata() const -{ - return m_AdditionalMetadata; -} -void Inline_object_1::setAdditionalMetadata(std::string const& value) -{ - m_AdditionalMetadata = value; - m_AdditionalMetadataIsSet = true; -} -bool Inline_object_1::additionalMetadataIsSet() const -{ - return m_AdditionalMetadataIsSet; -} -void Inline_object_1::unsetAdditionalMetadata() -{ - m_AdditionalMetadataIsSet = false; -} -std::string Inline_object_1::getFile() const -{ - return m_file; -} -void Inline_object_1::setFile(std::string const& value) -{ - m_file = value; - m_fileIsSet = true; -} -bool Inline_object_1::fileIsSet() const -{ - return m_fileIsSet; -} -void Inline_object_1::unsetfile() -{ - m_fileIsSet = false; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object_1.h b/samples/server/petstore/cpp-pistache/model/Inline_object_1.h deleted file mode 100644 index a5d90b1754e..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object_1.h +++ /dev/null @@ -1,73 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -/* - * Inline_object_1.h - * - * - */ - -#ifndef Inline_object_1_H_ -#define Inline_object_1_H_ - - -#include -#include - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Inline_object_1 -{ -public: - Inline_object_1(); - virtual ~Inline_object_1(); - - void validate(); - - ///////////////////////////////////////////// - /// Inline_object_1 members - - /// - /// Additional data to pass to server - /// - std::string getAdditionalMetadata() const; - void setAdditionalMetadata(std::string const& value); - bool additionalMetadataIsSet() const; - void unsetAdditionalMetadata(); - /// - /// file to upload - /// - std::string getFile() const; - void setFile(std::string const& value); - bool fileIsSet() const; - void unsetfile(); - - friend void to_json(nlohmann::json& j, const Inline_object_1& o); - friend void from_json(const nlohmann::json& j, Inline_object_1& o); -protected: - std::string m_AdditionalMetadata; - bool m_AdditionalMetadataIsSet; - std::string m_file; - bool m_fileIsSet; -}; - -} -} -} -} - -#endif /* Inline_object_1_H_ */ diff --git a/samples/server/petstore/cpp-pistache/pom.xml b/samples/server/petstore/cpp-pistache/pom.xml index 3b46ac29fc3..1ba35692115 100644 --- a/samples/server/petstore/cpp-pistache/pom.xml +++ b/samples/server/petstore/cpp-pistache/pom.xml @@ -26,16 +26,6 @@ exec-maven-plugin 1.6.0 - - install-pistache - integration-test - - exec - - - ./install_pistache.sh - - build-pistache integration-test diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index 65a86866857..f309214557f 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -105,6 +105,30 @@ paths: - OPTION_3 type: string style: form + - explode: true + in: query + name: defaultInt + required: false + schema: + default: 1 + type: integer + style: form + - explode: true + in: query + name: defaultNum + required: false + schema: + default: 1.5 + type: number + style: form + - explode: true + in: query + name: defaultStr + required: false + schema: + default: default + type: string + style: form - deprecated: true description: Status values that need to be considered for filter explode: false @@ -631,10 +655,10 @@ paths: schema: type: string style: form - - description: The password for login in clear text + - description: Remember Me explode: true in: query - name: boolean_test + name: remember_me required: false schema: type: boolean @@ -702,10 +726,10 @@ paths: schema: type: string style: simple - - description: boolean query parameter + - description: Confirm the deletion explode: true in: query - name: boolean_test + name: confirmation required: false schema: type: boolean diff --git a/samples/server/petstore/go-api-server/go/api.go b/samples/server/petstore/go-api-server/go/api.go index 4d4ab7fc38b..23d5213c5a6 100644 --- a/samples/server/petstore/go-api-server/go/api.go +++ b/samples/server/petstore/go-api-server/go/api.go @@ -71,7 +71,7 @@ type PetAPIServicer interface { AddPet(context.Context, Pet) (ImplResponse, error) DeletePet(context.Context, int64, string) (ImplResponse, error) FilterPetsByCategory(context.Context, Gender, Species, []Species) (ImplResponse, error) - FindPetsByStatus(context.Context, []string, string, string) (ImplResponse, error) + FindPetsByStatus(context.Context, []string, string, string, int32, float32, string) (ImplResponse, error) // Deprecated FindPetsByTags(context.Context, []string, time.Time, time.Time, Colour) (ImplResponse, error) GetPetById(context.Context, int64) (ImplResponse, error) diff --git a/samples/server/petstore/go-api-server/go/api_pet.go b/samples/server/petstore/go-api-server/go/api_pet.go index 23d938cc7d0..8451d4cf892 100644 --- a/samples/server/petstore/go-api-server/go/api_pet.go +++ b/samples/server/petstore/go-api-server/go/api_pet.go @@ -37,7 +37,7 @@ func WithPetAPIErrorHandler(h ErrorHandler) PetAPIOption { } // NewPetAPIController creates a default api controller -func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) Router { +func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) *PetAPIController { controller := &PetAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -150,7 +150,7 @@ func (c *PetAPIController) AddPet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeletePet - Deletes a pet @@ -161,7 +161,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } apiKeyParam := r.Header.Get("api_key") @@ -172,7 +172,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FilterPetsByCategory - Finds Pets @@ -185,7 +185,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R } genderParam, err := NewGenderFromValue(params["gender"]) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "gender", Err: err}, nil) return } var speciesParam Species @@ -204,7 +204,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R for _, param := range paramSplits { paramEnum, err := NewSpeciesFromValue(param) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "notSpecies", Err: err}, nil) return } notSpeciesParam = append(notSpeciesParam, paramEnum) @@ -217,7 +217,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByStatus - Finds Pets by status @@ -244,14 +244,55 @@ func (c *PetAPIController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque inlineEnumParam = param } else { } - result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam) + var defaultIntParam int32 + if query.Has("defaultInt") { + param, err := parseNumericParameter[int32]( + query.Get("defaultInt"), + WithParse[int32](parseInt32), + ) + if err != nil { + c.errorHandler(w, r, &ParsingError{Param: "defaultInt", Err: err}, nil) + return + } + + defaultIntParam = param + } else { + var param int32 = 1 + defaultIntParam = param + } + var defaultNumParam float32 + if query.Has("defaultNum") { + param, err := parseNumericParameter[float32]( + query.Get("defaultNum"), + WithParse[float32](parseFloat32), + ) + if err != nil { + c.errorHandler(w, r, &ParsingError{Param: "defaultNum", Err: err}, nil) + return + } + + defaultNumParam = param + } else { + var param float32 = 1.5 + defaultNumParam = param + } + var defaultStrParam string + if query.Has("defaultStr") { + param := query.Get("defaultStr") + + defaultStrParam = param + } else { + param := "default" + defaultStrParam = param + } + result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam, defaultIntParam, defaultNumParam, defaultStrParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByTags - Finds Pets by tags @@ -270,7 +311,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request if query.Has("bornAfter"){ param, err := parseTime(query.Get("bornAfter")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornAfter", Err: err}, nil) return } @@ -283,7 +324,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request if query.Has("bornBefore"){ param, err := parseTime(query.Get("bornBefore")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornBefore", Err: err}, nil) return } @@ -304,7 +345,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetById - Find pet by ID @@ -315,7 +356,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } result, err := c.service.GetPetById(r.Context(), petIdParam) @@ -325,7 +366,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetImageById - Returns the image for the Pet that has been previously uploaded @@ -336,7 +377,7 @@ func (c *PetAPIController) GetPetImageById(w http.ResponseWriter, r *http.Reques WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } result, err := c.service.GetPetImageById(r.Context(), petIdParam) @@ -346,7 +387,7 @@ func (c *PetAPIController) GetPetImageById(w http.ResponseWriter, r *http.Reques return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetsByTime - Get the pets by time @@ -354,7 +395,7 @@ func (c *PetAPIController) GetPetsByTime(w http.ResponseWriter, r *http.Request) params := mux.Vars(r) createdTimeParam, err := parseTime(params["createdTime"]) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "createdTime", Err: err}, nil) return } result, err := c.service.GetPetsByTime(r.Context(), createdTimeParam) @@ -364,7 +405,7 @@ func (c *PetAPIController) GetPetsByTime(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetsUsingBooleanQueryParameters - Get the pets by only using boolean query parameters @@ -381,7 +422,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "expr", Err: err}, nil) return } @@ -397,7 +438,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "grouping", Err: err}, nil) return } @@ -411,7 +452,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "inactive", Err: err}, nil) return } @@ -427,7 +468,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // SearchPet - Search Pets by filters @@ -444,7 +485,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "age", Err: err}, nil) return } @@ -458,7 +499,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[float32](parseFloat32), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "price", Err: err}, nil) return } @@ -469,7 +510,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { if query.Has("bornAfter"){ param, err := parseTime(query.Get("bornAfter")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornAfter", Err: err}, nil) return } @@ -483,7 +524,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "old", Err: err}, nil) return } @@ -497,7 +538,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePet - Update an existing pet @@ -524,7 +565,7 @@ func (c *PetAPIController) UpdatePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePetWithForm - Updates a pet in the store with form data @@ -539,7 +580,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -555,7 +596,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UploadFile - uploads an image @@ -570,7 +611,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -583,7 +624,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { { param, err := ReadFormFileToTempFile(r, "file") if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "file", Err: err}, nil) return } @@ -598,7 +639,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UploadFileArrayOfFiles - uploads images (array of files) @@ -613,7 +654,7 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -623,7 +664,7 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http { param, err := ReadFormFilesToTempFiles(r, "files") if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "files", Err: err}, nil) return } @@ -638,5 +679,5 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-api-server/go/api_pet_service.go b/samples/server/petstore/go-api-server/go/api_pet_service.go index f5e64cba3cb..9786bd5f71a 100644 --- a/samples/server/petstore/go-api-server/go/api_pet_service.go +++ b/samples/server/petstore/go-api-server/go/api_pet_service.go @@ -25,7 +25,7 @@ type PetAPIService struct { } // NewPetAPIService creates a default api service -func NewPetAPIService() PetAPIServicer { +func NewPetAPIService() *PetAPIService { return &PetAPIService{} } @@ -69,7 +69,7 @@ func (s *PetAPIService) FilterPetsByCategory(ctx context.Context, gender Gender, } // FindPetsByStatus - Finds Pets by status -func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string) (ImplResponse, error) { +func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string, defaultInt int32, defaultNum float32, defaultStr string) (ImplResponse, error) { // TODO - update FindPetsByStatus with the required logic for this service method. // Add api_pet_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. diff --git a/samples/server/petstore/go-api-server/go/api_store.go b/samples/server/petstore/go-api-server/go/api_store.go index c5a72265828..cc1caead0e8 100644 --- a/samples/server/petstore/go-api-server/go/api_store.go +++ b/samples/server/petstore/go-api-server/go/api_store.go @@ -35,7 +35,7 @@ func WithStoreAPIErrorHandler(h ErrorHandler) StoreAPIOption { } // NewStoreAPIController creates a default api controller -func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) Router { +func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) *StoreAPIController { controller := &StoreAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -89,7 +89,7 @@ func (c *StoreAPIController) DeleteOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetInventory - Returns pet inventories by status @@ -101,7 +101,7 @@ func (c *StoreAPIController) GetInventory(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetOrderById - Find purchase order by ID @@ -114,7 +114,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request WithMaximum[int64](5), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "orderId", Err: err}, nil) return } result, err := c.service.GetOrderById(r.Context(), orderIdParam) @@ -124,7 +124,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // PlaceOrder - Place an order for a pet @@ -151,5 +151,5 @@ func (c *StoreAPIController) PlaceOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-api-server/go/api_store_service.go b/samples/server/petstore/go-api-server/go/api_store_service.go index ee41bf5fdd3..46671f7a9fd 100644 --- a/samples/server/petstore/go-api-server/go/api_store_service.go +++ b/samples/server/petstore/go-api-server/go/api_store_service.go @@ -23,7 +23,7 @@ type StoreAPIService struct { } // NewStoreAPIService creates a default api service -func NewStoreAPIService() StoreAPIServicer { +func NewStoreAPIService() *StoreAPIService { return &StoreAPIService{} } diff --git a/samples/server/petstore/go-api-server/go/api_user.go b/samples/server/petstore/go-api-server/go/api_user.go index 0acd09d0b35..f1917fa9b78 100644 --- a/samples/server/petstore/go-api-server/go/api_user.go +++ b/samples/server/petstore/go-api-server/go/api_user.go @@ -35,7 +35,7 @@ func WithUserAPIErrorHandler(h ErrorHandler) UserAPIOption { } // NewUserAPIController creates a default api controller -func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) Router { +func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) *UserAPIController { controller := &UserAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -118,7 +118,7 @@ func (c *UserAPIController) CreateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithArrayInput - Creates list of users with given input array @@ -143,7 +143,7 @@ func (c *UserAPIController) CreateUsersWithArrayInput(w http.ResponseWriter, r * return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithListInput - Creates list of users with given input array @@ -168,7 +168,7 @@ func (c *UserAPIController) CreateUsersWithListInput(w http.ResponseWriter, r *h return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeleteUser - Delete user @@ -184,28 +184,28 @@ func (c *UserAPIController) DeleteUser(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &RequiredError{"username"}, nil) return } - var booleanTestParam bool - if query.Has("boolean_test") { + var confirmationParam bool + if query.Has("confirmation") { param, err := parseBoolParameter( - query.Get("boolean_test"), + query.Get("confirmation"), WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "confirmation", Err: err}, nil) return } - booleanTestParam = param + confirmationParam = param } else { } - result, err := c.service.DeleteUser(r.Context(), usernameParam, booleanTestParam) + result, err := c.service.DeleteUser(r.Context(), usernameParam, confirmationParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetUserByName - Get user by user name @@ -223,7 +223,7 @@ func (c *UserAPIController) GetUserByName(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LoginUser - Logs user into the system @@ -251,28 +251,28 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &RequiredError{Field: "password"}, nil) return } - var booleanTestParam bool - if query.Has("boolean_test") { + var rememberMeParam bool + if query.Has("remember_me") { param, err := parseBoolParameter( - query.Get("boolean_test"), + query.Get("remember_me"), WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "remember_me", Err: err}, nil) return } - booleanTestParam = param + rememberMeParam = param } else { } - result, err := c.service.LoginUser(r.Context(), usernameParam, passwordParam, booleanTestParam) + result, err := c.service.LoginUser(r.Context(), usernameParam, passwordParam, rememberMeParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LogoutUser - Logs out current logged in user session @@ -284,7 +284,7 @@ func (c *UserAPIController) LogoutUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdateUser - Updated user @@ -317,5 +317,5 @@ func (c *UserAPIController) UpdateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-api-server/go/api_user_service.go b/samples/server/petstore/go-api-server/go/api_user_service.go index e1353ffab53..62332a09da4 100644 --- a/samples/server/petstore/go-api-server/go/api_user_service.go +++ b/samples/server/petstore/go-api-server/go/api_user_service.go @@ -23,7 +23,7 @@ type UserAPIService struct { } // NewUserAPIService creates a default api service -func NewUserAPIService() UserAPIServicer { +func NewUserAPIService() *UserAPIService { return &UserAPIService{} } @@ -61,7 +61,7 @@ func (s *UserAPIService) CreateUsersWithListInput(ctx context.Context, user []Us } // DeleteUser - Delete user -func (s *UserAPIService) DeleteUser(ctx context.Context, username string, booleanTest bool) (ImplResponse, error) { +func (s *UserAPIService) DeleteUser(ctx context.Context, username string, confirmation bool) (ImplResponse, error) { // TODO - update DeleteUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. @@ -92,7 +92,7 @@ func (s *UserAPIService) GetUserByName(ctx context.Context, username string) (Im } // LoginUser - Logs user into the system -func (s *UserAPIService) LoginUser(ctx context.Context, username string, password string, booleanTest bool) (ImplResponse, error) { +func (s *UserAPIService) LoginUser(ctx context.Context, username string, password string, rememberMe bool) (ImplResponse, error) { // TODO - update LoginUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. diff --git a/samples/server/petstore/go-api-server/go/error.go b/samples/server/petstore/go-api-server/go/error.go index ee1d5f1f33f..ba23f89b838 100644 --- a/samples/server/petstore/go-api-server/go/error.go +++ b/samples/server/petstore/go-api-server/go/error.go @@ -23,7 +23,8 @@ var ( // ParsingError indicates that an error has occurred when parsing request parameters type ParsingError struct { - Err error + Param string + Err error } func (e *ParsingError) Unwrap() error { @@ -31,7 +32,11 @@ func (e *ParsingError) Unwrap() error { } func (e *ParsingError) Error() string { - return e.Err.Error() + if e.Param == "" { + return e.Err.Error() + } + + return e.Param + ": " + e.Err.Error() } // RequiredError indicates that an error has occurred when parsing request parameters @@ -49,15 +54,21 @@ type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result // DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing // request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. -func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) { - if _, ok := err.(*ParsingError); ok { +func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *ImplResponse) { + var parsingErr *ParsingError + if ok := errors.As(err, &parsingErr); ok { // Handle parsing errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) - } else if _, ok := err.(*RequiredError); ok { - // Handle missing required errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) - } else { - // Handle all other errors - EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) + return } + + var requiredErr *RequiredError + if ok := errors.As(err, &requiredErr); ok { + // Handle missing required errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) + return + } + + // Handle all other errors + _ = EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-api-server/go/helpers.go b/samples/server/petstore/go-api-server/go/helpers.go index 886c0c9a17d..027954b0c9b 100644 --- a/samples/server/petstore/go-api-server/go/helpers.go +++ b/samples/server/petstore/go-api-server/go/helpers.go @@ -61,7 +61,7 @@ func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) err // If it is a slice we continue recursion case reflect.Slice: - for i := 0; i < value.Len(); i += 1 { + for i := 0; i < value.Len(); i++ { if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { return err } diff --git a/samples/server/petstore/go-api-server/go/model_an_object.go b/samples/server/petstore/go-api-server/go/model_an_object.go index e5bdcff2495..b5b8e6c5276 100644 --- a/samples/server/petstore/go-api-server/go/model_an_object.go +++ b/samples/server/petstore/go-api-server/go/model_an_object.go @@ -37,5 +37,13 @@ func AssertAnObjectRequired(obj AnObject) error { // AssertAnObjectConstraints checks if the values respects the defined constraints func AssertAnObjectConstraints(obj AnObject) error { + if err := AssertTagConstraints(obj.Tag); err != nil { + return err + } + for _, el := range obj.Pet { + if err := AssertPetConstraints(el); err != nil { + return err + } + } return nil } diff --git a/samples/server/petstore/go-api-server/go/model_colour.go b/samples/server/petstore/go-api-server/go/model_colour.go index cb360eb0655..a77312b6537 100644 --- a/samples/server/petstore/go-api-server/go/model_colour.go +++ b/samples/server/petstore/go-api-server/go/model_colour.go @@ -49,9 +49,9 @@ func NewColourFromValue(v string) (Colour, error) { ev := Colour(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Colour: valid values are %v", v, AllowedColourEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Colour: valid values are %v", v, AllowedColourEnumValues) } diff --git a/samples/server/petstore/go-api-server/go/model_gender.go b/samples/server/petstore/go-api-server/go/model_gender.go index 20b8702c875..410b61fd08d 100644 --- a/samples/server/petstore/go-api-server/go/model_gender.go +++ b/samples/server/petstore/go-api-server/go/model_gender.go @@ -49,9 +49,9 @@ func NewGenderFromValue(v string) (Gender, error) { ev := Gender(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Gender: valid values are %v", v, AllowedGenderEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Gender: valid values are %v", v, AllowedGenderEnumValues) } diff --git a/samples/server/petstore/go-api-server/go/model_pet.go b/samples/server/petstore/go-api-server/go/model_pet.go index 48537769fb0..38a5af1d393 100644 --- a/samples/server/petstore/go-api-server/go/model_pet.go +++ b/samples/server/petstore/go-api-server/go/model_pet.go @@ -60,5 +60,17 @@ func AssertPetRequired(obj Pet) error { // AssertPetConstraints checks if the values respects the defined constraints func AssertPetConstraints(obj Pet) error { + if obj.Category != nil { + if err := AssertCategoryConstraints(*obj.Category); err != nil { + return err + } + } + if obj.Tags != nil { + for _, el := range *obj.Tags { + if err := AssertTagConstraints(el); err != nil { + return err + } + } + } return nil } diff --git a/samples/server/petstore/go-api-server/go/model_species.go b/samples/server/petstore/go-api-server/go/model_species.go index 6384f20c948..f236e29c48a 100644 --- a/samples/server/petstore/go-api-server/go/model_species.go +++ b/samples/server/petstore/go-api-server/go/model_species.go @@ -58,9 +58,9 @@ func NewSpeciesFromValue(v string) (Species, error) { ev := Species(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Species: valid values are %v", v, AllowedSpeciesEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Species: valid values are %v", v, AllowedSpeciesEnumValues) } diff --git a/samples/server/petstore/go-api-server/go/model_user.go b/samples/server/petstore/go-api-server/go/model_user.go index 973b8986d38..29803083edb 100644 --- a/samples/server/petstore/go-api-server/go/model_user.go +++ b/samples/server/petstore/go-api-server/go/model_user.go @@ -64,5 +64,13 @@ func AssertUserRequired(obj User) error { // AssertUserConstraints checks if the values respects the defined constraints func AssertUserConstraints(obj User) error { + if obj.DeepSliceModel != nil { + if err := AssertRecurseInterfaceRequired(*obj.DeepSliceModel, AssertTagConstraints); err != nil { + return err + } + } + if err := AssertRecurseInterfaceRequired(obj.DeepSliceMap, AssertAnObjectConstraints); err != nil { + return err + } return nil } diff --git a/samples/server/petstore/go-api-server/go/routers.go b/samples/server/petstore/go-api-server/go/routers.go index 1d49cd139b2..183a2d8d10f 100644 --- a/samples/server/petstore/go-api-server/go/routers.go +++ b/samples/server/petstore/go-api-server/go/routers.go @@ -48,8 +48,7 @@ func NewRouter(routers ...Router) *mux.Router { router := mux.NewRouter().StrictSlash(true) for _, api := range routers { for name, route := range api.Routes() { - var handler http.Handler - handler = route.HandlerFunc + var handler http.Handler = route.HandlerFunc handler = Logger(handler, name) router. @@ -345,7 +344,7 @@ func parseNumericArrayParameter[T Number](param, delim string, required bool, fn } -// parseQuery parses query paramaters and returns an error if any malformed value pairs are encountered. +// parseQuery parses query parameters and returns an error if any malformed value pairs are encountered. func parseQuery(rawQuery string) (url.Values, error) { return url.ParseQuery(rawQuery) } \ No newline at end of file diff --git a/samples/server/petstore/go-chi-server/api/openapi.yaml b/samples/server/petstore/go-chi-server/api/openapi.yaml index 65a86866857..f309214557f 100644 --- a/samples/server/petstore/go-chi-server/api/openapi.yaml +++ b/samples/server/petstore/go-chi-server/api/openapi.yaml @@ -105,6 +105,30 @@ paths: - OPTION_3 type: string style: form + - explode: true + in: query + name: defaultInt + required: false + schema: + default: 1 + type: integer + style: form + - explode: true + in: query + name: defaultNum + required: false + schema: + default: 1.5 + type: number + style: form + - explode: true + in: query + name: defaultStr + required: false + schema: + default: default + type: string + style: form - deprecated: true description: Status values that need to be considered for filter explode: false @@ -631,10 +655,10 @@ paths: schema: type: string style: form - - description: The password for login in clear text + - description: Remember Me explode: true in: query - name: boolean_test + name: remember_me required: false schema: type: boolean @@ -702,10 +726,10 @@ paths: schema: type: string style: simple - - description: boolean query parameter + - description: Confirm the deletion explode: true in: query - name: boolean_test + name: confirmation required: false schema: type: boolean diff --git a/samples/server/petstore/go-chi-server/go/api.go b/samples/server/petstore/go-chi-server/go/api.go index 4d4ab7fc38b..23d5213c5a6 100644 --- a/samples/server/petstore/go-chi-server/go/api.go +++ b/samples/server/petstore/go-chi-server/go/api.go @@ -71,7 +71,7 @@ type PetAPIServicer interface { AddPet(context.Context, Pet) (ImplResponse, error) DeletePet(context.Context, int64, string) (ImplResponse, error) FilterPetsByCategory(context.Context, Gender, Species, []Species) (ImplResponse, error) - FindPetsByStatus(context.Context, []string, string, string) (ImplResponse, error) + FindPetsByStatus(context.Context, []string, string, string, int32, float32, string) (ImplResponse, error) // Deprecated FindPetsByTags(context.Context, []string, time.Time, time.Time, Colour) (ImplResponse, error) GetPetById(context.Context, int64) (ImplResponse, error) diff --git a/samples/server/petstore/go-chi-server/go/api_pet.go b/samples/server/petstore/go-chi-server/go/api_pet.go index a15a17c24b0..a4b5448a068 100644 --- a/samples/server/petstore/go-chi-server/go/api_pet.go +++ b/samples/server/petstore/go-chi-server/go/api_pet.go @@ -37,7 +37,7 @@ func WithPetAPIErrorHandler(h ErrorHandler) PetAPIOption { } // NewPetAPIController creates a default api controller -func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) Router { +func NewPetAPIController(s PetAPIServicer, opts ...PetAPIOption) *PetAPIController { controller := &PetAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -150,7 +150,7 @@ func (c *PetAPIController) AddPet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeletePet - Deletes a pet @@ -160,7 +160,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } apiKeyParam := r.Header.Get("api_key") @@ -171,7 +171,7 @@ func (c *PetAPIController) DeletePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FilterPetsByCategory - Finds Pets @@ -183,7 +183,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R } genderParam, err := NewGenderFromValue(chi.URLParam(r, "gender")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "gender", Err: err}, nil) return } var speciesParam Species @@ -202,7 +202,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R for _, param := range paramSplits { paramEnum, err := NewSpeciesFromValue(param) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "notSpecies", Err: err}, nil) return } notSpeciesParam = append(notSpeciesParam, paramEnum) @@ -215,7 +215,7 @@ func (c *PetAPIController) FilterPetsByCategory(w http.ResponseWriter, r *http.R return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByStatus - Finds Pets by status @@ -241,14 +241,55 @@ func (c *PetAPIController) FindPetsByStatus(w http.ResponseWriter, r *http.Reque inlineEnumParam = param } else { } - result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam) + var defaultIntParam int32 + if query.Has("defaultInt") { + param, err := parseNumericParameter[int32]( + query.Get("defaultInt"), + WithParse[int32](parseInt32), + ) + if err != nil { + c.errorHandler(w, r, &ParsingError{Param: "defaultInt", Err: err}, nil) + return + } + + defaultIntParam = param + } else { + var param int32 = 1 + defaultIntParam = param + } + var defaultNumParam float32 + if query.Has("defaultNum") { + param, err := parseNumericParameter[float32]( + query.Get("defaultNum"), + WithParse[float32](parseFloat32), + ) + if err != nil { + c.errorHandler(w, r, &ParsingError{Param: "defaultNum", Err: err}, nil) + return + } + + defaultNumParam = param + } else { + var param float32 = 1.5 + defaultNumParam = param + } + var defaultStrParam string + if query.Has("defaultStr") { + param := query.Get("defaultStr") + + defaultStrParam = param + } else { + param := "default" + defaultStrParam = param + } + result, err := c.service.FindPetsByStatus(r.Context(), statusParam, inlineEnumPathParam, inlineEnumParam, defaultIntParam, defaultNumParam, defaultStrParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // FindPetsByTags - Finds Pets by tags @@ -267,7 +308,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request if query.Has("bornAfter"){ param, err := parseTime(query.Get("bornAfter")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornAfter", Err: err}, nil) return } @@ -280,7 +321,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request if query.Has("bornBefore"){ param, err := parseTime(query.Get("bornBefore")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornBefore", Err: err}, nil) return } @@ -301,7 +342,7 @@ func (c *PetAPIController) FindPetsByTags(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetById - Find pet by ID @@ -311,7 +352,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } result, err := c.service.GetPetById(r.Context(), petIdParam) @@ -321,7 +362,7 @@ func (c *PetAPIController) GetPetById(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetImageById - Returns the image for the Pet that has been previously uploaded @@ -331,7 +372,7 @@ func (c *PetAPIController) GetPetImageById(w http.ResponseWriter, r *http.Reques WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } result, err := c.service.GetPetImageById(r.Context(), petIdParam) @@ -341,14 +382,14 @@ func (c *PetAPIController) GetPetImageById(w http.ResponseWriter, r *http.Reques return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetsByTime - Get the pets by time func (c *PetAPIController) GetPetsByTime(w http.ResponseWriter, r *http.Request) { createdTimeParam, err := parseTime(chi.URLParam(r, "createdTime")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "createdTime", Err: err}, nil) return } result, err := c.service.GetPetsByTime(r.Context(), createdTimeParam) @@ -358,7 +399,7 @@ func (c *PetAPIController) GetPetsByTime(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetPetsUsingBooleanQueryParameters - Get the pets by only using boolean query parameters @@ -375,7 +416,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "expr", Err: err}, nil) return } @@ -391,7 +432,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "grouping", Err: err}, nil) return } @@ -405,7 +446,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "inactive", Err: err}, nil) return } @@ -421,7 +462,7 @@ func (c *PetAPIController) GetPetsUsingBooleanQueryParameters(w http.ResponseWri return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // SearchPet - Search Pets by filters @@ -438,7 +479,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "age", Err: err}, nil) return } @@ -452,7 +493,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[float32](parseFloat32), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "price", Err: err}, nil) return } @@ -463,7 +504,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { if query.Has("bornAfter"){ param, err := parseTime(query.Get("bornAfter")) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "bornAfter", Err: err}, nil) return } @@ -477,7 +518,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "old", Err: err}, nil) return } @@ -491,7 +532,7 @@ func (c *PetAPIController) SearchPet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePet - Update an existing pet @@ -518,7 +559,7 @@ func (c *PetAPIController) UpdatePet(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdatePetWithForm - Updates a pet in the store with form data @@ -532,7 +573,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -548,7 +589,7 @@ func (c *PetAPIController) UpdatePetWithForm(w http.ResponseWriter, r *http.Requ return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UploadFile - uploads an image @@ -562,7 +603,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -575,7 +616,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { { param, err := ReadFormFileToTempFile(r, "file") if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "file", Err: err}, nil) return } @@ -590,7 +631,7 @@ func (c *PetAPIController) UploadFile(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UploadFileArrayOfFiles - uploads images (array of files) @@ -604,7 +645,7 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http WithRequire[int64](parseInt64), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "petId", Err: err}, nil) return } @@ -614,7 +655,7 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http { param, err := ReadFormFilesToTempFiles(r, "files") if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "files", Err: err}, nil) return } @@ -629,5 +670,5 @@ func (c *PetAPIController) UploadFileArrayOfFiles(w http.ResponseWriter, r *http return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-chi-server/go/api_pet_service.go b/samples/server/petstore/go-chi-server/go/api_pet_service.go index f5e64cba3cb..9786bd5f71a 100644 --- a/samples/server/petstore/go-chi-server/go/api_pet_service.go +++ b/samples/server/petstore/go-chi-server/go/api_pet_service.go @@ -25,7 +25,7 @@ type PetAPIService struct { } // NewPetAPIService creates a default api service -func NewPetAPIService() PetAPIServicer { +func NewPetAPIService() *PetAPIService { return &PetAPIService{} } @@ -69,7 +69,7 @@ func (s *PetAPIService) FilterPetsByCategory(ctx context.Context, gender Gender, } // FindPetsByStatus - Finds Pets by status -func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string) (ImplResponse, error) { +func (s *PetAPIService) FindPetsByStatus(ctx context.Context, status []string, inlineEnumPath string, inlineEnum string, defaultInt int32, defaultNum float32, defaultStr string) (ImplResponse, error) { // TODO - update FindPetsByStatus with the required logic for this service method. // Add api_pet_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. diff --git a/samples/server/petstore/go-chi-server/go/api_store.go b/samples/server/petstore/go-chi-server/go/api_store.go index 51b0c7fbb7c..e364efe3988 100644 --- a/samples/server/petstore/go-chi-server/go/api_store.go +++ b/samples/server/petstore/go-chi-server/go/api_store.go @@ -35,7 +35,7 @@ func WithStoreAPIErrorHandler(h ErrorHandler) StoreAPIOption { } // NewStoreAPIController creates a default api controller -func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) Router { +func NewStoreAPIController(s StoreAPIServicer, opts ...StoreAPIOption) *StoreAPIController { controller := &StoreAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -88,7 +88,7 @@ func (c *StoreAPIController) DeleteOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetInventory - Returns pet inventories by status @@ -100,7 +100,7 @@ func (c *StoreAPIController) GetInventory(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetOrderById - Find purchase order by ID @@ -112,7 +112,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request WithMaximum[int64](5), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "orderId", Err: err}, nil) return } result, err := c.service.GetOrderById(r.Context(), orderIdParam) @@ -122,7 +122,7 @@ func (c *StoreAPIController) GetOrderById(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // PlaceOrder - Place an order for a pet @@ -149,5 +149,5 @@ func (c *StoreAPIController) PlaceOrder(w http.ResponseWriter, r *http.Request) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-chi-server/go/api_store_service.go b/samples/server/petstore/go-chi-server/go/api_store_service.go index ee41bf5fdd3..46671f7a9fd 100644 --- a/samples/server/petstore/go-chi-server/go/api_store_service.go +++ b/samples/server/petstore/go-chi-server/go/api_store_service.go @@ -23,7 +23,7 @@ type StoreAPIService struct { } // NewStoreAPIService creates a default api service -func NewStoreAPIService() StoreAPIServicer { +func NewStoreAPIService() *StoreAPIService { return &StoreAPIService{} } diff --git a/samples/server/petstore/go-chi-server/go/api_user.go b/samples/server/petstore/go-chi-server/go/api_user.go index 3fdefa65fc3..9fd0c1c5fc7 100644 --- a/samples/server/petstore/go-chi-server/go/api_user.go +++ b/samples/server/petstore/go-chi-server/go/api_user.go @@ -35,7 +35,7 @@ func WithUserAPIErrorHandler(h ErrorHandler) UserAPIOption { } // NewUserAPIController creates a default api controller -func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) Router { +func NewUserAPIController(s UserAPIServicer, opts ...UserAPIOption) *UserAPIController { controller := &UserAPIController{ service: s, errorHandler: DefaultErrorHandler, @@ -118,7 +118,7 @@ func (c *UserAPIController) CreateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithArrayInput - Creates list of users with given input array @@ -143,7 +143,7 @@ func (c *UserAPIController) CreateUsersWithArrayInput(w http.ResponseWriter, r * return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // CreateUsersWithListInput - Creates list of users with given input array @@ -168,7 +168,7 @@ func (c *UserAPIController) CreateUsersWithListInput(w http.ResponseWriter, r *h return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // DeleteUser - Delete user @@ -183,28 +183,28 @@ func (c *UserAPIController) DeleteUser(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &RequiredError{"username"}, nil) return } - var booleanTestParam bool - if query.Has("boolean_test") { + var confirmationParam bool + if query.Has("confirmation") { param, err := parseBoolParameter( - query.Get("boolean_test"), + query.Get("confirmation"), WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "confirmation", Err: err}, nil) return } - booleanTestParam = param + confirmationParam = param } else { } - result, err := c.service.DeleteUser(r.Context(), usernameParam, booleanTestParam) + result, err := c.service.DeleteUser(r.Context(), usernameParam, confirmationParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // GetUserByName - Get user by user name @@ -221,7 +221,7 @@ func (c *UserAPIController) GetUserByName(w http.ResponseWriter, r *http.Request return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LoginUser - Logs user into the system @@ -249,28 +249,28 @@ func (c *UserAPIController) LoginUser(w http.ResponseWriter, r *http.Request) { c.errorHandler(w, r, &RequiredError{Field: "password"}, nil) return } - var booleanTestParam bool - if query.Has("boolean_test") { + var rememberMeParam bool + if query.Has("remember_me") { param, err := parseBoolParameter( - query.Get("boolean_test"), + query.Get("remember_me"), WithParse[bool](parseBool), ) if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) + c.errorHandler(w, r, &ParsingError{Param: "remember_me", Err: err}, nil) return } - booleanTestParam = param + rememberMeParam = param } else { } - result, err := c.service.LoginUser(r.Context(), usernameParam, passwordParam, booleanTestParam) + result, err := c.service.LoginUser(r.Context(), usernameParam, passwordParam, rememberMeParam) // If an error occurred, encode the error with the status code if err != nil { c.errorHandler(w, r, err, &result) return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // LogoutUser - Logs out current logged in user session @@ -282,7 +282,7 @@ func (c *UserAPIController) LogoutUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } // UpdateUser - Updated user @@ -314,5 +314,5 @@ func (c *UserAPIController) UpdateUser(w http.ResponseWriter, r *http.Request) { return } // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) + _ = EncodeJSONResponse(result.Body, &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-chi-server/go/api_user_service.go b/samples/server/petstore/go-chi-server/go/api_user_service.go index e1353ffab53..62332a09da4 100644 --- a/samples/server/petstore/go-chi-server/go/api_user_service.go +++ b/samples/server/petstore/go-chi-server/go/api_user_service.go @@ -23,7 +23,7 @@ type UserAPIService struct { } // NewUserAPIService creates a default api service -func NewUserAPIService() UserAPIServicer { +func NewUserAPIService() *UserAPIService { return &UserAPIService{} } @@ -61,7 +61,7 @@ func (s *UserAPIService) CreateUsersWithListInput(ctx context.Context, user []Us } // DeleteUser - Delete user -func (s *UserAPIService) DeleteUser(ctx context.Context, username string, booleanTest bool) (ImplResponse, error) { +func (s *UserAPIService) DeleteUser(ctx context.Context, username string, confirmation bool) (ImplResponse, error) { // TODO - update DeleteUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. @@ -92,7 +92,7 @@ func (s *UserAPIService) GetUserByName(ctx context.Context, username string) (Im } // LoginUser - Logs user into the system -func (s *UserAPIService) LoginUser(ctx context.Context, username string, password string, booleanTest bool) (ImplResponse, error) { +func (s *UserAPIService) LoginUser(ctx context.Context, username string, password string, rememberMe bool) (ImplResponse, error) { // TODO - update LoginUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. diff --git a/samples/server/petstore/go-chi-server/go/error.go b/samples/server/petstore/go-chi-server/go/error.go index ee1d5f1f33f..ba23f89b838 100644 --- a/samples/server/petstore/go-chi-server/go/error.go +++ b/samples/server/petstore/go-chi-server/go/error.go @@ -23,7 +23,8 @@ var ( // ParsingError indicates that an error has occurred when parsing request parameters type ParsingError struct { - Err error + Param string + Err error } func (e *ParsingError) Unwrap() error { @@ -31,7 +32,11 @@ func (e *ParsingError) Unwrap() error { } func (e *ParsingError) Error() string { - return e.Err.Error() + if e.Param == "" { + return e.Err.Error() + } + + return e.Param + ": " + e.Err.Error() } // RequiredError indicates that an error has occurred when parsing request parameters @@ -49,15 +54,21 @@ type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result // DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing // request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used. -func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse) { - if _, ok := err.(*ParsingError); ok { +func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *ImplResponse) { + var parsingErr *ParsingError + if ok := errors.As(err, &parsingErr); ok { // Handle parsing errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) - } else if _, ok := err.(*RequiredError); ok { - // Handle missing required errors - EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) - } else { - // Handle all other errors - EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusBadRequest), map[string][]string{}, w) + return } + + var requiredErr *RequiredError + if ok := errors.As(err, &requiredErr); ok { + // Handle missing required errors + _ = EncodeJSONResponse(err.Error(), func(i int) *int { return &i }(http.StatusUnprocessableEntity), map[string][]string{}, w) + return + } + + // Handle all other errors + _ = EncodeJSONResponse(err.Error(), &result.Code, result.Headers, w) } diff --git a/samples/server/petstore/go-chi-server/go/helpers.go b/samples/server/petstore/go-chi-server/go/helpers.go index 886c0c9a17d..027954b0c9b 100644 --- a/samples/server/petstore/go-chi-server/go/helpers.go +++ b/samples/server/petstore/go-chi-server/go/helpers.go @@ -61,7 +61,7 @@ func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) err // If it is a slice we continue recursion case reflect.Slice: - for i := 0; i < value.Len(); i += 1 { + for i := 0; i < value.Len(); i++ { if err := AssertRecurseValueRequired(value.Index(i), callback); err != nil { return err } diff --git a/samples/server/petstore/go-chi-server/go/model_an_object.go b/samples/server/petstore/go-chi-server/go/model_an_object.go index e5bdcff2495..b5b8e6c5276 100644 --- a/samples/server/petstore/go-chi-server/go/model_an_object.go +++ b/samples/server/petstore/go-chi-server/go/model_an_object.go @@ -37,5 +37,13 @@ func AssertAnObjectRequired(obj AnObject) error { // AssertAnObjectConstraints checks if the values respects the defined constraints func AssertAnObjectConstraints(obj AnObject) error { + if err := AssertTagConstraints(obj.Tag); err != nil { + return err + } + for _, el := range obj.Pet { + if err := AssertPetConstraints(el); err != nil { + return err + } + } return nil } diff --git a/samples/server/petstore/go-chi-server/go/model_colour.go b/samples/server/petstore/go-chi-server/go/model_colour.go index cb360eb0655..a77312b6537 100644 --- a/samples/server/petstore/go-chi-server/go/model_colour.go +++ b/samples/server/petstore/go-chi-server/go/model_colour.go @@ -49,9 +49,9 @@ func NewColourFromValue(v string) (Colour, error) { ev := Colour(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Colour: valid values are %v", v, AllowedColourEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Colour: valid values are %v", v, AllowedColourEnumValues) } diff --git a/samples/server/petstore/go-chi-server/go/model_gender.go b/samples/server/petstore/go-chi-server/go/model_gender.go index 20b8702c875..410b61fd08d 100644 --- a/samples/server/petstore/go-chi-server/go/model_gender.go +++ b/samples/server/petstore/go-chi-server/go/model_gender.go @@ -49,9 +49,9 @@ func NewGenderFromValue(v string) (Gender, error) { ev := Gender(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Gender: valid values are %v", v, AllowedGenderEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Gender: valid values are %v", v, AllowedGenderEnumValues) } diff --git a/samples/server/petstore/go-chi-server/go/model_pet.go b/samples/server/petstore/go-chi-server/go/model_pet.go index 48537769fb0..38a5af1d393 100644 --- a/samples/server/petstore/go-chi-server/go/model_pet.go +++ b/samples/server/petstore/go-chi-server/go/model_pet.go @@ -60,5 +60,17 @@ func AssertPetRequired(obj Pet) error { // AssertPetConstraints checks if the values respects the defined constraints func AssertPetConstraints(obj Pet) error { + if obj.Category != nil { + if err := AssertCategoryConstraints(*obj.Category); err != nil { + return err + } + } + if obj.Tags != nil { + for _, el := range *obj.Tags { + if err := AssertTagConstraints(el); err != nil { + return err + } + } + } return nil } diff --git a/samples/server/petstore/go-chi-server/go/model_species.go b/samples/server/petstore/go-chi-server/go/model_species.go index 6384f20c948..f236e29c48a 100644 --- a/samples/server/petstore/go-chi-server/go/model_species.go +++ b/samples/server/petstore/go-chi-server/go/model_species.go @@ -58,9 +58,9 @@ func NewSpeciesFromValue(v string) (Species, error) { ev := Species(v) if ev.IsValid() { return ev, nil - } else { - return "", fmt.Errorf("invalid value '%v' for Species: valid values are %v", v, AllowedSpeciesEnumValues) } + + return "", fmt.Errorf("invalid value '%v' for Species: valid values are %v", v, AllowedSpeciesEnumValues) } diff --git a/samples/server/petstore/go-chi-server/go/model_user.go b/samples/server/petstore/go-chi-server/go/model_user.go index 973b8986d38..29803083edb 100644 --- a/samples/server/petstore/go-chi-server/go/model_user.go +++ b/samples/server/petstore/go-chi-server/go/model_user.go @@ -64,5 +64,13 @@ func AssertUserRequired(obj User) error { // AssertUserConstraints checks if the values respects the defined constraints func AssertUserConstraints(obj User) error { + if obj.DeepSliceModel != nil { + if err := AssertRecurseInterfaceRequired(*obj.DeepSliceModel, AssertTagConstraints); err != nil { + return err + } + } + if err := AssertRecurseInterfaceRequired(obj.DeepSliceMap, AssertAnObjectConstraints); err != nil { + return err + } return nil } diff --git a/samples/server/petstore/go-chi-server/go/routers.go b/samples/server/petstore/go-chi-server/go/routers.go index ef9200e0a24..4d662e273c5 100644 --- a/samples/server/petstore/go-chi-server/go/routers.go +++ b/samples/server/petstore/go-chi-server/go/routers.go @@ -50,8 +50,7 @@ func NewRouter(routers ...Router) chi.Router { router.Use(middleware.Logger) for _, api := range routers { for _, route := range api.Routes() { - var handler http.Handler - handler = route.HandlerFunc + var handler http.Handler = route.HandlerFunc router.Method(route.Method, route.Pattern, handler) } } @@ -341,7 +340,7 @@ func parseNumericArrayParameter[T Number](param, delim string, required bool, fn } -// parseQuery parses query paramaters and returns an error if any malformed value pairs are encountered. +// parseQuery parses query parameters and returns an error if any malformed value pairs are encountered. func parseQuery(rawQuery string) (url.Values, error) { return url.ParseQuery(rawQuery) } \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server-interface-only/go.mod b/samples/server/petstore/go-gin-api-server-interface-only/go.mod index ce17c60f098..bbdae40128c 100644 --- a/samples/server/petstore/go-gin-api-server-interface-only/go.mod +++ b/samples/server/petstore/go-gin-api-server-interface-only/go.mod @@ -24,7 +24,7 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/samples/server/petstore/go-gin-api-server/go.mod b/samples/server/petstore/go-gin-api-server/go.mod index ce17c60f098..bbdae40128c 100644 --- a/samples/server/petstore/go-gin-api-server/go.mod +++ b/samples/server/petstore/go-gin-api-server/go.mod @@ -24,7 +24,7 @@ require ( github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator/FILES similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES rename to samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator/FILES diff --git a/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v3/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/v3/mp/README.md similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/README.md rename to samples/server/petstore/java-helidon-server/v3/mp/README.md diff --git a/samples/server/petstore/java-helidon-server/mp/pom.xml b/samples/server/petstore/java-helidon-server/v3/mp/pom.xml similarity index 98% rename from samples/server/petstore/java-helidon-server/mp/pom.xml rename to samples/server/petstore/java-helidon-server/v3/mp/pom.xml index 0db90e2ff95..3785894d4b9 100644 --- a/samples/server/petstore/java-helidon-server/mp/pom.xml +++ b/samples/server/petstore/java-helidon-server/v3/mp/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-mp - 3.0.1 + 3.2.7 petstore-helidon-server-mp diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/RestApplication.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/RestApplication.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/DefaultService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/DefaultService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/PetService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/PetService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/StoreService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/StoreService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/UserService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/UserService.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Animal.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Animal.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ArrayTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Capitalization.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Capitalization.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Cat.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Cat.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Category.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Category.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ClassModel.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ClassModel.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Client.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Client.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Dog.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Dog.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumArrays.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumArrays.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumClass.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/EnumTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Foo.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Foo.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FormatTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/FormatTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/MapTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/MapTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Model200Response.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Model200Response.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelFile.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelFile.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelList.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelList.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelReturn.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ModelReturn.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Name.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Name.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/NullableClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/NullableClass.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/NumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/NumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Order.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Order.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterComposite.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterComposite.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnum.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnum.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java similarity index 98% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java index 3ea71056eb0..67de84d392d 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -31,7 +31,7 @@ public class ParentWithNullable { public enum TypeEnum { - CHILDWITHNULLABLE(String.valueOf("ChildWithNullable")); + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); private String value; diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Pet.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Pet.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/SingleRefType.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/SingleRefType.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Tag.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/Tag.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/User.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/package-info.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/java/org/openapitools/server/package-info.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/beans.xml similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/beans.xml diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/microprofile-config.properties similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/microprofile-config.properties diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/META-INF/openapi.yml diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/logging.properties similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties rename to samples/server/petstore/java-helidon-server/v3/mp/src/main/resources/logging.properties diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java index 87b0cf9126e..f6e06fc52a2 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java @@ -16,7 +16,6 @@ import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for AdditionalPropertiesClass */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java similarity index 91% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java index 83a14ba8273..61816df9b40 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java @@ -12,10 +12,11 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.SingleRefType; import org.junit.jupiter.api.Test; - /** * Model tests for AllOfWithSingleRef */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AnimalTest.java similarity index 93% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AnimalTest.java index 1299d46ba6f..9a3043089ff 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/AnimalTest.java @@ -15,11 +15,8 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; import org.junit.jupiter.api.Test; - /** * Model tests for Animal */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java index d67cac0b059..90060def339 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java @@ -14,10 +14,10 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java index 150ba7b070d..4a0fa46c97d 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java @@ -14,10 +14,10 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfNumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java index a2d4f750e1c..f7cc01228ea 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java @@ -13,11 +13,11 @@ package org.openapitools.server.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.ReadOnlyFirst; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayTest */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java index 084a2885fc8..83b61a15b3e 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Capitalization */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CatTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CatTest.java index 121dcc9756d..dac6fe61116 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CatTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Cat */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CategoryTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CategoryTest.java index 2618c8fd934..02b10b94255 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Category */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java index f62de6d1cc0..a16d0d7af9e 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for ClassModel */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClientTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClientTest.java index a9f4c21ebf8..3edb9feb3d1 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ClientTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Client */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java index 9ad380437ce..e2eba67dc94 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for DeprecatedObject */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DogTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DogTest.java index 70765267f0a..8143306030f 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/DogTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Dog */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java index 42b3832090e..6d797b45ff8 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java @@ -15,10 +15,10 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for EnumArrays */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java index 9c02e17dac0..8fa14bec99a 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for EnumClass */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java index 7c95fed8bb8..fc60f14abf2 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java @@ -22,7 +22,6 @@ import org.openapitools.server.model.OuterEnumInteger; import org.openapitools.server.model.OuterEnumIntegerDefaultValue; import org.junit.jupiter.api.Test; - /** * Model tests for EnumTest */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java index fbabc01db3c..11b779605c7 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java @@ -13,11 +13,11 @@ package org.openapitools.server.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.ModelFile; import org.junit.jupiter.api.Test; - /** * Model tests for FileSchemaTestClass */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java index d0dc33cef52..83cb2f5ffb8 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.server.model.Foo; import org.junit.jupiter.api.Test; - /** * Model tests for FooGetDefaultResponse */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooTest.java index 39abe05aad6..9aecdffde70 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FooTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Foo */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java index 5d988452964..3226b83d99e 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -20,7 +20,6 @@ import java.time.OffsetDateTime; import java.util.UUID; import org.junit.jupiter.api.Test; - /** * Model tests for FormatTest */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java index 5a56ddcc24d..f247acac715 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for HasOnlyReadOnly */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java index be4be735e57..594a8baa95c 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Test; - /** * Model tests for HealthCheckResult */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MapTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MapTestTest.java index 3c6c9450be3..ab00e116e10 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MapTestTest.java @@ -18,7 +18,6 @@ import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for MapTest */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 9b15f918a9b..46eb7361ce6 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -19,7 +19,6 @@ import java.util.UUID; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java index 33b6d47572d..ad6f6db532c 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for Model200Response */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java index 43cb48513cf..47500c309d8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelApiResponse */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java index ff03280b7e5..21eafc087a2 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelFile */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelListTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelListTest.java index 7f228b19133..d073083d48a 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelListTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelList */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java index e6af66eb003..d84cff2fdb0 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelReturn */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NameTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NameTest.java index 13114ab4e7a..ac557c71d0d 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NameTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Name */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java index e2f2dd91bf7..a33acb6dd85 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java @@ -16,13 +16,13 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Test; - /** * Model tests for NullableClass */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java index dede232a8fa..8d154d78f6e 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for NumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java index 55cf9bedb07..75417286d72 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java @@ -14,11 +14,11 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.DeprecatedObject; import org.junit.jupiter.api.Test; - /** * Model tests for ObjectWithDeprecatedFields */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OrderTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OrderTest.java index 90607655525..8ac0b0fbdd0 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OrderTest.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; - /** * Model tests for Order */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java index f61dfbaf415..29769579ebf 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for OuterComposite */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java index 55d00b4918c..79a4bb7cf33 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumDefaultValue */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java index 6a5e46c6124..8b693a14661 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumIntegerDefaultValue */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java index d6c32e321da..bfc74779837 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumInteger */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java index 5ea29d21383..182b6b96418 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnum */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java similarity index 90% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java index d40c868a41b..e06cefec284 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java @@ -12,10 +12,11 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.OuterEnumInteger; import org.junit.jupiter.api.Test; - /** * Model tests for OuterObjectWithEnumProperty */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/PetTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/PetTest.java index bc913dd50a3..0beb36cbe36 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/PetTest.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -23,7 +24,6 @@ import org.openapitools.server.model.Category; import org.openapitools.server.model.Tag; import org.junit.jupiter.api.Test; - /** * Model tests for Pet */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java index 2fe4c7fc6b7..1cb2ad84642 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for ReadOnlyFirst */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java index 4ae2c23f4cb..a698b5ecb97 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for SingleRefType */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java index 809e043f8ec..45e482228ac 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for SpecialModelName */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/TagTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/TagTest.java index 4d0d708bf97..ead74db6880 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/TagTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Tag */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/UserTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java rename to samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/UserTest.java index ba936a20805..a9dbfb06ded 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java +++ b/samples/server/petstore/java-helidon-server/v3/mp/src/test/java/org/openapitools/server/model/UserTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for User */ diff --git a/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator/FILES similarity index 100% rename from samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES rename to samples/server/petstore/java-helidon-server/v3/se/.openapi-generator/FILES diff --git a/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v3/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/v3/se/README.md similarity index 100% rename from samples/server/petstore/java-helidon-server/se/README.md rename to samples/server/petstore/java-helidon-server/v3/se/README.md diff --git a/samples/server/petstore/java-helidon-server/se/pom.xml b/samples/server/petstore/java-helidon-server/v3/se/pom.xml similarity index 99% rename from samples/server/petstore/java-helidon-server/se/pom.xml rename to samples/server/petstore/java-helidon-server/v3/se/pom.xml index 6e12a4f22b2..99fa7a06554 100644 --- a/samples/server/petstore/java-helidon-server/se/pom.xml +++ b/samples/server/petstore/java-helidon-server/v3/se/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-se - 3.0.1 + 3.2.7 org.openapitools diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/Main.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/Main.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/DefaultService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/DefaultService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/JsonProvider.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/JsonProvider.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/PetService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/PetService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/StoreService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/StoreService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/UserService.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/UserService.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Animal.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Animal.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ArrayTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Capitalization.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Capitalization.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Cat.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Cat.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Category.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Category.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ClassModel.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ClassModel.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Client.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Client.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Dog.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Dog.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumArrays.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumArrays.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumClass.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/EnumTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Foo.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Foo.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FormatTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/FormatTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/MapTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/MapTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Model200Response.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Model200Response.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelFile.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelFile.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelList.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelList.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelReturn.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ModelReturn.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Name.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Name.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/NullableClass.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/NullableClass.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/NumberOnly.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/NumberOnly.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Order.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Order.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterComposite.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterComposite.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnum.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnum.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java similarity index 98% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java index 74568b6224e..e458a6ed340 100644 --- a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -18,7 +18,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Pet.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Pet.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/SingleRefType.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/SingleRefType.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/SpecialModelName.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/SpecialModelName.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Tag.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/Tag.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/User.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/package-info.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java rename to samples/server/petstore/java-helidon-server/v3/se/src/main/java/org/openapitools/server/package-info.java diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml rename to samples/server/petstore/java-helidon-server/v3/se/src/main/resources/META-INF/openapi.yml diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml b/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/application.yaml similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml rename to samples/server/petstore/java-helidon-server/v3/se/src/main/resources/application.yaml diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v3/se/src/main/resources/logging.properties similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties rename to samples/server/petstore/java-helidon-server/v3/se/src/main/resources/logging.properties diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/MainTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/MainTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java index 87b0cf9126e..f6e06fc52a2 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java @@ -16,7 +16,6 @@ import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for AdditionalPropertiesClass */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java similarity index 91% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java index 83a14ba8273..61816df9b40 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java @@ -12,10 +12,11 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.SingleRefType; import org.junit.jupiter.api.Test; - /** * Model tests for AllOfWithSingleRef */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AnimalTest.java similarity index 93% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AnimalTest.java index 1299d46ba6f..9a3043089ff 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/AnimalTest.java @@ -15,11 +15,8 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; import org.junit.jupiter.api.Test; - /** * Model tests for Animal */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java index d67cac0b059..90060def339 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java @@ -14,10 +14,10 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java index 150ba7b070d..4a0fa46c97d 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java @@ -14,10 +14,10 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayOfNumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java index a2d4f750e1c..f7cc01228ea 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java @@ -13,11 +13,11 @@ package org.openapitools.server.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.ReadOnlyFirst; import org.junit.jupiter.api.Test; - /** * Model tests for ArrayTest */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java index 084a2885fc8..83b61a15b3e 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Capitalization */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CatTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CatTest.java index 121dcc9756d..dac6fe61116 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CatTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Cat */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CategoryTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CategoryTest.java index 2618c8fd934..02b10b94255 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Category */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClassModelTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClassModelTest.java index f62de6d1cc0..a16d0d7af9e 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for ClassModel */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClientTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClientTest.java index a9f4c21ebf8..3edb9feb3d1 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ClientTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Client */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java index 9ad380437ce..e2eba67dc94 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for DeprecatedObject */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DogTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DogTest.java index 70765267f0a..8143306030f 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/DogTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for Dog */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java index 42b3832090e..6d797b45ff8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java @@ -15,10 +15,10 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - /** * Model tests for EnumArrays */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumClassTest.java index 9c02e17dac0..8fa14bec99a 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for EnumClass */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumTestTest.java index 7c95fed8bb8..fc60f14abf2 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/EnumTestTest.java @@ -22,7 +22,6 @@ import org.openapitools.server.model.OuterEnumInteger; import org.openapitools.server.model.OuterEnumIntegerDefaultValue; import org.junit.jupiter.api.Test; - /** * Model tests for EnumTest */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java similarity index 97% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java index fbabc01db3c..11b779605c7 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java @@ -13,11 +13,11 @@ package org.openapitools.server.model; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.ModelFile; import org.junit.jupiter.api.Test; - /** * Model tests for FileSchemaTestClass */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java index d0dc33cef52..83cb2f5ffb8 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import org.openapitools.server.model.Foo; import org.junit.jupiter.api.Test; - /** * Model tests for FooGetDefaultResponse */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooTest.java index 39abe05aad6..9aecdffde70 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FooTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Foo */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FormatTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FormatTestTest.java index 5d988452964..3226b83d99e 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -20,7 +20,6 @@ import java.time.OffsetDateTime; import java.util.UUID; import org.junit.jupiter.api.Test; - /** * Model tests for FormatTest */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java index 5a56ddcc24d..f247acac715 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for HasOnlyReadOnly */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java index be4be735e57..594a8baa95c 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Test; - /** * Model tests for HealthCheckResult */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MapTestTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MapTestTest.java index 3c6c9450be3..ab00e116e10 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MapTestTest.java @@ -18,7 +18,6 @@ import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Test; - /** * Model tests for MapTest */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index 9b15f918a9b..46eb7361ce6 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -19,7 +19,6 @@ import java.util.UUID; import org.openapitools.server.model.Animal; import org.junit.jupiter.api.Test; - /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java index 33b6d47572d..ad6f6db532c 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for Model200Response */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java index 43cb48513cf..47500c309d8 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelApiResponse */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelFileTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelFileTest.java index ff03280b7e5..21eafc087a2 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelFileTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelFile */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelListTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelListTest.java index 7f228b19133..d073083d48a 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelListTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelList */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java index e6af66eb003..d84cff2fdb0 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for ModelReturn */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NameTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NameTest.java index 13114ab4e7a..ac557c71d0d 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NameTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Name */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NullableClassTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NullableClassTest.java index e2f2dd91bf7..a33acb6dd85 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NullableClassTest.java @@ -16,13 +16,13 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Test; - /** * Model tests for NullableClass */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java index dede232a8fa..8d154d78f6e 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for NumberOnly */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java index 55cf9bedb07..75417286d72 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java @@ -14,11 +14,11 @@ package org.openapitools.server.model; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.openapitools.server.model.DeprecatedObject; import org.junit.jupiter.api.Test; - /** * Model tests for ObjectWithDeprecatedFields */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OrderTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OrderTest.java index 90607655525..8ac0b0fbdd0 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OrderTest.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; - /** * Model tests for Order */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java index f61dfbaf415..29769579ebf 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import java.math.BigDecimal; import org.junit.jupiter.api.Test; - /** * Model tests for OuterComposite */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java index 55d00b4918c..79a4bb7cf33 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumDefaultValue */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java index 6a5e46c6124..8b693a14661 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumIntegerDefaultValue */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java index d6c32e321da..bfc74779837 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnumInteger */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java index 5ea29d21383..182b6b96418 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for OuterEnum */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java similarity index 90% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java index d40c868a41b..e06cefec284 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java @@ -12,10 +12,11 @@ package org.openapitools.server.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import org.openapitools.server.model.OuterEnumInteger; import org.junit.jupiter.api.Test; - /** * Model tests for OuterObjectWithEnumProperty */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/PetTest.java similarity index 98% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/PetTest.java index bc913dd50a3..0beb36cbe36 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/PetTest.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -23,7 +24,6 @@ import org.openapitools.server.model.Category; import org.openapitools.server.model.Tag; import org.junit.jupiter.api.Test; - /** * Model tests for Pet */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java index 2fe4c7fc6b7..1cb2ad84642 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for ReadOnlyFirst */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java index 4ae2c23f4cb..a698b5ecb97 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for SingleRefType */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java index 809e043f8ec..45e482228ac 100644 --- a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java @@ -15,7 +15,6 @@ package org.openapitools.server.model; import com.fasterxml.jackson.annotation.JsonTypeName; import org.junit.jupiter.api.Test; - /** * Model tests for SpecialModelName */ diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/TagTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/TagTest.java index 4d0d708bf97..ead74db6880 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/TagTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for Tag */ diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java similarity index 100% rename from samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/UserTest.java similarity index 99% rename from samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java rename to samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/UserTest.java index ba936a20805..a9dbfb06ded 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java +++ b/samples/server/petstore/java-helidon-server/v3/se/src/test/java/org/openapitools/server/model/UserTest.java @@ -14,7 +14,6 @@ package org.openapitools.server.model; import org.junit.jupiter.api.Test; - /** * Model tests for User */ diff --git a/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/FILES new file mode 100644 index 00000000000..8c122ac92fd --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/FILES @@ -0,0 +1,74 @@ +README.md +pom.xml +src/main/java/org/openapitools/server/JavaTimeFormatter.java +src/main/java/org/openapitools/server/RFC3339DateFormat.java +src/main/java/org/openapitools/server/RestApplication.java +src/main/java/org/openapitools/server/api/AnotherFakeService.java +src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java +src/main/java/org/openapitools/server/api/DefaultService.java +src/main/java/org/openapitools/server/api/DefaultServiceImpl.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java +src/main/java/org/openapitools/server/api/FakeService.java +src/main/java/org/openapitools/server/api/FakeServiceImpl.java +src/main/java/org/openapitools/server/api/PetService.java +src/main/java/org/openapitools/server/api/PetServiceImpl.java +src/main/java/org/openapitools/server/api/StoreService.java +src/main/java/org/openapitools/server/api/StoreServiceImpl.java +src/main/java/org/openapitools/server/api/UserService.java +src/main/java/org/openapitools/server/api/UserServiceImpl.java +src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/server/model/Animal.java +src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayTest.java +src/main/java/org/openapitools/server/model/Capitalization.java +src/main/java/org/openapitools/server/model/Cat.java +src/main/java/org/openapitools/server/model/Category.java +src/main/java/org/openapitools/server/model/ChildWithNullable.java +src/main/java/org/openapitools/server/model/ClassModel.java +src/main/java/org/openapitools/server/model/Client.java +src/main/java/org/openapitools/server/model/DeprecatedObject.java +src/main/java/org/openapitools/server/model/Dog.java +src/main/java/org/openapitools/server/model/EnumArrays.java +src/main/java/org/openapitools/server/model/EnumClass.java +src/main/java/org/openapitools/server/model/EnumTest.java +src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/server/model/FileSchemaTestClass.java +src/main/java/org/openapitools/server/model/Foo.java +src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/server/model/FormatTest.java +src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/server/model/HealthCheckResult.java +src/main/java/org/openapitools/server/model/MapTest.java +src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/Model200Response.java +src/main/java/org/openapitools/server/model/ModelApiResponse.java +src/main/java/org/openapitools/server/model/ModelFile.java +src/main/java/org/openapitools/server/model/ModelList.java +src/main/java/org/openapitools/server/model/ModelReturn.java +src/main/java/org/openapitools/server/model/Name.java +src/main/java/org/openapitools/server/model/NullableClass.java +src/main/java/org/openapitools/server/model/NumberOnly.java +src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/server/model/Order.java +src/main/java/org/openapitools/server/model/OuterComposite.java +src/main/java/org/openapitools/server/model/OuterEnum.java +src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/server/model/OuterEnumInteger.java +src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/server/model/ParentWithNullable.java +src/main/java/org/openapitools/server/model/Pet.java +src/main/java/org/openapitools/server/model/ReadOnlyFirst.java +src/main/java/org/openapitools/server/model/SingleRefType.java +src/main/java/org/openapitools/server/model/SpecialModelName.java +src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/server/model/User.java +src/main/java/org/openapitools/server/package-info.java +src/main/resources/META-INF/beans.xml +src/main/resources/META-INF/microprofile-config.properties +src/main/resources/META-INF/openapi.yml +src/main/resources/logging.properties diff --git a/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/v4/mp/README.md b/samples/server/petstore/java-helidon-server/v4/mp/README.md new file mode 100644 index 00000000000..323a58c291c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/README.md @@ -0,0 +1,79 @@ +# Helidon Server with OpenAPI + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/petstore-helidon-server-mp.jar +``` + +## Exercise the application + +``` +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2/BigDecimalMap +curl -X GET http://petstore.swagger.io:80/v2/health +curl -X GET http://petstore.swagger.io:80/v2/http-signature-test +curl -X POST http://petstore.swagger.io:80/v2/outer/boolean +curl -X POST http://petstore.swagger.io:80/v2/outer/composite +curl -X POST http://petstore.swagger.io:80/v2/outer/number +curl -X POST http://petstore.swagger.io:80/v2/outer/string +curl -X POST http://petstore.swagger.io:80/v2/property/enum-int +curl -X POST http://petstore.swagger.io:80/v2/additionalProperties-reference +curl -X PUT http://petstore.swagger.io:80/v2/body-with-binary +curl -X PUT http://petstore.swagger.io:80/v2/body-with-file-schema +curl -X PUT http://petstore.swagger.io:80/v2/body-with-query-params +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2 +curl -X DELETE http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/inline-additionalProperties +curl -X POST http://petstore.swagger.io:80/v2/inline-freeform-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/jsonFormData +curl -X POST http://petstore.swagger.io:80/v2/nullable +curl -X PUT http://petstore.swagger.io:80/v2/test-query-parameters +curl -X POST http://petstore.swagger.io:80/v2/stringMap-reference +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/pet +curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} +curl -X GET http://petstore.swagger.io:80/v2/pet/findByStatus +curl -X GET http://petstore.swagger.io:80/v2/pet/findByTags +curl -X GET http://petstore.swagger.io:80/v2/pet/{petId} +curl -X PUT http://petstore.swagger.io:80/v2/pet +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId} +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}/uploadImage +curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile +curl -X DELETE http://petstore.swagger.io:80/v2/order/{order_id} +curl -X GET http://petstore.swagger.io:80/v2/inventory +curl -X GET http://petstore.swagger.io:80/v2/order/{order_id} +curl -X POST http://petstore.swagger.io:80/v2/order +curl -X POST http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/createWithArray +curl -X POST http://petstore.swagger.io:80/v2/createWithList +curl -X DELETE http://petstore.swagger.io:80/v2/{username} +curl -X GET http://petstore.swagger.io:80/v2/{username} +curl -X GET http://petstore.swagger.io:80/v2/login +curl -X GET http://petstore.swagger.io:80/v2/logout +curl -X PUT http://petstore.swagger.io:80/v2/{username} + +``` + +## Try health and metrics + +``` +curl -s -X GET http://petstore.swagger.io:80/v2/health +{"outcome":"UP",... +. . . + +# Prometheus Format +curl -s -X GET http://petstore.swagger.io:80/v2/metrics +# TYPE base:gc_g1_young_generation_count gauge +. . . + +# JSON Format +curl -H 'Accept: application/json' -X GET http://petstore.swagger.io:80/v2/metrics +{"base":... +. . . +``` \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/mp/pom.xml b/samples/server/petstore/java-helidon-server/v4/mp/pom.xml new file mode 100644 index 00000000000..ea36907a9a2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-mp + 4.0.8 + + + petstore-helidon-server-mp + petstore-helidon-server-mp + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + 1.0.0 + jar + + + 0.2.6 + + + + + io.helidon.microprofile.bundles + helidon-microprofile-core + + + io.helidon.microprofile.cdi + helidon-microprofile-cdi + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.microprofile.testing + helidon-microprofile-testing-junit5 + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + io.smallrye + jandex-maven-plugin + + + make-index + + + + + + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java new file mode 100644 index 00000000000..7cf69c98e2d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 00000000000..f47f2f7f983 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RestApplication.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RestApplication.java new file mode 100644 index 00000000000..c6e5b490a2b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/RestApplication.java @@ -0,0 +1,11 @@ +package org.openapitools.server; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +@ApplicationScoped +@ApplicationPath("/v2") +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 00000000000..30fd308f3db --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/another-fake/dummy") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface AnotherFakeService { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(@Valid @NotNull Client client); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 00000000000..4d8d7644e04 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/another-fake/dummy") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AnotherFakeServiceImpl implements AnotherFakeService { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Client call123testSpecialTags(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultService.java new file mode 100644 index 00000000000..f6f27b3db3e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultService.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/foo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface DefaultService { + + @GET + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet(); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java new file mode 100644 index 00000000000..791f661f226 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/foo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DefaultServiceImpl implements DefaultService { + + @GET + @Produces({ "application/json" }) + public FooGetDefaultResponse fooGet() { + FooGetDefaultResponse result = null; // Replace with correct business logic. + return result; + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java new file mode 100644 index 00000000000..95652e51bf1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake_classname_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface FakeClassnameTags123Service { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(@Valid @NotNull Client client); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java new file mode 100644 index 00000000000..de1485b0b7f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake_classname_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeClassnameTags123ServiceImpl implements FakeClassnameTags123Service { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Client testClassname(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 00000000000..6ad807a9cc2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,154 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import org.openapitools.server.model.HealthCheckResult; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface FakeService { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + FakeBigDecimalMap200Response fakeBigDecimalMap(); + + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet(); + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(@Valid Boolean body); + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(@Valid String body); + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + void testAdditionalPropertiesReference(@Valid @NotNull Map requestBody); + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(@Valid File body); + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass); + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") @NotNull String query, @Valid @NotNull User user); + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(@Valid @NotNull Client client); + + @POST + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@FormParam(value = "number") BigDecimal number, @FormParam(value = "double") Double _double, @FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter, @FormParam(value = "byte") byte[] _byte, @FormParam(value = "integer") Integer integer, @FormParam(value = "int32") Integer int32, @FormParam(value = "int64") Long int64, @FormParam(value = "float") Float _float, @FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream, @FormParam(value = "date") LocalDate date, @FormParam(value = "dateTime") OffsetDateTime dateTime, @FormParam(value = "password") String password, @FormParam(value = "callback") String paramCallback); + + @GET + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam(value = "enum_form_string_array") List enumFormStringArray, @FormParam(value = "enum_form_string") String enumFormString); + + @DELETE + void testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup, @HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup, @QueryParam("required_int64_group") @NotNull Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); + + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(@Valid @NotNull Map requestBody); + + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + void testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@FormParam(value = "param") String param, @FormParam(value = "param2") String param2); + + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + void testNullable(@Valid @NotNull ChildWithNullable childWithNullable); + + @PUT + @Path("/test-query-parameters") + void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context, @QueryParam("allowEmpty") @NotNull String allowEmpty, @QueryParam("language") Map language); + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + void testStringMapReference(@Valid @NotNull Map requestBody); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 00000000000..ef7470ca7e5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,193 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import org.openapitools.server.model.HealthCheckResult; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeServiceImpl implements FakeService { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + public FakeBigDecimalMap200Response fakeBigDecimalMap() { + FakeBigDecimalMap200Response result = null; // Replace with correct business logic. + return result; + } + + @GET + @Path("/health") + @Produces({ "application/json" }) + public HealthCheckResult fakeHealthGet() { + HealthCheckResult result = null; // Replace with correct business logic. + return result; + } + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + public void fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { + } + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Boolean fakeOuterBooleanSerialize(@Valid Boolean body) { + Boolean result = new Boolean(false); // Replace with correct business logic. + return result; + } + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { + OuterComposite result = null; // Replace with correct business logic. + return result; + } + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body) { + BigDecimal result = null; // Replace with correct business logic. + return result; + } + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public String fakeOuterStringSerialize(@Valid String body) { + String result = ""; // Replace with correct business logic. + return result; + } + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + OuterObjectWithEnumProperty result = null; // Replace with correct business logic. + return result; + } + + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + public void testAdditionalPropertiesReference(@Valid @NotNull Map requestBody) { + } + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + public void testBodyWithBinary(@Valid File body) { + } + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + public void testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { + } + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + public void testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { + } + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Client testClientModel(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; + } + + @POST + @Consumes({ "application/x-www-form-urlencoded" }) + public void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") OffsetDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { + } + + @GET + @Consumes({ "application/x-www-form-urlencoded" }) + public void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@QueryParam("enum_query_double") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + } + + @DELETE + public void testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@QueryParam("string_group") Integer stringGroup,@HeaderParam("boolean_group") Boolean booleanGroup,@QueryParam("int64_group") Long int64Group) { + } + + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + public void testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { + } + + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + public void testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + } + + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + public void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { + } + + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + public void testNullable(@Valid @NotNull ChildWithNullable childWithNullable) { + } + + @PUT + @Path("/test-query-parameters") + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { + } + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + public void testStringMapReference(@Valid @NotNull Map requestBody) { + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 00000000000..a6b12e7406f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.io.File; +import java.util.List; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; +import java.util.Set; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface PetService { + + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void addPet(@Valid @NotNull Pet pet); + + @DELETE + @Path("/pet/{petId}") + void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + List findPetsByStatus(@QueryParam("status") @NotNull List status); + + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + Set findPetsByTags(@QueryParam("tags") @NotNull Set tags); + + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + Pet getPetById(@PathParam("petId") Long petId); + + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void updatePet(@Valid @NotNull Pet pet); + + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + void updatePetWithForm(@PathParam("petId") Long petId, @FormParam(value = "name") String name, @FormParam(value = "status") String status); + + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFile(@PathParam("petId") Long petId, @FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); + + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, @FormParam(value = "additionalMetadata") String additionalMetadata); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 00000000000..116e216474a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,98 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.io.File; +import java.util.List; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; +import java.util.Set; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class PetServiceImpl implements PetService { + + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + public void addPet(@Valid @NotNull Pet pet) { + } + + @DELETE + @Path("/pet/{petId}") + public void deletePet(@PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey) { + } + + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + public List findPetsByStatus(@QueryParam("status") @NotNull List status) { + List result = java.util.Collections.emptyList(); // Replace with correct business logic. + return result; + } + + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + public Set findPetsByTags(@QueryParam("tags") @NotNull Set tags) { + Set result = java.util.Collections.emptySet(); // Replace with correct business logic. + return result; + } + + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + public Pet getPetById(@PathParam("petId") Long petId) { + Pet result = null; // Replace with correct business logic. + return result; + } + + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + public void updatePet(@Valid @NotNull Pet pet) { + } + + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + public void updatePetWithForm(@PathParam("petId") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { + } + + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + public ModelApiResponse uploadFile(@PathParam("petId") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { + ModelApiResponse result = null; // Replace with correct business logic. + return result; + } + + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + public ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { + ModelApiResponse result = null; // Replace with correct business logic. + return result; + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 00000000000..04dc8cd80ac --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.Map; +import org.openapitools.server.model.Order; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/store") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface StoreService { + + @DELETE + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId); + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Map getInventory(); + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + Order getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId); + + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Order placeOrder(@Valid @NotNull Order order); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 00000000000..30a6833bbd3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.Map; +import org.openapitools.server.model.Order; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/store") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StoreServiceImpl implements StoreService { + + @DELETE + @Path("/order/{order_id}") + public void deleteOrder(@PathParam("order_id") String orderId) { + } + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + public Map getInventory() { + Map result = java.util.Collections.emptyMap(); // Replace with correct business logic. + return result; + } + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + public Order getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId) { + Order result = null; // Replace with correct business logic. + return result; + } + + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + public Order placeOrder(@Valid @NotNull Order order) { + Order result = null; // Replace with correct business logic. + return result; + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 00000000000..ad79565c295 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/user") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public interface UserService { + + @POST + @Consumes({ "application/json" }) + void createUser(@Valid @NotNull User user); + + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + void createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user); + + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + void createUsersWithListInput(@Valid @NotNull List<@Valid User> user); + + @DELETE + @Path("/{username}") + void deleteUser(@PathParam("username") String username); + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + User getUserByName(@PathParam("username") String username); + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + + @GET + @Path("/logout") + void logoutUser(); + + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + void updateUser(@PathParam("username") String username, @Valid @NotNull User user); +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 00000000000..abb60875fd5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/user") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class UserServiceImpl implements UserService { + + @POST + @Consumes({ "application/json" }) + public void createUser(@Valid @NotNull User user) { + } + + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + public void createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) { + } + + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + public void createUsersWithListInput(@Valid @NotNull List<@Valid User> user) { + } + + @DELETE + @Path("/{username}") + public void deleteUser(@PathParam("username") String username) { + } + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + public User getUserByName(@PathParam("username") String username) { + User result = null; // Replace with correct business logic. + return result; + } + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + public String loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) { + String result = ""; // Replace with correct business logic. + return result; + } + + @GET + @Path("/logout") + public void logoutUser() { + } + + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + public void updateUser(@PathParam("username") String username,@Valid @NotNull User user) { + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..f5c1e01d9e1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class AdditionalPropertiesClass { + + private Map mapProperty = null; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + **/ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + **/ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..40e102a9cb3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,99 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.SingleRefType; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class AllOfWithSingleRef { + + private String username; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + **/ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 00000000000..3a90afbad85 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Animal.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Animal { + + private String className; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + @NotNull + public String getClassName() { + return className; + } + + /** + * Set className + **/ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + **/ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..0a02e0ec041 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + **/ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..65521fb4507 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayOfNumberOnly { + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + **/ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 00000000000..d599c799306 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayTest { + + private List arrayOfString = null; + + private List> arrayArrayOfInteger = null; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @Size(min=0,max=3) public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + **/ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + **/ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + **/ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 00000000000..933d2f15d5f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Capitalization { + + private String smallCamel; + + private String capitalCamel; + + private String smallSnake; + + private String capitalSnake; + + private String scAETHFlowPoints; + + /** + * Name of the pet + **/ + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + **/ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + **/ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + **/ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + **/ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + **/ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + **/ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 00000000000..78534303e0f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 00000000000..e92a984945d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,97 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Category { + + private Long id; + + private String name = "default-name"; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java new file mode 100644 index 00000000000..abe443a27f8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ChildWithNullable.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + **/ + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 00000000000..a0b5f1b7eb0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model with \"_class\" property + **/ + +public class ClassModel { + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 00000000000..522166364ae --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Client { + + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + **/ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 00000000000..0ea4aa39023 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class DeprecatedObject { + + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 00000000000..e0f8e5a79b4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Dog extends Animal { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 00000000000..0b708605945 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class EnumArrays { + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static JustSymbolEnum fromString(String s) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private JustSymbolEnum justSymbol; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static ArrayEnumEnum fromString(String s) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + **/ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + **/ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 00000000000..c25829e3bb9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumClass fromString(String s) { + for (EnumClass b : EnumClass.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 00000000000..9476edffbf9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,431 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class EnumTest { + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringEnum fromString(String s) { + for (EnumStringEnum b : EnumStringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringEnum enumString; + +public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringRequiredEnum fromString(String s) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringRequiredEnum enumStringRequired; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumIntegerEnum fromString(String s) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumIntegerEnum enumInteger; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Double, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumNumberEnum fromString(String s) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumNumberEnum enumNumber; + + private OuterEnum outerEnum; + + private OuterEnumInteger outerEnumInteger; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + **/ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + **/ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + **/ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + **/ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + **/ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + **/ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + **/ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + **/ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..2b98d3cff5c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + **/ + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + **/ + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + this.someMap.put(key, someMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..1b47816ef28 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FileSchemaTestClass { + + private ModelFile _file; + + private List<@Valid ModelFile> files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + **/ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List<@Valid ModelFile> getFiles() { + return files; + } + + /** + * Set files + **/ + public void setFiles(List<@Valid ModelFile> files) { + this.files = files; + } + + public FileSchemaTestClass files(List<@Valid ModelFile> files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + this.files.add(filesItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 00000000000..66c97424c43 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Foo { + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + **/ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..2536010aaeb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + **/ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 00000000000..c98c85ccbeb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,444 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FormatTest { + + private Integer integer; + + private Integer int32; + + private Long int64; + + private BigDecimal number; + + private Float _float; + + private Double _double; + + private BigDecimal decimal; + + private String string; + + private byte[] _byte; + + private File binary; + + private LocalDate date; + + private OffsetDateTime dateTime; + + private UUID uuid; + + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @Min(10) @Max(100) public Integer getInteger() { + return integer; + } + + /** + * Set integer + **/ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @Min(20) @Max(200) public Integer getInt32() { + return int32; + } + + /** + * Set int32 + **/ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + **/ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @NotNull + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + return number; + } + + /** + * Set number + **/ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + return _float; + } + + /** + * Set _float + **/ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + return _double; + } + + /** + * Set _double + **/ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + **/ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + @Pattern(regexp="/[a-z]/i") public String getString() { + return string; + } + + /** + * Set string + **/ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @NotNull + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + **/ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + **/ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + @NotNull + public LocalDate getDate() { + return date; + } + + /** + * Set date + **/ + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + @NotNull + @Size(min=10,max=64) public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @Pattern(regexp="^\\d{10}$") public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + **/ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @Pattern(regexp="/^image_\\d{1,3}$/i") public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + **/ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..82f9d533067 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class HasOnlyReadOnly { + + private String bar; + + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + + @JsonProperty(value="bar") String bar, + + @JsonProperty(value="foo") String foo + ) { + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 00000000000..7ac79cd6f90 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + **/ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 00000000000..4a446f75cf3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,213 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class MapTest { + + private Map> mapMapOfString = null; + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static InnerEnum fromString(String s) { + for (InnerEnum b : InnerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private Map mapOfEnumString = null; + + private Map directMap = null; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + **/ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + **/ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + **/ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + **/ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..1d04eaf6c94 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + + private OffsetDateTime dateTime; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + **/ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 00000000000..a091e534c32 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model name starting with number + **/ + +public class Model200Response { + + private Integer name; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 00000000000..9d01d1753e1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ModelApiResponse { + + private Integer code; + + private String type; + + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + **/ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + **/ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 00000000000..432f843889c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Must be named `File` for test. + **/ + +public class ModelFile { + + /** + * Test capitalization + **/ + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + **/ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 00000000000..a8e0e3a4b0b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ModelList { + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + **/ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 00000000000..c37c75a2bf2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing reserved words + **/ + +public class ModelReturn { + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + **/ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 00000000000..bb51b809742 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model name same as property name + **/ + +public class Name { + + private Integer name; + + private Integer snakeCase; + + private String property; + + private Integer _123number; + + public Name() { + } + + @JsonCreator + public Name( + + @JsonProperty(value="snake_case") Integer snakeCase, + + @JsonProperty(value="123Number") Integer _123number + ) { + this.snakeCase = snakeCase; + this._123number = _123number; + } + + /** + * Get name + * @return name + **/ + @NotNull + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + **/ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 00000000000..dc00c081d15 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,365 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class NullableClass extends HashMap { + + private Integer integerProp; + + private BigDecimal numberProp; + + private Boolean booleanProp; + + private String stringProp; + + private LocalDate dateProp; + + private OffsetDateTime datetimeProp; + + private List arrayNullableProp = null; + + private List arrayAndItemsNullableProp = null; + + private List arrayItemsNullable = null; + + private Map objectNullableProp = null; + + private Map objectAndItemsNullableProp = null; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + **/ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + **/ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + **/ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + **/ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public LocalDate getDateProp() { + return dateProp; + } + + /** + * Set dateProp + **/ + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + **/ + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + **/ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + **/ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + **/ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + **/ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + **/ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + **/ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 00000000000..e0761ba551b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + **/ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..dc24a224465 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ObjectWithDeprecatedFields { + + private String uuid; + + private BigDecimal id; + + private DeprecatedObject deprecatedRef; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + **/ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + **/ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + **/ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + this.bars.add(barsItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 00000000000..707cdd3797f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,241 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Order { + + private Long id; + + private Long petId; + + private Integer quantity; + + private OffsetDateTime shipDate; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + /** + * Order Status + **/ + private StatusEnum status; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public OffsetDateTime getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 00000000000..7d1630e2f52 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class OuterComposite { + + private BigDecimal myNumber; + + private String myString; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + **/ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + **/ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + **/ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 00000000000..794742e314a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnum fromString(String s) { + for (OuterEnum b : OuterEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + return null; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..4ea374968f2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumDefaultValue fromString(String s) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 00000000000..926a9e7aaa9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumInteger fromString(String s) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..dbefa5e7adb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumIntegerDefaultValue fromString(String s) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..552f07ecc3a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.OuterEnumInteger; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + @NotNull + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + **/ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java new file mode 100644 index 00000000000..67de84d392d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -0,0 +1,149 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ParentWithNullable { + +public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + private String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static TypeEnum fromString(String s) { + for (TypeEnum b : TypeEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private TypeEnum type; + + private String nullableProperty; + + /** + * Get type + * @return type + **/ + public TypeEnum getType() { + return type; + } + + /** + * Set type + **/ + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + **/ + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 00000000000..f58096fff73 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Pet { + + private Long id; + + private Category category; + + private String name; + + private Set photoUrls = new LinkedHashSet<>(); + + private List<@Valid Tag> tags = null; + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + /** + * pet status in the store + **/ + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + public Set getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List<@Valid Tag> getTags() { + return tags; + } + + /** + * Set tags + **/ + public void setTags(List<@Valid Tag> tags) { + this.tags = tags; + } + + public Pet tags(List<@Valid Tag> tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..3294db20f65 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ReadOnlyFirst { + + private String bar; + + private String baz; + + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + + @JsonProperty(value="bar") String bar + ) { + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + **/ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 00000000000..785373988ab --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static SingleRefType fromString(String s) { + for (SingleRefType b : SingleRefType.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 00000000000..333b4dd35ca --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + **/ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 00000000000..3be9794db14 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Tag { + + private Long id; + + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..abbeb6e6130 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 00000000000..07ab5974ee5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,237 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class User { + + private Long id; + + private String username; + + private String firstName; + + private String lastName; + + private String email; + + private String password; + + private String phone; + + /** + * User Status + **/ + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + **/ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 00000000000..1025e91aed8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/package-info.java @@ -0,0 +1 @@ +package org.openapitools.server; \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/beans.xml b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..125ef995e5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/beans.xml @@ -0,0 +1,9 @@ + + + + diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/microprofile-config.properties b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/microprofile-config.properties new file mode 100644 index 00000000000..38988f20e5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/microprofile-config.properties @@ -0,0 +1,11 @@ +# Microprofile server properties + +# Application properties. This is the default greeting +app.greeting=Hello + +# Microprofile server properties +server.port=8080 +server.host=0.0.0.0 + +# Enable the optional MicroProfile Metrics REST.request metrics +metrics.rest-request.enabled=true diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/openapi.yml new file mode 100644 index 00000000000..6fc0968bc33 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2361 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: + - application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-webclient-blocking: false + x-accepts: + - application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties new file mode 100644 index 00000000000..cd238eb6615 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties @@ -0,0 +1,19 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler + +# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n + +# Global logging level. Can be overridden by specific loggers +.level=INFO + +# Component specific log levels +#io.helidon.webserver.level=INFO +#io.helidon.config.level=INFO +#io.helidon.security.level=INFO +#io.helidon.common.level=INFO +#io.netty.level=INFO diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..f6e06fc52a2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..61816df9b40 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.SingleRefType; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 00000000000..9a3043089ff --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/AnimalTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..90060def339 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..4a0fa46c97d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 00000000000..f7cc01228ea --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 00000000000..83b61a15b3e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 00000000000..dac6fe61116 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CatTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 00000000000..02b10b94255 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java new file mode 100644 index 00000000000..6246621383e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 00000000000..a16d0d7af9e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 00000000000..3edb9feb3d1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..e2eba67dc94 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 00000000000..8143306030f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/DogTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 00000000000..6d797b45ff8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 00000000000..8fa14bec99a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 00000000000..fc60f14abf2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 00000000000..c38a4e5469f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..11b779605c7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..83cb2f5ffb8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 00000000000..9aecdffde70 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 00000000000..3226b83d99e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..f247acac715 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..594a8baa95c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 00000000000..ab00e116e10 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MapTestTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..46eb7361ce6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 00000000000..ad6f6db532c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..47500c309d8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 00000000000..21eafc087a2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 00000000000..d073083d48a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelListTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 00000000000..d84cff2fdb0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 00000000000..ac557c71d0d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NameTest.java @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 00000000000..a33acb6dd85 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 00000000000..8d154d78f6e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..75417286d72 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 00000000000..8ac0b0fbdd0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 00000000000..29769579ebf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..79a4bb7cf33 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..8b693a14661 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..bfc74779837 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 00000000000..182b6b96418 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..e06cefec284 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java new file mode 100644 index 00000000000..466dc910f55 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 00000000000..0beb36cbe36 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/PetTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..1cb2ad84642 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..a698b5ecb97 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..45e482228ac --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 00000000000..ead74db6880 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TagTest.java @@ -0,0 +1,47 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 00000000000..55c3e0e12bb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 00000000000..a9dbfb06ded --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java index 999c8b087bb..5ae57a336eb 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelList.java @@ -3,7 +3,6 @@ package org.openapitools.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/samples/server/petstore/java-microprofile/.openapi-generator-ignore b/samples/server/petstore/java-microprofile/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-microprofile/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-microprofile/.openapi-generator/FILES b/samples/server/petstore/java-microprofile/.openapi-generator/FILES new file mode 100644 index 00000000000..64572f1a20a --- /dev/null +++ b/samples/server/petstore/java-microprofile/.openapi-generator/FILES @@ -0,0 +1,23 @@ +README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/server/RFC3339DateFormat.java +src/main/java/org/openapitools/server/api/ApiException.java +src/main/java/org/openapitools/server/api/ApiExceptionMapper.java +src/main/java/org/openapitools/server/api/PetApi.java +src/main/java/org/openapitools/server/api/StoreApi.java +src/main/java/org/openapitools/server/api/UserApi.java +src/main/java/org/openapitools/server/model/Category.java +src/main/java/org/openapitools/server/model/ModelApiResponse.java +src/main/java/org/openapitools/server/model/Order.java +src/main/java/org/openapitools/server/model/Pet.java +src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/User.java diff --git a/samples/server/petstore/java-microprofile/.openapi-generator/VERSION b/samples/server/petstore/java-microprofile/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/java-microprofile/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/java-microprofile/README.md b/samples/server/petstore/java-microprofile/README.md new file mode 100644 index 00000000000..19b499b9998 --- /dev/null +++ b/samples/server/petstore/java-microprofile/README.md @@ -0,0 +1,9 @@ +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +The generated server contains an interface which acts as the server, you can inject it into the controller class. +This module is intended to provide additional server features, like accessing an operations response object, when multiple responses where specified. diff --git a/samples/server/petstore/java-microprofile/docs/Category.md b/samples/server/petstore/java-microprofile/docs/Category.md new file mode 100644 index 00000000000..a7fc939d252 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/Category.md @@ -0,0 +1,15 @@ + + +# Category + +A category for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/server/petstore/java-microprofile/docs/ModelApiResponse.md b/samples/server/petstore/java-microprofile/docs/ModelApiResponse.md new file mode 100644 index 00000000000..cd7e3c400be --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/ModelApiResponse.md @@ -0,0 +1,16 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/server/petstore/java-microprofile/docs/Order.md b/samples/server/petstore/java-microprofile/docs/Order.md new file mode 100644 index 00000000000..7bfa42e6a90 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/Order.md @@ -0,0 +1,29 @@ + + +# Order + +An order for a pets from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **Date** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/server/petstore/java-microprofile/docs/Pet.md b/samples/server/petstore/java-microprofile/docs/Pet.md new file mode 100644 index 00000000000..8bb36330123 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/Pet.md @@ -0,0 +1,29 @@ + + +# Pet + +A pet for sale in the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **List<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/server/petstore/java-microprofile/docs/PetApi.md b/samples/server/petstore/java-microprofile/docs/PetApi.md new file mode 100644 index 00000000000..b8e20a80fc1 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/PetApi.md @@ -0,0 +1,605 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | + + + +## addPet + +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.addPet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> void deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + void result = apiInstance.deletePet(petId, apiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**List<String>**](String.md)| Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **206** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> Pet updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + Pet result = apiInstance.updatePet(pet); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + void result = apiInstance.updatePetWithForm(petId, name, status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/server/petstore/java-microprofile/docs/StoreApi.md b/samples/server/petstore/java-microprofile/docs/StoreApi.md new file mode 100644 index 00000000000..1b7a147054c --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/StoreApi.md @@ -0,0 +1,283 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.models.*; +import org.openapitools.server.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + void result = apiInstance.deleteOrder(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.models.*; +import org.openapitools.server.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.models.*; +import org.openapitools.server.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/server/petstore/java-microprofile/docs/Tag.md b/samples/server/petstore/java-microprofile/docs/Tag.md new file mode 100644 index 00000000000..abfde4afb50 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/Tag.md @@ -0,0 +1,15 @@ + + +# Tag + +A tag for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/server/petstore/java-microprofile/docs/User.md b/samples/server/petstore/java-microprofile/docs/User.md new file mode 100644 index 00000000000..426845227bd --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/User.md @@ -0,0 +1,21 @@ + + +# User + +A User who is purchasing from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/server/petstore/java-microprofile/docs/UserApi.md b/samples/server/petstore/java-microprofile/docs/UserApi.md new file mode 100644 index 00000000000..01db3fb54b0 --- /dev/null +++ b/samples/server/petstore/java-microprofile/docs/UserApi.md @@ -0,0 +1,591 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> void createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + void result = apiInstance.createUser(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithArrayInput + +> void createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithArrayInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithListInput + +> void createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithListInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## deleteUser + +> void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + void result = apiInstance.deleteUser(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
    * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> void logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + void result = apiInstance.logoutUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## updateUser + +> void updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.server.ApiClient; +import org.openapitools.server.ApiException; +import org.openapitools.server.Configuration; +import org.openapitools.server.auth.*; +import org.openapitools.server.models.*; +import org.openapitools.server.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + void result = apiInstance.updateUser(username, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/server/petstore/java-microprofile/pom.xml b/samples/server/petstore/java-microprofile/pom.xml new file mode 100644 index 00000000000..0d7f4876c41 --- /dev/null +++ b/samples/server/petstore/java-microprofile/pom.xml @@ -0,0 +1,175 @@ + + 4.0.0 + org.openapitools + openapi-microprofile-server + jar + openapi-microprofile-server + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + io.smallrye + smallrye-rest-client + ${smallrye.rest.client.version} + test + + + + io.smallrye + smallrye-config + ${smallrye.config.version} + test + + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + io.smallrye.reactive + mutiny + ${mutiny.version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.8 + ${java.version} + ${java.version} + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 + 3.2.7 + 2.15.2 + 2.15.2 + 1.2.2 + 1.3.5 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + 2.0 + 1.2.1 + 1.3.5 + 3.2.6 + 2.2.11 + 2.2.11 + 5.2.2.Final + 1.1.0 + 2.6 + 1.9.1 + UTF-8 + 1.2.0 + + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 00000000000..416e53653d9 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMicroprofileServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiException.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiException.java new file mode 100644 index 00000000000..e2c1bc5261f --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiException.java @@ -0,0 +1,34 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import javax.ws.rs.core.Response; + +public class ApiException extends Exception { + + private static final long serialVersionUID = 1L; + private Response response; + + public ApiException() { + super(); + } + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiExceptionMapper.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiExceptionMapper.java new file mode 100644 index 00000000000..3f6b3b1e086 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.Provider; +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper + implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/PetApi.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/PetApi.java new file mode 100644 index 00000000000..2ca0851ef23 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/PetApi.java @@ -0,0 +1,136 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.io.File; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

    This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + */ + +@RegisterProvider(ApiExceptionMapper.class) +@Path("/pet") +public interface PetApi { + + /** + * Add a new pet to the store + * + * + * + */ + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni addPet(Pet pet) throws ApiException, ProcessingException; + + /** + * Deletes a pet + * + * + * + */ + @DELETE + @Path("/{petId}") + Uni deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ + @GET + @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) + Uni> findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @deprecated + */ + @Deprecated + @GET + @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) + Uni findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + + /** + * Find pet by ID + * + * Returns a single pet + * + */ + @GET + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + Uni getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; + + /** + * Update an existing pet + * + * + * + */ + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni updatePet(Pet pet) throws ApiException, ProcessingException; + + /** + * Updates a pet in the store with form data + * + * + * + */ + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + Uni updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; + + /** + * uploads an image + * + * + * + */ + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + Uni uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/StoreApi.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/StoreApi.java new file mode 100644 index 00000000000..2dea0b817a5 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/StoreApi.java @@ -0,0 +1,86 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Order; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

    This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + */ + +@RegisterProvider(ApiExceptionMapper.class) +@Path("/store") +public interface StoreApi { + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ + @DELETE + @Path("/order/{orderId}") + Uni deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Uni> getInventory() throws ApiException, ProcessingException; + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + */ + @GET + @Path("/order/{orderId}") + @Produces({ "application/xml", "application/json" }) + Uni getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + + /** + * Place an order for a pet + * + * + * + */ + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Uni placeOrder(Order order) throws ApiException, ProcessingException; +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/UserApi.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/UserApi.java new file mode 100644 index 00000000000..ab673f1773f --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/api/UserApi.java @@ -0,0 +1,129 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.Date; +import org.openapitools.server.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * OpenAPI Petstore + * + *

    This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + */ + +@RegisterProvider(ApiExceptionMapper.class) +@Path("/user") +public interface UserApi { + + /** + * Create user + * + * This can only be done by the logged in user. + * + */ + @POST + + @Consumes({ "application/json" }) + Uni createUser(User user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + Uni createUsersWithArrayInput(List user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + Uni createUsersWithListInput(List user) throws ApiException, ProcessingException; + + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ + @DELETE + @Path("/{username}") + Uni deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Get user by user name + * + * + * + */ + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + Uni getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Logs user into the system + * + * + * + */ + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + Uni loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException; + + /** + * Logs out current logged in user session + * + * + * + */ + @GET + @Path("/logout") + Uni logoutUser() throws ApiException, ProcessingException; + + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + Uni updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; +} diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 00000000000..2437bd1de6d --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,115 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +/** + * A category for a pet + **/ + +public class Category { + + public static final String JSON_PROPERTY_ID = "id"; + + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + + private String name; + + /** + * Get id + * @return id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + /** + * Set id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * Set name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 00000000000..915f8a093e5 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,146 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@JsonTypeName("ApiResponse") +/** + * Describes the result of uploading an image resource + **/ + +public class ModelApiResponse { + + public static final String JSON_PROPERTY_CODE = "code"; + + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + + private String message; + + /** + * Get code + * @return code + **/ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * Set type + **/ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + /** + * Set message + **/ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 00000000000..977251b712e --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,271 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) +/** + * An order for a pets from the pet store + **/ + +public class Order { + + public static final String JSON_PROPERTY_ID = "id"; + + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + + private Date shipDate; + + public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + /** + * Order Status + **/ + + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + /** + * Set id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Date getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 00000000000..48be5c7f12f --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,293 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +/** + * A pet for sale in the pet store + **/ + +public class Pet { + + public static final String JSON_PROPERTY_ID = "id"; + + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + + private List photoUrls = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + + private List tags = null; + + public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + @JsonValue + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + /** + * pet status in the store + **/ + + private StatusEnum status; + + /** + * Get id + * @return id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + /** + * Set id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + /** + * Set name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + /** + * Set tags + **/ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + **/ + @Deprecated + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 00000000000..fc166497373 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,115 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +/** + * A tag for a pet + **/ + +public class Tag { + + public static final String JSON_PROPERTY_ID = "id"; + + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + + private String name; + + /** + * Get id + * @return id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + /** + * Set id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * Set name + **/ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 00000000000..f340936ab0c --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,298 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) +/** + * A User who is purchasing from the pet store + **/ + +public class User { + + public static final String JSON_PROPERTY_ID = "id"; + + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + /** + * User Status + **/ + + private Integer userStatus; + + /** + * Get id + * @return id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + /** + * Set id + **/ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + /** + * Set username + **/ + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + /** + * Set email + **/ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + /** + * Set password + **/ + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/PetApiTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/PetApiTest.java new file mode 100644 index 00000000000..0cd50290f23 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/PetApiTest.java @@ -0,0 +1,201 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.api; + +import java.io.File; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for PetApi + */ +public class PetApiTest { + + private PetApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(PetApi.class); + } + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.addPet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() { + // TODO: test validations + Long petId = null; + String apiKey = null; + //api.deletePet(petId, apiKey); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() { + // TODO: test validations + List status = null; + //Uni> response = api.findPetsByStatus(status); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() { + // TODO: test validations + List tags = null; + //Uni> response = api.findPetsByTags(tags); + //Assertions.assertNotNull(response); + + + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() { + // TODO: test validations + Long petId = null; + //Uni response = api.getPetById(petId); + //Assertions.assertNotNull(response); + + + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.updatePet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() { + // TODO: test validations + Long petId = null; + String name = null; + String status = null; + //api.updatePetWithForm(petId, name, status); + //Assertions.assertNotNull(response); + + + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() { + // TODO: test validations + Long petId = null; + String additionalMetadata = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; + //Uni response = api.uploadFile(petId, additionalMetadata, _file); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/StoreApiTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/StoreApiTest.java new file mode 100644 index 00000000000..f2a97d3ef44 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/StoreApiTest.java @@ -0,0 +1,121 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.api; + +import org.openapitools.server.model.Order; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private StoreApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(StoreApi.class); + } + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() { + // TODO: test validations + String orderId = null; + //api.deleteOrder(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() { + // TODO: test validations + //Uni> response = api.getInventory(); + //Assertions.assertNotNull(response); + + + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() { + // TODO: test validations + Long orderId = null; + //Uni response = api.getOrderById(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() { + // TODO: test validations + Order order = null; + //Uni response = api.placeOrder(order); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/UserApiTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/UserApiTest.java new file mode 100644 index 00000000000..f2f1c6b8d36 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/api/UserApiTest.java @@ -0,0 +1,196 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.api; + +import java.util.Date; +import org.openapitools.server.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for UserApi + */ +public class UserApiTest { + + private UserApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(UserApi.class); + } + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() { + // TODO: test validations + User user = null; + //api.createUser(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithArrayInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithListInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() { + // TODO: test validations + String username = null; + //api.deleteUser(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() { + // TODO: test validations + String username = null; + //Uni response = api.getUserByName(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() { + // TODO: test validations + String username = null; + String password = null; + //Uni response = api.loginUser(username, password); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() { + // TODO: test validations + //api.logoutUser(); + //Assertions.assertNotNull(response); + + + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() { + // TODO: test validations + String username = null; + User user = null; + //api.updateUser(username, user); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 00000000000..771a8adfc10 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..cb93c71c01a --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + void messageTest() { + // TODO: test message + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 00000000000..7918486f952 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,88 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Date; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 00000000000..ed94deb2281 --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/PetTest.java @@ -0,0 +1,92 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 00000000000..dcb96e16fca --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/TagTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 00000000000..965d74fa03e --- /dev/null +++ b/samples/server/petstore/java-microprofile/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,103 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/server/petstore/java-undertow/pom.xml b/samples/server/petstore/java-undertow/pom.xml index 04503f650a6..300e1ddd4e8 100644 --- a/samples/server/petstore/java-undertow/pom.xml +++ b/samples/server/petstore/java-undertow/pom.xml @@ -29,7 +29,7 @@ 1.4.13 4.13.2 2.1.0-beta.124 - 2.3.5.Final + 2.3.12.Final 2.2.0 4.5.13 4.1.2 diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java index c7836faf3cd..d7f95098d63 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public class AnotherFakeApi { String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + delegate = (AnotherFakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index c3e23ef69e8..fbb0a2304a8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -50,7 +50,7 @@ public class FakeApi { String implClass = servletContext.getInitParameter("FakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeApiService) Class.forName(implClass).newInstance(); + delegate = (FakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -185,7 +185,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) + public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } @@ -209,7 +209,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) + public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } @@ -233,7 +233,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 3e1fd94e7e6..659d776ecea 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -40,7 +40,7 @@ public class FakeClassnameTestApi { String implClass = servletContext.getInitParameter("FakeClassnameTestApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeClassnameTestApiService) Class.forName(implClass).newInstance(); + delegate = (FakeClassnameTestApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index 8ad2cebe734..96415372be1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -43,7 +43,7 @@ public class PetApi { String implClass = servletContext.getInitParameter("PetApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (PetApiService) Class.forName(implClass).newInstance(); + delegate = (PetApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -107,7 +107,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } @@ -125,7 +125,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java index 2bce0668e5d..e0a14f67035 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/StoreApi.java @@ -41,7 +41,7 @@ public class StoreApi { String implClass = servletContext.getInitParameter("StoreApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (StoreApiService) Class.forName(implClass).newInstance(); + delegate = (StoreApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java index 39511b16ad5..9cac8515c30 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java @@ -41,7 +41,7 @@ public class UserApi { String implClass = servletContext.getInitParameter("UserApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (UserApiService) Class.forName(implClass).newInstance(); + delegate = (UserApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index a5867d66122..0d90ced8819 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -220,7 +220,7 @@ public class AdditionalPropertiesClass implements Serializable { **/ @JsonProperty(value = "map_array_integer") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -248,7 +248,7 @@ public class AdditionalPropertiesClass implements Serializable { **/ @JsonProperty(value = "map_array_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -276,7 +276,7 @@ public class AdditionalPropertiesClass implements Serializable { **/ @JsonProperty(value = "map_map_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapString() { return mapMapString; } @@ -304,7 +304,7 @@ public class AdditionalPropertiesClass implements Serializable { **/ @JsonProperty(value = "map_map_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapAnytype() { return mapMapAnytype; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java index 84b5e8bad4e..d15d42e5041 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java @@ -96,7 +96,7 @@ public class ArrayTest implements Serializable { **/ @JsonProperty(value = "array_array_of_integer") @ApiModelProperty(value = "") - @Valid + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 3aa63cc7bbb..b86c495564a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -277,7 +277,7 @@ public class EnumTest implements Serializable { **/ @JsonProperty(value = "outerEnum") @ApiModelProperty(value = "") - @Valid + public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 8390c42fdec..b6df7ae5751 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -103,7 +103,7 @@ public class MapTest implements Serializable { **/ @JsonProperty(value = "map_map_of_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java index fc9f9fd7fdb..9c947fc495d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -40,7 +40,7 @@ public class AnotherFakeApi { String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + delegate = (AnotherFakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 8f6bc091add..34c7d235408 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -55,7 +55,7 @@ public class FakeApi { String implClass = servletContext.getInitParameter("FakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeApiService) Class.forName(implClass).newInstance(); + delegate = (FakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -175,7 +175,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testAdditionalPropertiesReference(@ApiParam(value = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testAdditionalPropertiesReference(@ApiParam(value = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testAdditionalPropertiesReference(requestBody, securityContext); } @@ -252,7 +252,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "") @QueryParam("enum_query_model_array") @Valid List enumQueryModelArray,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) + public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "") @QueryParam("enum_query_model_array") List enumQueryModelArray,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, securityContext); } @@ -278,7 +278,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(requestBody, securityContext); } @@ -326,7 +326,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@ApiParam(value = "", required = true) @QueryParam("allowEmpty") @NotNull String allowEmpty,@ApiParam(value = "") @QueryParam("language") @Valid Map language,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull List context,@ApiParam(value = "", required = true) @QueryParam("allowEmpty") @NotNull String allowEmpty,@ApiParam(value = "") @QueryParam("language") Map language,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } @@ -338,7 +338,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testStringMapReference(@ApiParam(value = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testStringMapReference(@ApiParam(value = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testStringMapReference(requestBody, securityContext); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index cd8310f0dee..4a4fa163006 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -40,7 +40,7 @@ public class FakeClassnameTestApi { String implClass = servletContext.getInitParameter("FakeClassnameTestApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeClassnameTestApiService) Class.forName(implClass).newInstance(); + delegate = (FakeClassnameTestApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java index dc9b3f07067..f49be22d8d1 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FooApi.java @@ -40,7 +40,7 @@ public class FooApi { String implClass = servletContext.getInitParameter("FooApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FooApiService) Class.forName(implClass).newInstance(); + delegate = (FooApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java index e02e7ec0743..0e11b586c25 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/PetApi.java @@ -43,7 +43,7 @@ public class PetApi { String implClass = servletContext.getInitParameter("PetApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (PetApiService) Class.forName(implClass).newInstance(); + delegate = (PetApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -107,7 +107,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } @@ -125,7 +125,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java index 886b4c9739c..bfb30f0ac84 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/StoreApi.java @@ -41,7 +41,7 @@ public class StoreApi { String implClass = servletContext.getInitParameter("StoreApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (StoreApiService) Class.forName(implClass).newInstance(); + delegate = (StoreApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java index 3bfeb043851..4d79f92106e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java @@ -41,7 +41,7 @@ public class UserApi { String implClass = servletContext.getInitParameter("UserApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (UserApiService) Class.forName(implClass).newInstance(); + delegate = (UserApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 686a776f7f3..540179ba3d9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -88,7 +88,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_of_map_property") @ApiModelProperty(value = "") - @Valid + public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java index 40747d2821f..2cae7c91421 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -72,7 +72,7 @@ public class AllOfWithSingleRef { **/ @JsonProperty(value = "SingleRefType") @ApiModelProperty(value = "") - @Valid + public SingleRefType getSingleRefType() { return singleRefType; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java index 73b6cb9dca0..7f6ad91f65e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java @@ -95,7 +95,7 @@ public class ArrayTest { **/ @JsonProperty(value = "array_array_of_integer") @ApiModelProperty(value = "") - @Valid + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index e61879b140d..b179ca2c7af 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -294,7 +294,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnum") @ApiModelProperty(value = "") - @Valid + public OuterEnum getOuterEnum() { return outerEnum; } @@ -314,7 +314,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumInteger") @ApiModelProperty(value = "") - @Valid + public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; } @@ -334,7 +334,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumDefaultValue") @ApiModelProperty(value = "") - @Valid + public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; } @@ -354,7 +354,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumIntegerDefaultValue") @ApiModelProperty(value = "") - @Valid + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index 6964f05371b..4894c8722a5 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -102,7 +102,7 @@ public class MapTest { **/ @JsonProperty(value = "map_map_of_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java index a2d64046344..3917a760eb8 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -47,7 +47,7 @@ public class OuterObjectWithEnumProperty { **/ @JsonProperty(value = "value") @ApiModelProperty(required = true, value = "") - @NotNull @Valid + @NotNull public OuterEnumInteger getValue() { return value; } diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ParentWithNullable.java index b06bce2b112..3435c10e153 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ParentWithNullable.java @@ -43,7 +43,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/jaxrs-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index cb7d71acdfd..b2b276f2377 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -153,8 +153,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -165,8 +165,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.13.0.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 1.3.5 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index 99c9881b888..ccd1d916afb 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -131,8 +131,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -143,8 +143,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -189,7 +189,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.0.11.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index 2c9e53d49f9..87766d3d78f 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -131,8 +131,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -143,8 +143,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -189,7 +189,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.0.11.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index 13bcbc03e35..acae0f547e6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -131,8 +131,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -143,8 +143,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -189,7 +189,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.0.11.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 2.0.2 1.3.5 diff --git a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml index 88e39654293..afd4d8e81dc 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml @@ -153,8 +153,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -165,8 +165,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.13.0.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 1.3.5 2.0.2 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index ad8ca97ed48..ccaaff51bb9 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -153,8 +153,8 @@ for this project used jakarta.validation-api --> - junit - junit + org.junit.jupiter + junit-jupiter-api ${junit-version} test @@ -165,8 +165,8 @@ for this project used jakarta.validation-api --> test - junit - junit + junit-jupiter-api + org.junit.jupiter snakeyaml @@ -207,7 +207,7 @@ for this project used jakarta.validation-api --> 9.2.9.v20150224 3.13.0.Final 1.6.3 - 4.13.2 + 5.10.2 4.0.4 1.3.5 2.0.2 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index becf131d1de..67ece8e73f0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -88,6 +88,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -100,5 +105,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 651a652fd85..b9533d6e4a2 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -62,9 +62,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { - if (mapStringItem != null && this.mapString != null) { - this.mapString.remove(mapStringItem); + public AdditionalPropertiesClass removeMapStringItem(String key) { + if (this.mapString != null) { + this.mapString.remove(key); } return this; @@ -97,9 +97,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { - if (mapNumberItem != null && this.mapNumber != null) { - this.mapNumber.remove(mapNumberItem); + public AdditionalPropertiesClass removeMapNumberItem(String key) { + if (this.mapNumber != null) { + this.mapNumber.remove(key); } return this; @@ -132,9 +132,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { - if (mapIntegerItem != null && this.mapInteger != null) { - this.mapInteger.remove(mapIntegerItem); + public AdditionalPropertiesClass removeMapIntegerItem(String key) { + if (this.mapInteger != null) { + this.mapInteger.remove(key); } return this; @@ -167,9 +167,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { - if (mapBooleanItem != null && this.mapBoolean != null) { - this.mapBoolean.remove(mapBooleanItem); + public AdditionalPropertiesClass removeMapBooleanItem(String key) { + if (this.mapBoolean != null) { + this.mapBoolean.remove(key); } return this; @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -202,9 +202,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { - if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { - this.mapArrayInteger.remove(mapArrayIntegerItem); + public AdditionalPropertiesClass removeMapArrayIntegerItem(String key) { + if (this.mapArrayInteger != null) { + this.mapArrayInteger.remove(key); } return this; @@ -219,7 +219,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -237,9 +237,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { - if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(mapArrayAnytypeItem); + public AdditionalPropertiesClass removeMapArrayAnytypeItem(String key) { + if (this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(key); } return this; @@ -254,7 +254,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { + public Map> getMapMapString() { return mapMapString; } @@ -272,9 +272,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { - if (mapMapStringItem != null && this.mapMapString != null) { - this.mapMapString.remove(mapMapStringItem); + public AdditionalPropertiesClass removeMapMapStringItem(String key) { + if (this.mapMapString != null) { + this.mapMapString.remove(key); } return this; @@ -289,7 +289,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { + public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -307,9 +307,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { - if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { - this.mapMapAnytype.remove(mapMapAnytypeItem); + public AdditionalPropertiesClass removeMapMapAnytypeItem(String key) { + if (this.mapMapAnytype != null) { + this.mapMapAnytype.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index 3fa8016041c..b041c854d2c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -71,7 +71,7 @@ public class ArrayTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") - @Valid public List> getArrayArrayOfInteger() { + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index 26b4cbfbfe0..b1b23e39f0c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -300,7 +300,7 @@ public class EnumTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - @Valid public OuterEnum getOuterEnum() { + public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index 5c6995a658f..93ebc9f2488 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -212,7 +212,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("binary") - @Valid public File getBinary() { + public File getBinary() { return binary; } @@ -231,7 +231,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("date") - @NotNull @Valid public LocalDate getDate() { + @NotNull public LocalDate getDate() { return date; } @@ -250,7 +250,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -269,7 +269,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index 00ea470c467..cc217b64e18 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -82,7 +82,7 @@ public class MapTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") - @Valid public Map> getMapMapOfString() { + public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,9 +100,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { - if (mapMapOfStringItem != null && this.mapMapOfString != null) { - this.mapMapOfString.remove(mapMapOfStringItem); + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); } return this; @@ -135,9 +135,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { - if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { - this.mapOfEnumString.remove(mapOfEnumStringItem); + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); } return this; @@ -170,9 +170,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeDirectMapItem(Boolean directMapItem) { - if (directMapItem != null && this.directMap != null) { - this.directMap.remove(directMapItem); + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); } return this; @@ -205,9 +205,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeIndirectMapItem(Boolean indirectMapItem) { - if (indirectMapItem != null && this.indirectMap != null) { - this.indirectMap.remove(indirectMapItem); + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 33c67f34e93..cdd5527e421 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -56,7 +56,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -93,9 +93,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return this; } - public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { - if (mapItem != null && this.map != null) { - this.map.remove(mapItem); + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java index 0a6c94a38f1..8278983890d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java @@ -140,7 +140,7 @@ public class Order implements Serializable { @ApiModelProperty(value = "") @JsonProperty("shipDate") - @Valid public Date getShipDate() { + public Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index b614cca4796..f9ac6496192 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -88,6 +88,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -100,5 +105,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 651a652fd85..b9533d6e4a2 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -62,9 +62,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { - if (mapStringItem != null && this.mapString != null) { - this.mapString.remove(mapStringItem); + public AdditionalPropertiesClass removeMapStringItem(String key) { + if (this.mapString != null) { + this.mapString.remove(key); } return this; @@ -97,9 +97,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { - if (mapNumberItem != null && this.mapNumber != null) { - this.mapNumber.remove(mapNumberItem); + public AdditionalPropertiesClass removeMapNumberItem(String key) { + if (this.mapNumber != null) { + this.mapNumber.remove(key); } return this; @@ -132,9 +132,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { - if (mapIntegerItem != null && this.mapInteger != null) { - this.mapInteger.remove(mapIntegerItem); + public AdditionalPropertiesClass removeMapIntegerItem(String key) { + if (this.mapInteger != null) { + this.mapInteger.remove(key); } return this; @@ -167,9 +167,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { - if (mapBooleanItem != null && this.mapBoolean != null) { - this.mapBoolean.remove(mapBooleanItem); + public AdditionalPropertiesClass removeMapBooleanItem(String key) { + if (this.mapBoolean != null) { + this.mapBoolean.remove(key); } return this; @@ -184,7 +184,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -202,9 +202,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { - if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { - this.mapArrayInteger.remove(mapArrayIntegerItem); + public AdditionalPropertiesClass removeMapArrayIntegerItem(String key) { + if (this.mapArrayInteger != null) { + this.mapArrayInteger.remove(key); } return this; @@ -219,7 +219,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -237,9 +237,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { - if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(mapArrayAnytypeItem); + public AdditionalPropertiesClass removeMapArrayAnytypeItem(String key) { + if (this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(key); } return this; @@ -254,7 +254,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { + public Map> getMapMapString() { return mapMapString; } @@ -272,9 +272,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { - if (mapMapStringItem != null && this.mapMapString != null) { - this.mapMapString.remove(mapMapStringItem); + public AdditionalPropertiesClass removeMapMapStringItem(String key) { + if (this.mapMapString != null) { + this.mapMapString.remove(key); } return this; @@ -289,7 +289,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { + public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -307,9 +307,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { - if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { - this.mapMapAnytype.remove(mapMapAnytypeItem); + public AdditionalPropertiesClass removeMapMapAnytypeItem(String key) { + if (this.mapMapAnytype != null) { + this.mapMapAnytype.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java index 3fa8016041c..b041c854d2c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/ArrayTest.java @@ -71,7 +71,7 @@ public class ArrayTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") - @Valid public List> getArrayArrayOfInteger() { + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java index 26b4cbfbfe0..b1b23e39f0c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/EnumTest.java @@ -300,7 +300,7 @@ public class EnumTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - @Valid public OuterEnum getOuterEnum() { + public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java index 5c6995a658f..93ebc9f2488 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java @@ -212,7 +212,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("binary") - @Valid public File getBinary() { + public File getBinary() { return binary; } @@ -231,7 +231,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("date") - @NotNull @Valid public LocalDate getDate() { + @NotNull public LocalDate getDate() { return date; } @@ -250,7 +250,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -269,7 +269,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java index 00ea470c467..cc217b64e18 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MapTest.java @@ -82,7 +82,7 @@ public class MapTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") - @Valid public Map> getMapMapOfString() { + public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,9 +100,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { - if (mapMapOfStringItem != null && this.mapMapOfString != null) { - this.mapMapOfString.remove(mapMapOfStringItem); + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); } return this; @@ -135,9 +135,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { - if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { - this.mapOfEnumString.remove(mapOfEnumStringItem); + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); } return this; @@ -170,9 +170,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeDirectMapItem(Boolean directMapItem) { - if (directMapItem != null && this.directMap != null) { - this.directMap.remove(directMapItem); + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); } return this; @@ -205,9 +205,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeIndirectMapItem(Boolean indirectMapItem) { - if (indirectMapItem != null && this.indirectMap != null) { - this.indirectMap.remove(indirectMapItem); + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 33c67f34e93..cdd5527e421 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -56,7 +56,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -93,9 +93,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return this; } - public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { - if (mapItem != null && this.map != null) { - this.map.remove(mapItem); + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); } return this; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java index 0a6c94a38f1..8278983890d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Order.java @@ -140,7 +140,7 @@ public class Order implements Serializable { @ApiModelProperty(value = "") @JsonProperty("shipDate") - @Valid public Date getShipDate() { + public Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml index 6012c260277..0d0ce11b1b3 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml +++ b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 2.1.1 3.0.2 3.1.0 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f933a5f2948..0c85e6c0bce 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -79,9 +79,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { - if (mapStringItem != null && this.mapString != null) { - this.mapString.remove(mapStringItem); + public AdditionalPropertiesClass removeMapStringItem(String key) { + if (this.mapString != null) { + this.mapString.remove(key); } return this; @@ -114,9 +114,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { - if (mapNumberItem != null && this.mapNumber != null) { - this.mapNumber.remove(mapNumberItem); + public AdditionalPropertiesClass removeMapNumberItem(String key) { + if (this.mapNumber != null) { + this.mapNumber.remove(key); } return this; @@ -149,9 +149,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { - if (mapIntegerItem != null && this.mapInteger != null) { - this.mapInteger.remove(mapIntegerItem); + public AdditionalPropertiesClass removeMapIntegerItem(String key) { + if (this.mapInteger != null) { + this.mapInteger.remove(key); } return this; @@ -184,9 +184,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { - if (mapBooleanItem != null && this.mapBoolean != null) { - this.mapBoolean.remove(mapBooleanItem); + public AdditionalPropertiesClass removeMapBooleanItem(String key) { + if (this.mapBoolean != null) { + this.mapBoolean.remove(key); } return this; @@ -201,7 +201,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -219,9 +219,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { - if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { - this.mapArrayInteger.remove(mapArrayIntegerItem); + public AdditionalPropertiesClass removeMapArrayIntegerItem(String key) { + if (this.mapArrayInteger != null) { + this.mapArrayInteger.remove(key); } return this; @@ -236,7 +236,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -254,9 +254,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { - if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(mapArrayAnytypeItem); + public AdditionalPropertiesClass removeMapArrayAnytypeItem(String key) { + if (this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(key); } return this; @@ -271,7 +271,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { + public Map> getMapMapString() { return mapMapString; } @@ -289,9 +289,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { - if (mapMapStringItem != null && this.mapMapString != null) { - this.mapMapString.remove(mapMapStringItem); + public AdditionalPropertiesClass removeMapMapStringItem(String key) { + if (this.mapMapString != null) { + this.mapMapString.remove(key); } return this; @@ -306,7 +306,7 @@ public class AdditionalPropertiesClass implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { + public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -324,9 +324,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { - if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { - this.mapMapAnytype.remove(mapMapAnytypeItem); + public AdditionalPropertiesClass removeMapMapAnytypeItem(String key) { + if (this.mapMapAnytype != null) { + this.mapMapAnytype.remove(key); } return this; @@ -452,7 +452,7 @@ public class AdditionalPropertiesClass implements Serializable { return new AdditionalPropertiesClassBuilderImpl(); } - private static final class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { + private static class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { @Override protected AdditionalPropertiesClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Animal.java index d644ba3e0a5..c52e5bf6c34 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Animal.java @@ -122,7 +122,7 @@ public class Animal implements Serializable { return new AnimalBuilderImpl(); } - private static final class AnimalBuilderImpl extends AnimalBuilder { + private static class AnimalBuilderImpl extends AnimalBuilder { @Override protected AnimalBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index bb23383dbfe..dbd4be9acb0 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -110,7 +110,7 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { return new ArrayOfArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { + private static class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { @Override protected ArrayOfArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 86807e2c3fe..3c00d061824 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -110,7 +110,7 @@ public class ArrayOfNumberOnly implements Serializable { return new ArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { + private static class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { @Override protected ArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java index 974bcfe956a..d602c8250c3 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java @@ -80,7 +80,7 @@ public class ArrayTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") - @Valid public List> getArrayArrayOfInteger() { + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -188,7 +188,7 @@ public class ArrayTest implements Serializable { return new ArrayTestBuilderImpl(); } - private static final class ArrayTestBuilderImpl extends ArrayTestBuilder { + private static class ArrayTestBuilderImpl extends ArrayTestBuilder { @Override protected ArrayTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/BigCat.java index 0e50bf7bf20..6bb1e6cda3d 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/BigCat.java @@ -140,7 +140,7 @@ public class BigCat extends Cat implements Serializable { return new BigCatBuilderImpl(); } - private static final class BigCatBuilderImpl extends BigCatBuilder { + private static class BigCatBuilderImpl extends BigCatBuilder { @Override protected BigCatBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Capitalization.java index 56f671c5a6b..438e3443869 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Capitalization.java @@ -206,7 +206,7 @@ public class Capitalization implements Serializable { return new CapitalizationBuilderImpl(); } - private static final class CapitalizationBuilderImpl extends CapitalizationBuilder { + private static class CapitalizationBuilderImpl extends CapitalizationBuilder { @Override protected CapitalizationBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Cat.java index 6b2c3115147..a68c53c7168 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Cat.java @@ -93,7 +93,7 @@ public class Cat extends Animal implements Serializable { return new CatBuilderImpl(); } - private static final class CatBuilderImpl extends CatBuilder { + private static class CatBuilderImpl extends CatBuilder { @Override protected CatBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Category.java index 5eae31ae513..0661dcaf013 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Category.java @@ -113,7 +113,7 @@ public class Category implements Serializable { return new CategoryBuilderImpl(); } - private static final class CategoryBuilderImpl extends CategoryBuilder { + private static class CategoryBuilderImpl extends CategoryBuilder { @Override protected CategoryBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ClassModel.java index 4715223b256..9a19a1b8284 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ClassModel.java @@ -92,7 +92,7 @@ public class ClassModel implements Serializable { return new ClassModelBuilderImpl(); } - private static final class ClassModelBuilderImpl extends ClassModelBuilder { + private static class ClassModelBuilderImpl extends ClassModelBuilder { @Override protected ClassModelBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Client.java index 94a0efd2ba1..ebf1e99f1e3 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Client.java @@ -90,7 +90,7 @@ public class Client implements Serializable { return new ClientBuilderImpl(); } - private static final class ClientBuilderImpl extends ClientBuilder { + private static class ClientBuilderImpl extends ClientBuilder { @Override protected ClientBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Dog.java index b4a9155dab3..615a96e230a 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Dog.java @@ -93,7 +93,7 @@ public class Dog extends Animal implements Serializable { return new DogBuilderImpl(); } - private static final class DogBuilderImpl extends DogBuilder { + private static class DogBuilderImpl extends DogBuilder { @Override protected DogBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java index b958bb992e4..63d945f013f 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java @@ -226,7 +226,7 @@ public class EnumArrays implements Serializable { return new EnumArraysBuilderImpl(); } - private static final class EnumArraysBuilderImpl extends EnumArraysBuilder { + private static class EnumArraysBuilderImpl extends EnumArraysBuilder { @Override protected EnumArraysBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumTest.java index 4ab5e961d84..6278457e504 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumTest.java @@ -311,7 +311,7 @@ public class EnumTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - @Valid public OuterEnum getOuterEnum() { + public OuterEnum getOuterEnum() { return outerEnum; } @@ -372,7 +372,7 @@ public class EnumTest implements Serializable { return new EnumTestBuilderImpl(); } - private static final class EnumTestBuilderImpl extends EnumTestBuilder { + private static class EnumTestBuilderImpl extends EnumTestBuilder { @Override protected EnumTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 959c10f4aaf..ca3e532f37b 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -133,7 +133,7 @@ public class FileSchemaTestClass implements Serializable { return new FileSchemaTestClassBuilderImpl(); } - private static final class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { + private static class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { @Override protected FileSchemaTestClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FormatTest.java index ac9250b2bca..cd2d763c58c 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FormatTest.java @@ -232,7 +232,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("binary") - @Valid public File getBinary() { + public File getBinary() { return binary; } @@ -251,7 +251,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("date") - @NotNull @Valid public LocalDate getDate() { + @NotNull public LocalDate getDate() { return date; } @@ -270,7 +270,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -289,7 +289,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -406,7 +406,7 @@ public class FormatTest implements Serializable { return new FormatTestBuilderImpl(); } - private static final class FormatTestBuilderImpl extends FormatTestBuilder { + private static class FormatTestBuilderImpl extends FormatTestBuilder { @Override protected FormatTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 8d68a7f2d1d..a865c57fde4 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -114,7 +114,7 @@ public class HasOnlyReadOnly implements Serializable { return new HasOnlyReadOnlyBuilderImpl(); } - private static final class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { + private static class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { @Override protected HasOnlyReadOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java index 7432103d74f..457d7af6814 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java @@ -92,7 +92,7 @@ public class MapTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") - @Valid public Map> getMapMapOfString() { + public Map> getMapMapOfString() { return mapMapOfString; } @@ -110,9 +110,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { - if (mapMapOfStringItem != null && this.mapMapOfString != null) { - this.mapMapOfString.remove(mapMapOfStringItem); + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); } return this; @@ -145,9 +145,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { - if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { - this.mapOfEnumString.remove(mapOfEnumStringItem); + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); } return this; @@ -180,9 +180,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeDirectMapItem(Boolean directMapItem) { - if (directMapItem != null && this.directMap != null) { - this.directMap.remove(directMapItem); + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); } return this; @@ -215,9 +215,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeIndirectMapItem(Boolean indirectMapItem) { - if (indirectMapItem != null && this.indirectMap != null) { - this.indirectMap.remove(indirectMapItem); + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); } return this; @@ -272,7 +272,7 @@ public class MapTest implements Serializable { return new MapTestBuilderImpl(); } - private static final class MapTestBuilderImpl extends MapTestBuilder { + private static class MapTestBuilderImpl extends MapTestBuilder { @Override protected MapTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2318aeeb781..9be20afe832 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -102,9 +102,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return this; } - public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { - if (mapItem != null && this.map != null) { - this.map.remove(mapItem); + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); } return this; @@ -157,7 +157,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl(); } - private static final class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { + private static class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { @Override protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Model200Response.java index 0a2494a3e8b..2fe29813256 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Model200Response.java @@ -116,7 +116,7 @@ public class Model200Response implements Serializable { return new Model200ResponseBuilderImpl(); } - private static final class Model200ResponseBuilderImpl extends Model200ResponseBuilder { + private static class Model200ResponseBuilderImpl extends Model200ResponseBuilder { @Override protected Model200ResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelApiResponse.java index 03a4bba8396..9f42411e2fd 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -137,7 +137,7 @@ public class ModelApiResponse implements Serializable { return new ModelApiResponseBuilderImpl(); } - private static final class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { + private static class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { @Override protected ModelApiResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelFile.java index 00e3251297a..c7be19ba672 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelFile.java @@ -94,7 +94,7 @@ public class ModelFile implements Serializable { return new ModelFileBuilderImpl(); } - private static final class ModelFileBuilderImpl extends ModelFileBuilder { + private static class ModelFileBuilderImpl extends ModelFileBuilder { @Override protected ModelFileBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelList.java index 5ac07dde830..05f4db93d77 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelList.java @@ -91,7 +91,7 @@ public class ModelList implements Serializable { return new ModelListBuilderImpl(); } - private static final class ModelListBuilderImpl extends ModelListBuilder { + private static class ModelListBuilderImpl extends ModelListBuilder { @Override protected ModelListBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelReturn.java index 9814ce06721..a0e17a5c6bc 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ModelReturn.java @@ -93,7 +93,7 @@ public class ModelReturn implements Serializable { return new ModelReturnBuilderImpl(); } - private static final class ModelReturnBuilderImpl extends ModelReturnBuilder { + private static class ModelReturnBuilderImpl extends ModelReturnBuilder { @Override protected ModelReturnBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Name.java index 39e8cd1d027..4a5d6950588 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Name.java @@ -161,7 +161,7 @@ public class Name implements Serializable { return new NameBuilderImpl(); } - private static final class NameBuilderImpl extends NameBuilder { + private static class NameBuilderImpl extends NameBuilder { @Override protected NameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/NumberOnly.java index 1d1800a2a4e..857e22185c5 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/NumberOnly.java @@ -91,7 +91,7 @@ public class NumberOnly implements Serializable { return new NumberOnlyBuilderImpl(); } - private static final class NumberOnlyBuilderImpl extends NumberOnlyBuilder { + private static class NumberOnlyBuilderImpl extends NumberOnlyBuilder { @Override protected NumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Order.java index 9fe4d47bf17..bf9a391d8c1 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Order.java @@ -152,7 +152,7 @@ public class Order implements Serializable { @ApiModelProperty(value = "") @JsonProperty("shipDate") - @Valid public Date getShipDate() { + public Date getShipDate() { return shipDate; } @@ -254,7 +254,7 @@ public class Order implements Serializable { return new OrderBuilderImpl(); } - private static final class OrderBuilderImpl extends OrderBuilder { + private static class OrderBuilderImpl extends OrderBuilder { @Override protected OrderBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/OuterComposite.java index dcd94f26028..8a9ed56ec06 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/OuterComposite.java @@ -137,7 +137,7 @@ public class OuterComposite implements Serializable { return new OuterCompositeBuilderImpl(); } - private static final class OuterCompositeBuilderImpl extends OuterCompositeBuilder { + private static class OuterCompositeBuilderImpl extends OuterCompositeBuilder { @Override protected OuterCompositeBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java index ee19ad80693..2086d478517 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java @@ -294,7 +294,7 @@ public class Pet implements Serializable { return new PetBuilderImpl(); } - private static final class PetBuilderImpl extends PetBuilder { + private static class PetBuilderImpl extends PetBuilder { @Override protected PetBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 86d133b4718..b99d2064c15 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -113,7 +113,7 @@ public class ReadOnlyFirst implements Serializable { return new ReadOnlyFirstBuilderImpl(); } - private static final class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { + private static class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { @Override protected ReadOnlyFirstBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/SpecialModelName.java index 344d98f73af..d247f33a9b6 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -91,7 +91,7 @@ public class SpecialModelName implements Serializable { return new SpecialModelNameBuilderImpl(); } - private static final class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { + private static class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { @Override protected SpecialModelNameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Tag.java index ccd15eba82d..d313dad1713 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Tag.java @@ -113,7 +113,7 @@ public class Tag implements Serializable { return new TagBuilderImpl(); } - private static final class TagBuilderImpl extends TagBuilder { + private static class TagBuilderImpl extends TagBuilder { @Override protected TagBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 3e0bb82e403..06fea5c8be0 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -202,7 +202,7 @@ public class TypeHolderDefault implements Serializable { return new TypeHolderDefaultBuilderImpl(); } - private static final class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder { + private static class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder { @Override protected TypeHolderDefaultBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderExample.java index b6cbe0188be..014140ed9d3 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -225,7 +225,7 @@ public class TypeHolderExample implements Serializable { return new TypeHolderExampleBuilderImpl(); } - private static final class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder { + private static class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder { @Override protected TypeHolderExampleBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/User.java index c7f4221dfd4..b73a9349989 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/User.java @@ -252,7 +252,7 @@ public class User implements Serializable { return new UserBuilderImpl(); } - private static final class UserBuilderImpl extends UserBuilder { + private static class UserBuilderImpl extends UserBuilder { @Override protected UserBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java index 7eda321124d..0ee6925d77a 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java @@ -882,7 +882,7 @@ public class XmlItem implements Serializable { return new XmlItemBuilderImpl(); } - private static final class XmlItemBuilderImpl extends XmlItemBuilder { + private static class XmlItemBuilderImpl extends XmlItemBuilder { @Override protected XmlItemBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f91668643c3..6e73e9a0bea 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -77,9 +77,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { - if (mapStringItem != null && this.mapString != null) { - this.mapString.remove(mapStringItem); + public AdditionalPropertiesClass removeMapStringItem(String key) { + if (this.mapString != null) { + this.mapString.remove(key); } return this; @@ -112,9 +112,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { - if (mapNumberItem != null && this.mapNumber != null) { - this.mapNumber.remove(mapNumberItem); + public AdditionalPropertiesClass removeMapNumberItem(String key) { + if (this.mapNumber != null) { + this.mapNumber.remove(key); } return this; @@ -147,9 +147,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { - if (mapIntegerItem != null && this.mapInteger != null) { - this.mapInteger.remove(mapIntegerItem); + public AdditionalPropertiesClass removeMapIntegerItem(String key) { + if (this.mapInteger != null) { + this.mapInteger.remove(key); } return this; @@ -182,9 +182,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { - if (mapBooleanItem != null && this.mapBoolean != null) { - this.mapBoolean.remove(mapBooleanItem); + public AdditionalPropertiesClass removeMapBooleanItem(String key) { + if (this.mapBoolean != null) { + this.mapBoolean.remove(key); } return this; @@ -199,7 +199,7 @@ public class AdditionalPropertiesClass implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -217,9 +217,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { - if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { - this.mapArrayInteger.remove(mapArrayIntegerItem); + public AdditionalPropertiesClass removeMapArrayIntegerItem(String key) { + if (this.mapArrayInteger != null) { + this.mapArrayInteger.remove(key); } return this; @@ -234,7 +234,7 @@ public class AdditionalPropertiesClass implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -252,9 +252,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { - if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(mapArrayAnytypeItem); + public AdditionalPropertiesClass removeMapArrayAnytypeItem(String key) { + if (this.mapArrayAnytype != null) { + this.mapArrayAnytype.remove(key); } return this; @@ -269,7 +269,7 @@ public class AdditionalPropertiesClass implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { + public Map> getMapMapString() { return mapMapString; } @@ -287,9 +287,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { - if (mapMapStringItem != null && this.mapMapString != null) { - this.mapMapString.remove(mapMapStringItem); + public AdditionalPropertiesClass removeMapMapStringItem(String key) { + if (this.mapMapString != null) { + this.mapMapString.remove(key); } return this; @@ -304,7 +304,7 @@ public class AdditionalPropertiesClass implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { + public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -322,9 +322,9 @@ public class AdditionalPropertiesClass implements Serializable { return this; } - public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { - if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { - this.mapMapAnytype.remove(mapMapAnytypeItem); + public AdditionalPropertiesClass removeMapMapAnytypeItem(String key) { + if (this.mapMapAnytype != null) { + this.mapMapAnytype.remove(key); } return this; @@ -450,7 +450,7 @@ public class AdditionalPropertiesClass implements Serializable { return new AdditionalPropertiesClassBuilderImpl(); } - private static final class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { + private static class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { @Override protected AdditionalPropertiesClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java index 924651b8855..f3c43af63c4 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java @@ -120,7 +120,7 @@ public class Animal implements Serializable { return new AnimalBuilderImpl(); } - private static final class AnimalBuilderImpl extends AnimalBuilder { + private static class AnimalBuilderImpl extends AnimalBuilder { @Override protected AnimalBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 16c5e3cc2ea..2664538e451 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -108,7 +108,7 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { return new ArrayOfArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { + private static class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { @Override protected ArrayOfArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c3723e5a38a..5c728d8f036 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -108,7 +108,7 @@ public class ArrayOfNumberOnly implements Serializable { return new ArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { + private static class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { @Override protected ArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java index c07ad3b5e3a..4ed7f2ddc37 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java @@ -78,7 +78,7 @@ public class ArrayTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("array_array_of_integer") - @Valid public List> getArrayArrayOfInteger() { + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -186,7 +186,7 @@ public class ArrayTest implements Serializable { return new ArrayTestBuilderImpl(); } - private static final class ArrayTestBuilderImpl extends ArrayTestBuilder { + private static class ArrayTestBuilderImpl extends ArrayTestBuilder { @Override protected ArrayTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java index 406f10b05eb..b0ffd3d2dd9 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java @@ -138,7 +138,7 @@ public class BigCat extends Cat implements Serializable { return new BigCatBuilderImpl(); } - private static final class BigCatBuilderImpl extends BigCatBuilder { + private static class BigCatBuilderImpl extends BigCatBuilder { @Override protected BigCatBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java index 46d7c3d2737..912fe5d1271 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java @@ -204,7 +204,7 @@ public class Capitalization implements Serializable { return new CapitalizationBuilderImpl(); } - private static final class CapitalizationBuilderImpl extends CapitalizationBuilder { + private static class CapitalizationBuilderImpl extends CapitalizationBuilder { @Override protected CapitalizationBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java index a782e001eb6..8f73111f60f 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java @@ -91,7 +91,7 @@ public class Cat extends Animal implements Serializable { return new CatBuilderImpl(); } - private static final class CatBuilderImpl extends CatBuilder { + private static class CatBuilderImpl extends CatBuilder { @Override protected CatBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java index 4665cc3a4a7..c7dd2f984db 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java @@ -111,7 +111,7 @@ public class Category implements Serializable { return new CategoryBuilderImpl(); } - private static final class CategoryBuilderImpl extends CategoryBuilder { + private static class CategoryBuilderImpl extends CategoryBuilder { @Override protected CategoryBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java index 53ce22d2bc3..35ce3de9a56 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java @@ -90,7 +90,7 @@ public class ClassModel implements Serializable { return new ClassModelBuilderImpl(); } - private static final class ClassModelBuilderImpl extends ClassModelBuilder { + private static class ClassModelBuilderImpl extends ClassModelBuilder { @Override protected ClassModelBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java index 13553ef9dd0..cd096bb971f 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java @@ -88,7 +88,7 @@ public class Client implements Serializable { return new ClientBuilderImpl(); } - private static final class ClientBuilderImpl extends ClientBuilder { + private static class ClientBuilderImpl extends ClientBuilder { @Override protected ClientBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java index fa6fb47416b..20e775d8842 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java @@ -91,7 +91,7 @@ public class Dog extends Animal implements Serializable { return new DogBuilderImpl(); } - private static final class DogBuilderImpl extends DogBuilder { + private static class DogBuilderImpl extends DogBuilder { @Override protected DogBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java index 9ee0f698314..6b4f512f45c 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java @@ -224,7 +224,7 @@ public class EnumArrays implements Serializable { return new EnumArraysBuilderImpl(); } - private static final class EnumArraysBuilderImpl extends EnumArraysBuilder { + private static class EnumArraysBuilderImpl extends EnumArraysBuilder { @Override protected EnumArraysBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java index 6e58bd617db..0ba602b7369 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java @@ -309,7 +309,7 @@ public class EnumTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("outerEnum") - @Valid public OuterEnum getOuterEnum() { + public OuterEnum getOuterEnum() { return outerEnum; } @@ -370,7 +370,7 @@ public class EnumTest implements Serializable { return new EnumTestBuilderImpl(); } - private static final class EnumTestBuilderImpl extends EnumTestBuilder { + private static class EnumTestBuilderImpl extends EnumTestBuilder { @Override protected EnumTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2423fbcfb7d..a687aa29fae 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -131,7 +131,7 @@ public class FileSchemaTestClass implements Serializable { return new FileSchemaTestClassBuilderImpl(); } - private static final class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { + private static class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { @Override protected FileSchemaTestClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java index 29148dc9ca8..f44e4e04dee 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java @@ -230,7 +230,7 @@ public class FormatTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("binary") - @Valid public File getBinary() { + public File getBinary() { return binary; } @@ -249,7 +249,7 @@ public class FormatTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("date") - @NotNull @Valid public LocalDate getDate() { + @NotNull public LocalDate getDate() { return date; } @@ -268,7 +268,7 @@ public class FormatTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("dateTime") - @Valid public LocalDateTime getDateTime() { + public LocalDateTime getDateTime() { return dateTime; } @@ -287,7 +287,7 @@ public class FormatTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -404,7 +404,7 @@ public class FormatTest implements Serializable { return new FormatTestBuilderImpl(); } - private static final class FormatTestBuilderImpl extends FormatTestBuilder { + private static class FormatTestBuilderImpl extends FormatTestBuilder { @Override protected FormatTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 9abdb1d4320..2a96b715e86 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -112,7 +112,7 @@ public class HasOnlyReadOnly implements Serializable { return new HasOnlyReadOnlyBuilderImpl(); } - private static final class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { + private static class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { @Override protected HasOnlyReadOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java index bac1367578c..3ca6e253400 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java @@ -90,7 +90,7 @@ public class MapTest implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_of_string") - @Valid public Map> getMapMapOfString() { + public Map> getMapMapOfString() { return mapMapOfString; } @@ -108,9 +108,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { - if (mapMapOfStringItem != null && this.mapMapOfString != null) { - this.mapMapOfString.remove(mapMapOfStringItem); + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); } return this; @@ -143,9 +143,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { - if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { - this.mapOfEnumString.remove(mapOfEnumStringItem); + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); } return this; @@ -178,9 +178,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeDirectMapItem(Boolean directMapItem) { - if (directMapItem != null && this.directMap != null) { - this.directMap.remove(directMapItem); + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); } return this; @@ -213,9 +213,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeIndirectMapItem(Boolean indirectMapItem) { - if (indirectMapItem != null && this.indirectMap != null) { - this.indirectMap.remove(indirectMapItem); + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); } return this; @@ -270,7 +270,7 @@ public class MapTest implements Serializable { return new MapTestBuilderImpl(); } - private static final class MapTestBuilderImpl extends MapTestBuilder { + private static class MapTestBuilderImpl extends MapTestBuilder { @Override protected MapTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 42923159fba..cc3963533e4 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -44,7 +44,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("dateTime") - @Valid public LocalDateTime getDateTime() { + public LocalDateTime getDateTime() { return dateTime; } @@ -100,9 +100,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return this; } - public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { - if (mapItem != null && this.map != null) { - this.map.remove(mapItem); + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); } return this; @@ -155,7 +155,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl(); } - private static final class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { + private static class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { @Override protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java index bd807c4f90c..f7155491ccc 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java @@ -114,7 +114,7 @@ public class Model200Response implements Serializable { return new Model200ResponseBuilderImpl(); } - private static final class Model200ResponseBuilderImpl extends Model200ResponseBuilder { + private static class Model200ResponseBuilderImpl extends Model200ResponseBuilder { @Override protected Model200ResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java index 312cd053c7c..545f9724820 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -135,7 +135,7 @@ public class ModelApiResponse implements Serializable { return new ModelApiResponseBuilderImpl(); } - private static final class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { + private static class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { @Override protected ModelApiResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java index 7033a6ded5a..d7ee8d7b5b6 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java @@ -92,7 +92,7 @@ public class ModelFile implements Serializable { return new ModelFileBuilderImpl(); } - private static final class ModelFileBuilderImpl extends ModelFileBuilder { + private static class ModelFileBuilderImpl extends ModelFileBuilder { @Override protected ModelFileBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java index 0a8d273d5ad..fee323c08d1 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java @@ -89,7 +89,7 @@ public class ModelList implements Serializable { return new ModelListBuilderImpl(); } - private static final class ModelListBuilderImpl extends ModelListBuilder { + private static class ModelListBuilderImpl extends ModelListBuilder { @Override protected ModelListBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java index f344d626c64..cdc5cdb4e03 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java @@ -91,7 +91,7 @@ public class ModelReturn implements Serializable { return new ModelReturnBuilderImpl(); } - private static final class ModelReturnBuilderImpl extends ModelReturnBuilder { + private static class ModelReturnBuilderImpl extends ModelReturnBuilder { @Override protected ModelReturnBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java index 7455ca85658..752ab140b08 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java @@ -159,7 +159,7 @@ public class Name implements Serializable { return new NameBuilderImpl(); } - private static final class NameBuilderImpl extends NameBuilder { + private static class NameBuilderImpl extends NameBuilder { @Override protected NameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java index 61c1f53a028..020da59d7d8 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java @@ -89,7 +89,7 @@ public class NumberOnly implements Serializable { return new NumberOnlyBuilderImpl(); } - private static final class NumberOnlyBuilderImpl extends NumberOnlyBuilder { + private static class NumberOnlyBuilderImpl extends NumberOnlyBuilder { @Override protected NumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java index ce60b20563a..3f871a45035 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java @@ -150,7 +150,7 @@ public class Order implements Serializable { @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("shipDate") - @Valid public LocalDateTime getShipDate() { + public LocalDateTime getShipDate() { return shipDate; } @@ -252,7 +252,7 @@ public class Order implements Serializable { return new OrderBuilderImpl(); } - private static final class OrderBuilderImpl extends OrderBuilder { + private static class OrderBuilderImpl extends OrderBuilder { @Override protected OrderBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java index 77ea8d7a442..990e7fe8a2e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java @@ -135,7 +135,7 @@ public class OuterComposite implements Serializable { return new OuterCompositeBuilderImpl(); } - private static final class OuterCompositeBuilderImpl extends OuterCompositeBuilder { + private static class OuterCompositeBuilderImpl extends OuterCompositeBuilder { @Override protected OuterCompositeBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java index e8f9f6762e2..028924bdf17 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java @@ -292,7 +292,7 @@ public class Pet implements Serializable { return new PetBuilderImpl(); } - private static final class PetBuilderImpl extends PetBuilder { + private static class PetBuilderImpl extends PetBuilder { @Override protected PetBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 53b61de98dc..5aa6bea920e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -111,7 +111,7 @@ public class ReadOnlyFirst implements Serializable { return new ReadOnlyFirstBuilderImpl(); } - private static final class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { + private static class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { @Override protected ReadOnlyFirstBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java index f6c59a77fb3..089ed0b2e59 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -89,7 +89,7 @@ public class SpecialModelName implements Serializable { return new SpecialModelNameBuilderImpl(); } - private static final class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { + private static class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { @Override protected SpecialModelNameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java index 9bfce3c1755..f6d7690ff25 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java @@ -111,7 +111,7 @@ public class Tag implements Serializable { return new TagBuilderImpl(); } - private static final class TagBuilderImpl extends TagBuilder { + private static class TagBuilderImpl extends TagBuilder { @Override protected TagBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 7e69e1aeb8a..d07bccc9275 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -200,7 +200,7 @@ public class TypeHolderDefault implements Serializable { return new TypeHolderDefaultBuilderImpl(); } - private static final class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder { + private static class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder { @Override protected TypeHolderDefaultBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java index a8c018d5a93..96f342434b7 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -223,7 +223,7 @@ public class TypeHolderExample implements Serializable { return new TypeHolderExampleBuilderImpl(); } - private static final class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder { + private static class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder { @Override protected TypeHolderExampleBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java index b56bc2faa36..703d4ab8285 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java @@ -250,7 +250,7 @@ public class User implements Serializable { return new UserBuilderImpl(); } - private static final class UserBuilderImpl extends UserBuilder { + private static class UserBuilderImpl extends UserBuilder { @Override protected UserBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java index 8f1c6870d94..bac85f701bb 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java @@ -880,7 +880,7 @@ public class XmlItem implements Serializable { return new XmlItemBuilderImpl(); } - private static final class XmlItemBuilderImpl extends XmlItemBuilder { + private static class XmlItemBuilderImpl extends XmlItemBuilder { @Override protected XmlItemBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.dockerignore b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.dockerignore new file mode 100644 index 00000000000..b86c7ac3405 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.dockerignore @@ -0,0 +1,4 @@ +* +!target/*-runner +!target/*-runner.jar +!target/lib/* \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator-ignore b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/FILES new file mode 100644 index 00000000000..5b0d5374cd4 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/FILES @@ -0,0 +1,66 @@ +.dockerignore +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FooApi.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/RestApplication.java +src/gen/java/org/openapitools/api/RestResourceRoot.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AllOfWithSingleRef.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ChildWithNullable.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/DeprecatedObject.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/Foo.java +src/gen/java/org/openapitools/model/FooGetDefaultResponse.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/HealthCheckResult.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelFile.java +src/gen/java/org/openapitools/model/ModelList.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NullableClass.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java +src/gen/java/org/openapitools/model/OuterEnumInteger.java +src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java +src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +src/gen/java/org/openapitools/model/ParentWithNullable.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SingleRefType.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/gen/java/org/openapitools/model/User.java +src/main/docker/Dockerfile.jvm +src/main/docker/Dockerfile.native +src/main/resources/META-INF/openapi.yaml +src/main/resources/application.properties diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/README.md b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/README.md new file mode 100644 index 00000000000..929e2bbe4b9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/README.md @@ -0,0 +1,33 @@ +# JAX-RS server with OpenAPI using Quarkus + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an +[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. + +This is an example of building a OpenAPI-enabled JAX-RS server. +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. + +The pom file is configured to use [Quarkus](https://quarkus.io/) as application server. + + +To start the server in dev mode, run this maven command: + +```bash +mvn compile quarkus:dev +``` + +You can then call your server endpoints under: + +``` +http://localhost:8080/ +``` + +In dev-mode, you can open Swagger-UI at: + +``` +http://localhost:8080/swagger-ui/ +``` + +Read more in the [Quarkus OpenAPI guide](https://quarkus.io/guides/openapi-swaggerui-guide). + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/pom.xml b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/pom.xml new file mode 100644 index 00000000000..eb5c42b58b7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/pom.xml @@ -0,0 +1,157 @@ + + + 4.0.0 + org.openapitools + jaxrs-spec-petstore-server + jaxrs-spec-petstore-server + 1.0.0 + + + + 3.8.1 + true + 1.8 + 1.8 + UTF-8 + UTF-8 + 1.13.7.Final + 1.13.7.Final + quarkus-universe-bom + io.quarkus + 2.22.1 + 2.1.1 + 1.3.2 + 1.2.1 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-smallrye-openapi + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-version} + provided + + + javax.annotation + javax.annotation-api + ${javax.annotation-api-version} + + + io.smallrye + smallrye-rest-client + ${smallrye.rest.client.version} + test + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + + + + build + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + + native + + + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java new file mode 100644 index 00000000000..9099903209c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -0,0 +1,80 @@ +package org.openapitools.api; + +import org.openapitools.model.Client; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "", version="1.0.0", description="", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/another-fake/dummy") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AnotherFakeApi { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "call123testSpecialTags", summary = "To test special tags", description = "To test special tags and operation ID starting with number") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="$another-fake?") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class)) + }) + }) + public Response call123testSpecialTags(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java new file mode 100644 index 00000000000..84957675c2c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java @@ -0,0 +1,441 @@ +package org.openapitools.api; + +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; +import org.openapitools.model.Client; +import org.openapitools.model.EnumClass; +import org.openapitools.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.model.FileSchemaTestClass; +import org.openapitools.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Map; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.OuterComposite; +import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.model.User; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "", version="1.0.0", description="", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/fake") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeApi { + + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeBigDecimalMap", summary = "", description = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = FakeBigDecimalMap200Response.class)) + }) + }) + public Response fakeBigDecimalMap() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/health") + @Produces({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeHealthGet", summary = "Health check endpoint", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "The instance started successfully", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = HealthCheckResult.class)) + }) + }) + public Response fakeHealthGet() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "http_signature_test") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeHttpSignatureTest", summary = "test http signature authentication", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "The instance started successfully", content = { + + }) + }) + public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="query parameter") String query1,@HeaderParam("header_1") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="header parameter") String header1) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterBooleanSerialize", summary = "", description = "Test serialization of outer boolean types") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output boolean", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Boolean.class)) + }) + }) + public Response fakeOuterBooleanSerialize(@Valid Boolean body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterCompositeSerialize", summary = "", description = "Test serialization of object with outer number type") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output composite", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = OuterComposite.class)) + }) + }) + public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterNumberSerialize", summary = "", description = "Test serialization of outer number types") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output number", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = BigDecimal.class)) + }) + }) + public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterStringSerialize", summary = "", description = "Test serialization of outer string types") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output string", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class)) + }) + }) + public Response fakeOuterStringSerialize(@Valid String body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakePropertyEnumIntegerSerialize", summary = "", description = "Test serialization of enum (int) properties with examples") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Output enum (int)", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="*/*", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = OuterObjectWithEnumProperty.class)) + }) + }) + public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testAdditionalPropertiesReference", summary = "test referenced additionalProperties", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testAdditionalPropertiesReference(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithBinary", summary = "", description = "For this test, the body has to be a binary file.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = { + + }) + }) + public Response testBodyWithBinary(@Valid File body) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithFileSchema", summary = "", description = "For this test, the body for this request must reference a schema named `File`.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = { + + }) + }) + public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithQueryParams", summary = "", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = { + + }) + }) + public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testClientModel", summary = "To test \"client\" model", description = "To test \"client\" model") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class)) + }) + }) + public Response testClientModel(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Consumes({ "application/x-www-form-urlencoded" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "http_basic_test") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testEndpointParameters", summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = { + + }) + }) + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") LocalDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Consumes({ "application/x-www-form-urlencoded" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testEnumParameters", summary = "To test enum parameters", description = "To test enum parameters") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid request", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Not found", content = { + + }) + }) + public Response testEnumParameters(@HeaderParam("enum_header_string_array") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "bearer_test") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Something wrong", content = { + + }) + }) + public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Integer in group parameters") Long int64Group) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testInlineFreeformAdditionalProperties", summary = "test inline free-form additionalProperties", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testJsonFormData", summary = "test json serialization of form data", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testNullable", summary = "test nullable parent property", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testNullable(@Valid @NotNull ChildWithNullable childWithNullable) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/test-query-parameters") + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testQueryParameterCollectionFormat", summary = "", description = "To test the collection format in query parameters") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Success", content = { + + }) + }) + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testStringMapReference", summary = "test referenced string map", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response testStringMapReference(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class)) + }) + }) + public Response uploadFileWithRequiredFile(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java new file mode 100644 index 00000000000..5f7d89c2dd2 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -0,0 +1,82 @@ +package org.openapitools.api; + +import org.openapitools.model.Client; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "", version="1.0.0", description="", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/fake_classname_test") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeClassnameTestApi { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key_query") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testClassname", summary = "To test class name in snake case", description = "To test class name in snake case") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake_classname_tags 123#$%^") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Client.class)) + }) + }) + public Response testClassname(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java new file mode 100644 index 00000000000..ab947e0349f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java @@ -0,0 +1,79 @@ +package org.openapitools.api; + +import org.openapitools.model.FooGetDefaultResponse; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "", version="1.0.0", description="", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="", description="") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/foo") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooApi { + + @GET + @Produces({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fooGet", summary = "", description = "") + + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "response", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = FooGetDefaultResponse.class)) + }) + }) + public Response fooGet() { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..dc75263b668 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java @@ -0,0 +1,239 @@ +package org.openapitools.api; + +import java.io.File; +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import java.util.Set; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "pet", version="1.0.0", description="Everything about your Pets", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet", description="Everything about your Pets") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet", description="Everything about your Pets") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class PetApi { + + @POST + @Consumes({ "application/json", "application/xml" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "addPet", summary = "Add a new pet to the store", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Successful operation", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Invalid input", content = { + + }) + }) + public Response addPet(@Valid @NotNull Pet pet) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + @Path("/{petId}") + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deletePet", summary = "Deletes a pet", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Successful operation", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid pet value", content = { + + }) + }) + public Response deletePet(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Pet id to delete") Long petId) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "findPetsByStatus", summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY )), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY )) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid status value", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response findPetsByStatus(@QueryParam("status") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Status values that need to be considered for filter") List status) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "findPetsByTags", summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY , uniqueItems = true )), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class, type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.ARRAY , uniqueItems = true )) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid tag value", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Tags to filter by") Set tags) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getPetById", summary = "Find pet by ID", description = "Returns a single pet") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class)), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Pet.class)) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Pet not found", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Consumes({ "application/json", "application/xml" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updatePet", summary = "Update an existing pet", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Successful operation", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Pet not found", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Validation exception", content = { + + }) + }) + public Response updatePet(@Valid @NotNull Pet pet) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "Successful operation", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "405", description = "Invalid input", content = { + + }) + }) + public Response updatePetWithForm(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "uploadFile", summary = "uploads an image", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="pet") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class)) + }) + }) + public Response uploadFile(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestApplication.java new file mode 100644 index 00000000000..a0a2d08f964 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestApplication.java @@ -0,0 +1,17 @@ +package org.openapitools.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + version="1.0.0" + ,title = "OpenAPI Petstore" + ,description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" + ,license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + +)) +@ApplicationPath(RestResourceRoot.APPLICATION_PATH) +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestResourceRoot.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestResourceRoot.java new file mode 100644 index 00000000000..96ba6c8d8e4 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/RestResourceRoot.java @@ -0,0 +1,5 @@ +package org.openapitools.api; + +public class RestResourceRoot { + public static final String APPLICATION_PATH = "/v2"; +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..fb4cba9564b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,145 @@ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "store", version="1.0.0", description="Access to Petstore orders", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store", description="Access to Petstore orders") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store", description="Access to Petstore orders") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/store") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class StoreApi { + + @DELETE + @Path("/order/{order_id}") + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteOrder", summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Order not found", content = { + + }) + }) + public Response deleteOrder(@PathParam("order_id") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of the order that needs to be deleted") String orderId) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ + @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key") + }) + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getInventory", summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Map.class)) + }) + }) + public Response getInventory() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getOrderById", summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid ID supplied", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "Order not found", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be fetched") Long orderId) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "placeOrder", summary = "Place an order for a pet", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = Order.class)) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid Order", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response placeOrder(@Valid @NotNull Order order) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..33c54855a00 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java @@ -0,0 +1,206 @@ +package org.openapitools.api; + +import java.time.LocalDateTime; +import org.openapitools.model.User; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + + + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +@org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition( + info = @org.eclipse.microprofile.openapi.annotations.info.Info( + title = "user", version="1.0.0", description="Operations about user", + license = @org.eclipse.microprofile.openapi.annotations.info.License(name = "Apache-2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html") + ), + tags = @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user", description="Operations about user") +) +@org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user", description="Operations about user") +@org.eclipse.microprofile.openapi.annotations.security.SecuritySchemes(value = { + @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "petstore_auth", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.OAUTH2, + description = "", + flows = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlows( + implicit = @org.eclipse.microprofile.openapi.annotations.security.OAuthFlow(authorizationUrl = "http://petstore.swagger.io/api/oauth/dialog", + tokenUrl = "", + refreshUrl = "", + scopes = { + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "write:pets", description = "modify pets in your account"), + @org.eclipse.microprofile.openapi.annotations.security.OAuthScope(name = "read:pets", description = "read your pets") + })) + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.HEADER + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "api_key_query", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.APIKEY, + description = "", + apiKeyName = "api_key_query", + in = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn.QUERY + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "http_basic_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "basic" + ), @org.eclipse.microprofile.openapi.annotations.security.SecurityScheme( + securitySchemeName = "bearer_test", + type = org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType.HTTP, + description = "", + scheme = "bearer", bearerFormat = "JWT" + ), +}) +@Path("/user") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class UserApi { + + @POST + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUser", summary = "Create user", description = "This can only be done by the logged in user.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response createUser(@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + @Path("/{username}") + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteUser", summary = "Delete user", description = "This can only be done by the logged in user.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = { + + }) + }) + public Response deleteUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getUserByName", summary = "Get user by user name", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = User.class)), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = User.class)) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username supplied", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response getUserByName(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be fetched. Use user1 for testing.") String username) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "loginUser", summary = "Logs user into the system", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", headers = { + @org.eclipse.microprofile.openapi.annotations.headers.Header(name = "X-Rate-Limit", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.INTEGER), description = "calls per hour allowed by the user"), + @org.eclipse.microprofile.openapi.annotations.headers.Header(name = "X-Expires-After", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(type = org.eclipse.microprofile.openapi.annotations.enums.SchemaType.STRING), description = "date in UTC when token expires") + }, content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class)), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = String.class)) + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid username/password supplied", content = { + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/xml"), + @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") + }) + }) + public Response loginUser(@QueryParam("username") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The user name for login") String username,@QueryParam("password") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The password for login in clear text") String password) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/logout") + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "logoutUser", summary = "Logs out current logged in user session", description = "") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "200", description = "successful operation", content = { + + }) + }) + public Response logoutUser() { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + + @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updateUser", summary = "Updated user", description = "This can only be done by the logged in user.") + @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") + @org.eclipse.microprofile.openapi.annotations.responses.APIResponses(value = { + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "400", description = "Invalid user supplied", content = { + + }), + @org.eclipse.microprofile.openapi.annotations.responses.APIResponse(responseCode = "404", description = "User not found", content = { + + }) + }) + public Response updateUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="name that need to be deleted") String username,@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index dbefeb3cba3..04e037c3c8e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesAnyType") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesAnyType extends HashMap implements Serializable { @@ -30,7 +28,7 @@ public class AdditionalPropertiesAnyType extends HashMap impleme } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 3c785b66b33..9cf04e25a98 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -18,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesArray") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesArray extends HashMap implements Serializable { @@ -31,7 +29,7 @@ public class AdditionalPropertiesArray extends HashMap implements } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 9abc6c043d8..7b44ae801d8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesBoolean") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesBoolean extends HashMap implements Serializable { @@ -30,7 +28,7 @@ public class AdditionalPropertiesBoolean extends HashMap implem } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..12e9bbb14f8 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -0,0 +1,178 @@ +package org.openapitools.model; + +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("AdditionalPropertiesClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AdditionalPropertiesClass implements Serializable { + private @Valid Map mapProperty = new HashMap<>(); + private @Valid Map> mapOfMapProperty = new HashMap<>(); + + protected AdditionalPropertiesClass(AdditionalPropertiesClassBuilder b) { + this.mapProperty = b.mapProperty; + this.mapOfMapProperty = b.mapOfMapProperty; + } + + public AdditionalPropertiesClass() { + } + + /** + **/ + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; + } + + @JsonProperty("map_property") + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + public AdditionalPropertiesClass removeMapPropertyItem(String key) { + if (this.mapProperty != null) { + this.mapProperty.remove(key); + } + + return this; + } + /** + **/ + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + @JsonProperty("map_of_map_property") + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + public AdditionalPropertiesClass removeMapOfMapPropertyItem(String key) { + if (this.mapOfMapProperty != null) { + this.mapOfMapProperty.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static AdditionalPropertiesClassBuilder builder() { + return new AdditionalPropertiesClassBuilderImpl(); + } + + private static class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { + + @Override + protected AdditionalPropertiesClassBuilderImpl self() { + return this; + } + + @Override + public AdditionalPropertiesClass build() { + return new AdditionalPropertiesClass(this); + } + } + + public static abstract class AdditionalPropertiesClassBuilder> { + private Map mapProperty = new HashMap<>(); + private Map> mapOfMapProperty = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return self(); + } + public B mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 938f46c7cfd..95b96bd3aa3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesInteger") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesInteger extends HashMap implements Serializable { @@ -30,7 +28,7 @@ public class AdditionalPropertiesInteger extends HashMap implem } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 36eb369cf2a..11f26632d09 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -18,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesNumber") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesNumber extends HashMap implements Serializable { @@ -31,7 +29,7 @@ public class AdditionalPropertiesNumber extends HashMap impl } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 580bdb6d71b..ac4b975a5ca 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesObject extends HashMap implements Serializable { @@ -30,7 +28,7 @@ public class AdditionalPropertiesObject extends HashMap implements } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java similarity index 93% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index e4c64192ac3..5d2c71269b0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("AdditionalPropertiesString") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesString extends HashMap implements Serializable { @@ -30,7 +28,7 @@ public class AdditionalPropertiesString extends HashMap implemen } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..d7b379b7d2a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -0,0 +1,145 @@ +package org.openapitools.model; + +import org.openapitools.model.SingleRefType; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("AllOfWithSingleRef") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AllOfWithSingleRef implements Serializable { + private String username; + private SingleRefType singleRefType; + + protected AllOfWithSingleRef(AllOfWithSingleRefBuilder b) { + this.username = b.username; + this.singleRefType = b.singleRefType; + } + + public AllOfWithSingleRef() { + } + + /** + **/ + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + + @JsonProperty("username") + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("SingleRefType") + public SingleRefType getSingleRefType() { + return singleRefType; + } + + @JsonProperty("SingleRefType") + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static AllOfWithSingleRefBuilder builder() { + return new AllOfWithSingleRefBuilderImpl(); + } + + private static class AllOfWithSingleRefBuilderImpl extends AllOfWithSingleRefBuilder { + + @Override + protected AllOfWithSingleRefBuilderImpl self() { + return this; + } + + @Override + public AllOfWithSingleRef build() { + return new AllOfWithSingleRef(this); + } + } + + public static abstract class AllOfWithSingleRefBuilder> { + private String username; + private SingleRefType singleRefType; + protected abstract B self(); + + public abstract C build(); + + public B username(String username) { + this.username = username; + return self(); + } + public B singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Animal.java new file mode 100644 index 00000000000..4f8761bb55f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Animal.java @@ -0,0 +1,152 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), +}) + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Animal") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Animal implements Serializable { + private String className; + private String color = "red"; + + protected Animal(AnimalBuilder b) { + this.className = b.className; + this.color = b.color; + } + + public Animal() { + } + + /** + **/ + public Animal className(String className) { + this.className = className; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("className") + @NotNull public String getClassName() { + return className; + } + + @JsonProperty("className") + public void setClassName(String className) { + this.className = className; + } + + /** + **/ + public Animal color(String color) { + this.color = color; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("color") + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static AnimalBuilder builder() { + return new AnimalBuilderImpl(); + } + + private static class AnimalBuilderImpl extends AnimalBuilder { + + @Override + protected AnimalBuilderImpl self() { + return this; + } + + @Override + public Animal build() { + return new Animal(this); + } + } + + public static abstract class AnimalBuilder> { + private String className; + private String color = "red"; + protected abstract B self(); + + public abstract C build(); + + public B className(String className) { + this.className = className; + return self(); + } + public B color(String color) { + this.color = color; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..2664538e451 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,136 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ArrayOfArrayOfNumberOnly") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnly implements Serializable { + private @Valid List> arrayArrayNumber = new ArrayList<>(); + + protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder b) { + this.arrayArrayNumber = b.arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly() { + } + + /** + **/ + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("ArrayArrayNumber") + @Valid public List<@Valid List<@Valid BigDecimal>> getArrayArrayNumber() { + return arrayArrayNumber; + } + + @JsonProperty("ArrayArrayNumber") + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) { + if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) { + this.arrayArrayNumber.remove(arrayArrayNumberItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ArrayOfArrayOfNumberOnlyBuilder builder() { + return new ArrayOfArrayOfNumberOnlyBuilderImpl(); + } + + private static class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { + + @Override + protected ArrayOfArrayOfNumberOnlyBuilderImpl self() { + return this; + } + + @Override + public ArrayOfArrayOfNumberOnly build() { + return new ArrayOfArrayOfNumberOnly(this); + } + } + + public static abstract class ArrayOfArrayOfNumberOnlyBuilder> { + private List> arrayArrayNumber = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..5c728d8f036 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -0,0 +1,136 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ArrayOfNumberOnly") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayOfNumberOnly implements Serializable { + private @Valid List arrayNumber = new ArrayList<>(); + + protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder b) { + this.arrayNumber = b.arrayNumber; + } + + public ArrayOfNumberOnly() { + } + + /** + **/ + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("ArrayNumber") + @Valid public List<@Valid BigDecimal> getArrayNumber() { + return arrayNumber; + } + + @JsonProperty("ArrayNumber") + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + + this.arrayNumber.add(arrayNumberItem); + return this; + } + + public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) { + if (arrayNumberItem != null && this.arrayNumber != null) { + this.arrayNumber.remove(arrayNumberItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ArrayOfNumberOnlyBuilder builder() { + return new ArrayOfNumberOnlyBuilderImpl(); + } + + private static class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { + + @Override + protected ArrayOfNumberOnlyBuilderImpl self() { + return this; + } + + @Override + public ArrayOfNumberOnly build() { + return new ArrayOfNumberOnly(this); + } + } + + public static abstract class ArrayOfNumberOnlyBuilder> { + private List arrayNumber = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayTest.java new file mode 100644 index 00000000000..d6e2b5bc7d1 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ArrayTest.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.ReadOnlyFirst; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ArrayTest") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ArrayTest implements Serializable { + private @Valid List arrayOfString = new ArrayList<>(); + private @Valid List> arrayArrayOfInteger = new ArrayList<>(); + private @Valid List> arrayArrayOfModel = new ArrayList<>(); + + protected ArrayTest(ArrayTestBuilder b) { + this.arrayOfString = b.arrayOfString; + this.arrayArrayOfInteger = b.arrayArrayOfInteger; + this.arrayArrayOfModel = b.arrayArrayOfModel; + } + + public ArrayTest() { + } + + /** + **/ + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_of_string") + @Size(min=0,max=3)public List getArrayOfString() { + return arrayOfString; + } + + @JsonProperty("array_of_string") + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) { + if (arrayOfStringItem != null && this.arrayOfString != null) { + this.arrayOfString.remove(arrayOfStringItem); + } + + return this; + } + /** + **/ + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + @JsonProperty("array_array_of_integer") + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) { + this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem); + } + + return this; + } + /** + **/ + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_array_of_model") + @Valid public List<@Valid List<@Valid ReadOnlyFirst>> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + @JsonProperty("array_array_of_model") + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + public ArrayTest removeArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) { + this.arrayArrayOfModel.remove(arrayArrayOfModelItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ArrayTestBuilder builder() { + return new ArrayTestBuilderImpl(); + } + + private static class ArrayTestBuilderImpl extends ArrayTestBuilder { + + @Override + protected ArrayTestBuilderImpl self() { + return this; + } + + @Override + public ArrayTest build() { + return new ArrayTest(this); + } + } + + public static abstract class ArrayTestBuilder> { + private List arrayOfString = new ArrayList<>(); + private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfModel = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return self(); + } + public B arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return self(); + } + public B arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/BigCat.java similarity index 96% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/BigCat.java index 07aca17512c..406f10b05eb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/BigCat.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Cat; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -16,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("BigCat") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class BigCat extends Cat implements Serializable { @@ -84,7 +82,7 @@ public class BigCat extends Cat implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("kind") public KindEnum getKind() { return kind; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Capitalization.java new file mode 100644 index 00000000000..912fe5d1271 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Capitalization.java @@ -0,0 +1,257 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Capitalization") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Capitalization implements Serializable { + private String smallCamel; + private String capitalCamel; + private String smallSnake; + private String capitalSnake; + private String scAETHFlowPoints; + private String ATT_NAME; + + protected Capitalization(CapitalizationBuilder b) { + this.smallCamel = b.smallCamel; + this.capitalCamel = b.capitalCamel; + this.smallSnake = b.smallSnake; + this.capitalSnake = b.capitalSnake; + this.scAETHFlowPoints = b.scAETHFlowPoints; + this.ATT_NAME = b.ATT_NAME; + } + + public Capitalization() { + } + + /** + **/ + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("smallCamel") + public String getSmallCamel() { + return smallCamel; + } + + @JsonProperty("smallCamel") + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + /** + **/ + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("CapitalCamel") + public String getCapitalCamel() { + return capitalCamel; + } + + @JsonProperty("CapitalCamel") + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + /** + **/ + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("small_Snake") + public String getSmallSnake() { + return smallSnake; + } + + @JsonProperty("small_Snake") + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + /** + **/ + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("Capital_Snake") + public String getCapitalSnake() { + return capitalSnake; + } + + @JsonProperty("Capital_Snake") + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + /** + **/ + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("SCA_ETH_Flow_Points") + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + @JsonProperty("SCA_ETH_Flow_Points") + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + /** + * Name of the pet + **/ + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Name of the pet ") + @JsonProperty("ATT_NAME") + public String getATTNAME() { + return ATT_NAME; + } + + @JsonProperty("ATT_NAME") + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static CapitalizationBuilder builder() { + return new CapitalizationBuilderImpl(); + } + + private static class CapitalizationBuilderImpl extends CapitalizationBuilder { + + @Override + protected CapitalizationBuilderImpl self() { + return this; + } + + @Override + public Capitalization build() { + return new Capitalization(this); + } + } + + public static abstract class CapitalizationBuilder> { + private String smallCamel; + private String capitalCamel; + private String smallSnake; + private String capitalSnake; + private String scAETHFlowPoints; + private String ATT_NAME; + protected abstract B self(); + + public abstract C build(); + + public B smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return self(); + } + public B capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return self(); + } + public B smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return self(); + } + public B capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return self(); + } + public B scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return self(); + } + public B ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Cat.java new file mode 100644 index 00000000000..8f73111f60f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Cat.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import org.openapitools.model.Animal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Cat") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Cat extends Animal implements Serializable { + private Boolean declawed; + + protected Cat(CatBuilder b) { + super(b); + this.declawed = b.declawed; + } + + public Cat() { + } + + /** + **/ + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("declawed") + public Boolean getDeclawed() { + return declawed; + } + + @JsonProperty("declawed") + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static CatBuilder builder() { + return new CatBuilderImpl(); + } + + private static class CatBuilderImpl extends CatBuilder { + + @Override + protected CatBuilderImpl self() { + return this; + } + + @Override + public Cat build() { + return new Cat(this); + } + } + + public static abstract class CatBuilder> extends AnimalBuilder { + private Boolean declawed; + + public B declawed(Boolean declawed) { + this.declawed = declawed; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..c7dd2f984db --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Category.java @@ -0,0 +1,144 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Category") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Category implements Serializable { + private Long id; + private String name = "default-name"; + + protected Category(CategoryBuilder b) { + this.id = b.id; + this.name = b.name; + } + + public Category() { + } + + /** + **/ + public Category id(Long id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + @JsonProperty("id") + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Category name(String name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("name") + @NotNull public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static CategoryBuilder builder() { + return new CategoryBuilderImpl(); + } + + private static class CategoryBuilderImpl extends CategoryBuilder { + + @Override + protected CategoryBuilderImpl self() { + return this; + } + + @Override + public Category build() { + return new Category(this); + } + } + + public static abstract class CategoryBuilder> { + private Long id; + private String name = "default-name"; + protected abstract B self(); + + public abstract C build(); + + public B id(Long id) { + this.id = id; + return self(); + } + public B name(String name) { + this.name = name; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ChildWithNullable.java new file mode 100644 index 00000000000..a13546966ff --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ChildWithNullable.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ChildWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ChildWithNullable extends ParentWithNullable implements Serializable { + private String otherProperty; + + protected ChildWithNullable(ChildWithNullableBuilder b) { + super(b); + this.otherProperty = b.otherProperty; + } + + public ChildWithNullable() { + } + + /** + **/ + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("otherProperty") + public String getOtherProperty() { + return otherProperty; + } + + @JsonProperty("otherProperty") + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ChildWithNullableBuilder builder() { + return new ChildWithNullableBuilderImpl(); + } + + private static class ChildWithNullableBuilderImpl extends ChildWithNullableBuilder { + + @Override + protected ChildWithNullableBuilderImpl self() { + return this; + } + + @Override + public ChildWithNullable build() { + return new ChildWithNullable(this); + } + } + + public static abstract class ChildWithNullableBuilder> extends ParentWithNullableBuilder { + private String otherProperty; + + public B otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ClassModel.java new file mode 100644 index 00000000000..35ce3de9a56 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ClassModel.java @@ -0,0 +1,118 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model with \"_class\" property + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model with \"_class\" property") +@JsonTypeName("ClassModel") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ClassModel implements Serializable { + private String propertyClass; + + protected ClassModel(ClassModelBuilder b) { + this.propertyClass = b.propertyClass; + } + + public ClassModel() { + } + + /** + **/ + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("_class") + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty("_class") + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ClassModelBuilder builder() { + return new ClassModelBuilderImpl(); + } + + private static class ClassModelBuilderImpl extends ClassModelBuilder { + + @Override + protected ClassModelBuilderImpl self() { + return this; + } + + @Override + public ClassModel build() { + return new ClassModel(this); + } + } + + public static abstract class ClassModelBuilder> { + private String propertyClass; + protected abstract B self(); + + public abstract C build(); + + public B propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Client.java new file mode 100644 index 00000000000..cd096bb971f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Client.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Client") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Client implements Serializable { + private String client; + + protected Client(ClientBuilder b) { + this.client = b.client; + } + + public Client() { + } + + /** + **/ + public Client client(String client) { + this.client = client; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("client") + public String getClient() { + return client; + } + + @JsonProperty("client") + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ClientBuilder builder() { + return new ClientBuilderImpl(); + } + + private static class ClientBuilderImpl extends ClientBuilder { + + @Override + protected ClientBuilderImpl self() { + return this; + } + + @Override + public Client build() { + return new Client(this); + } + } + + public static abstract class ClientBuilder> { + private String client; + protected abstract B self(); + + public abstract C build(); + + public B client(String client) { + this.client = client; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/DeprecatedObject.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/DeprecatedObject.java new file mode 100644 index 00000000000..21ab9b2fe84 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/DeprecatedObject.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("DeprecatedObject") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DeprecatedObject implements Serializable { + private String name; + + protected DeprecatedObject(DeprecatedObjectBuilder b) { + this.name = b.name; + } + + public DeprecatedObject() { + } + + /** + **/ + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static DeprecatedObjectBuilder builder() { + return new DeprecatedObjectBuilderImpl(); + } + + private static class DeprecatedObjectBuilderImpl extends DeprecatedObjectBuilder { + + @Override + protected DeprecatedObjectBuilderImpl self() { + return this; + } + + @Override + public DeprecatedObject build() { + return new DeprecatedObject(this); + } + } + + public static abstract class DeprecatedObjectBuilder> { + private String name; + protected abstract B self(); + + public abstract C build(); + + public B name(String name) { + this.name = name; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Dog.java new file mode 100644 index 00000000000..20e775d8842 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Dog.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import org.openapitools.model.Animal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Dog") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Dog extends Animal implements Serializable { + private String breed; + + protected Dog(DogBuilder b) { + super(b); + this.breed = b.breed; + } + + public Dog() { + } + + /** + **/ + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("breed") + public String getBreed() { + return breed; + } + + @JsonProperty("breed") + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static DogBuilder builder() { + return new DogBuilderImpl(); + } + + private static class DogBuilderImpl extends DogBuilder { + + @Override + protected DogBuilderImpl self() { + return this; + } + + @Override + public Dog build() { + return new Dog(this); + } + } + + public static abstract class DogBuilder> extends AnimalBuilder { + private String breed; + + public B breed(String breed) { + this.breed = breed; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumArrays.java new file mode 100644 index 00000000000..6b4f512f45c --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumArrays.java @@ -0,0 +1,257 @@ +package org.openapitools.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("EnumArrays") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumArrays implements Serializable { + public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static JustSymbolEnum fromString(String s) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private JustSymbolEnum justSymbol; + public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static ArrayEnumEnum fromString(String s) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid List arrayEnum = new ArrayList<>(); + + protected EnumArrays(EnumArraysBuilder b) { + this.justSymbol = b.justSymbol; + this.arrayEnum = b.arrayEnum; + } + + public EnumArrays() { + } + + /** + **/ + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("just_symbol") + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + @JsonProperty("just_symbol") + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + /** + **/ + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_enum") + public List getArrayEnum() { + return arrayEnum; + } + + @JsonProperty("array_enum") + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + + this.arrayEnum.add(arrayEnumItem); + return this; + } + + public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (arrayEnumItem != null && this.arrayEnum != null) { + this.arrayEnum.remove(arrayEnumItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static EnumArraysBuilder builder() { + return new EnumArraysBuilderImpl(); + } + + private static class EnumArraysBuilderImpl extends EnumArraysBuilder { + + @Override + protected EnumArraysBuilderImpl self() { + return this; + } + + @Override + public EnumArrays build() { + return new EnumArrays(this); + } + } + + public static abstract class EnumArraysBuilder> { + private JustSymbolEnum justSymbol; + private List arrayEnum = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return self(); + } + public B arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumClass.java new file mode 100644 index 00000000000..089a69da6da --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumClass.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumClass fromString(String s) { + for (EnumClass b : EnumClass.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumTest.java new file mode 100644 index 00000000000..44bca597a7b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/EnumTest.java @@ -0,0 +1,506 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.OuterEnum; +import org.openapitools.model.OuterEnumDefaultValue; +import org.openapitools.model.OuterEnumInteger; +import org.openapitools.model.OuterEnumIntegerDefaultValue; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Enum_Test") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class EnumTest implements Serializable { + public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringEnum fromString(String s) { + for (EnumStringEnum b : EnumStringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringEnum enumString; + public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringRequiredEnum fromString(String s) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringRequiredEnum enumStringRequired; + public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumIntegerEnum fromString(String s) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumIntegerEnum enumInteger; + public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Double, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumNumberEnum fromString(String s) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumNumberEnum enumNumber; + private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + protected EnumTest(EnumTestBuilder b) { + this.enumString = b.enumString; + this.enumStringRequired = b.enumStringRequired; + this.enumInteger = b.enumInteger; + this.enumNumber = b.enumNumber; + this.outerEnum = b.outerEnum; + this.outerEnumInteger = b.outerEnumInteger; + this.outerEnumDefaultValue = b.outerEnumDefaultValue; + this.outerEnumIntegerDefaultValue = b.outerEnumIntegerDefaultValue; + } + + public EnumTest() { + } + + /** + **/ + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("enum_string") + public EnumStringEnum getEnumString() { + return enumString; + } + + @JsonProperty("enum_string") + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + **/ + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("enum_string_required") + @NotNull public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + @JsonProperty("enum_string_required") + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + /** + **/ + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("enum_integer") + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + @JsonProperty("enum_integer") + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + **/ + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("enum_number") + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + @JsonProperty("enum_number") + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + /** + **/ + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("outerEnum") + public OuterEnum getOuterEnum() { + return outerEnum; + } + + @JsonProperty("outerEnum") + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + /** + **/ + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("outerEnumInteger") + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + @JsonProperty("outerEnumInteger") + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + /** + **/ + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("outerEnumDefaultValue") + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + @JsonProperty("outerEnumDefaultValue") + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + /** + **/ + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("outerEnumIntegerDefaultValue") + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + @JsonProperty("outerEnumIntegerDefaultValue") + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static EnumTestBuilder builder() { + return new EnumTestBuilderImpl(); + } + + private static class EnumTestBuilderImpl extends EnumTestBuilder { + + @Override + protected EnumTestBuilderImpl self() { + return this; + } + + @Override + public EnumTest build() { + return new EnumTest(this); + } + } + + public static abstract class EnumTestBuilder> { + private EnumStringEnum enumString; + private EnumStringRequiredEnum enumStringRequired; + private EnumIntegerEnum enumInteger; + private EnumNumberEnum enumNumber; + private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + protected abstract B self(); + + public abstract C build(); + + public B enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return self(); + } + public B enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return self(); + } + public B enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return self(); + } + public B enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return self(); + } + public B outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return self(); + } + public B outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return self(); + } + public B outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return self(); + } + public B outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..2ebaa8fad54 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,164 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("fakeBigDecimalMap_200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeBigDecimalMap200Response implements Serializable { + private BigDecimal someId; + private @Valid Map someMap = new HashMap<>(); + + protected FakeBigDecimalMap200Response(FakeBigDecimalMap200ResponseBuilder b) { + this.someId = b.someId; + this.someMap = b.someMap; + } + + public FakeBigDecimalMap200Response() { + } + + /** + **/ + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("someId") + @Valid public BigDecimal getSomeId() { + return someId; + } + + @JsonProperty("someId") + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + **/ + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("someMap") + @Valid public Map getSomeMap() { + return someMap; + } + + @JsonProperty("someMap") + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + + this.someMap.put(key, someMapItem); + return this; + } + + public FakeBigDecimalMap200Response removeSomeMapItem(String key) { + if (this.someMap != null) { + this.someMap.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FakeBigDecimalMap200ResponseBuilder builder() { + return new FakeBigDecimalMap200ResponseBuilderImpl(); + } + + private static class FakeBigDecimalMap200ResponseBuilderImpl extends FakeBigDecimalMap200ResponseBuilder { + + @Override + protected FakeBigDecimalMap200ResponseBuilderImpl self() { + return this; + } + + @Override + public FakeBigDecimalMap200Response build() { + return new FakeBigDecimalMap200Response(this); + } + } + + public static abstract class FakeBigDecimalMap200ResponseBuilder> { + private BigDecimal someId; + private Map someMap = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B someId(BigDecimal someId) { + this.someId = someId; + return self(); + } + public B someMap(Map someMap) { + this.someMap = someMap; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..a687aa29fae --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -0,0 +1,164 @@ +package org.openapitools.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.ModelFile; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("FileSchemaTestClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FileSchemaTestClass implements Serializable { + private ModelFile _file; + private @Valid List<@Valid ModelFile> files = new ArrayList<>(); + + protected FileSchemaTestClass(FileSchemaTestClassBuilder b) { + this._file = b._file; + this.files = b.files; + } + + public FileSchemaTestClass() { + } + + /** + **/ + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("file") + @Valid public ModelFile getFile() { + return _file; + } + + @JsonProperty("file") + public void setFile(ModelFile _file) { + this._file = _file; + } + + /** + **/ + public FileSchemaTestClass files(List<@Valid ModelFile> files) { + this.files = files; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("files") + @Valid public List<@Valid ModelFile> getFiles() { + return files; + } + + @JsonProperty("files") + public void setFiles(List<@Valid ModelFile> files) { + this.files = files; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + + this.files.add(filesItem); + return this; + } + + public FileSchemaTestClass removeFilesItem(ModelFile filesItem) { + if (filesItem != null && this.files != null) { + this.files.remove(filesItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FileSchemaTestClassBuilder builder() { + return new FileSchemaTestClassBuilderImpl(); + } + + private static class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { + + @Override + protected FileSchemaTestClassBuilderImpl self() { + return this; + } + + @Override + public FileSchemaTestClass build() { + return new FileSchemaTestClass(this); + } + } + + public static abstract class FileSchemaTestClassBuilder> { + private ModelFile _file; + private List<@Valid ModelFile> files = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B _file(ModelFile _file) { + this._file = _file; + return self(); + } + public B files(List<@Valid ModelFile> files) { + this.files = files; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Foo.java new file mode 100644 index 00000000000..f4260249c12 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Foo.java @@ -0,0 +1,116 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Foo") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Foo implements Serializable { + private String bar = "bar"; + + protected Foo(FooBuilder b) { + this.bar = b.bar; + } + + public Foo() { + } + + /** + **/ + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + @JsonProperty("bar") + public void setBar(String bar) { + this.bar = bar; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FooBuilder builder() { + return new FooBuilderImpl(); + } + + private static class FooBuilderImpl extends FooBuilder { + + @Override + protected FooBuilderImpl self() { + return this; + } + + @Override + public Foo build() { + return new Foo(this); + } + } + + public static abstract class FooBuilder> { + private String bar = "bar"; + protected abstract B self(); + + public abstract C build(); + + public B bar(String bar) { + this.bar = bar; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..5bf0ce37289 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java @@ -0,0 +1,118 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.model.Foo; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("_foo_get_default_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooGetDefaultResponse implements Serializable { + private Foo string; + + protected FooGetDefaultResponse(FooGetDefaultResponseBuilder b) { + this.string = b.string; + } + + public FooGetDefaultResponse() { + } + + /** + **/ + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("string") + @Valid public Foo getString() { + return string; + } + + @JsonProperty("string") + public void setString(Foo string) { + this.string = string; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FooGetDefaultResponseBuilder builder() { + return new FooGetDefaultResponseBuilderImpl(); + } + + private static class FooGetDefaultResponseBuilderImpl extends FooGetDefaultResponseBuilder { + + @Override + protected FooGetDefaultResponseBuilderImpl self() { + return this; + } + + @Override + public FooGetDefaultResponse build() { + return new FooGetDefaultResponse(this); + } + } + + public static abstract class FooGetDefaultResponseBuilder> { + private Foo string; + protected abstract B self(); + + public abstract C build(); + + public B string(Foo string) { + this.string = string; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FormatTest.java new file mode 100644 index 00000000000..01bb6c422f7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/FormatTest.java @@ -0,0 +1,555 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.UUID; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("format_test") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FormatTest implements Serializable { + private Integer integer; + private Integer int32; + private Long int64; + private BigDecimal number; + private Float _float; + private Double _double; + private BigDecimal decimal; + private String string; + private byte[] _byte; + private File binary; + private LocalDate date; + private LocalDateTime dateTime; + private UUID uuid; + private String password; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; + + protected FormatTest(FormatTestBuilder b) { + this.integer = b.integer; + this.int32 = b.int32; + this.int64 = b.int64; + this.number = b.number; + this._float = b._float; + this._double = b._double; + this.decimal = b.decimal; + this.string = b.string; + this._byte = b._byte; + this.binary = b.binary; + this.date = b.date; + this.dateTime = b.dateTime; + this.uuid = b.uuid; + this.password = b.password; + this.patternWithDigits = b.patternWithDigits; + this.patternWithDigitsAndDelimiter = b.patternWithDigitsAndDelimiter; + } + + public FormatTest() { + } + + /** + * minimum: 10 + * maximum: 100 + **/ + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("integer") + @Min(10) @Max(100)public Integer getInteger() { + return integer; + } + + @JsonProperty("integer") + public void setInteger(Integer integer) { + this.integer = integer; + } + + /** + * minimum: 20 + * maximum: 200 + **/ + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("int32") + @Min(20) @Max(200)public Integer getInt32() { + return int32; + } + + @JsonProperty("int32") + public void setInt32(Integer int32) { + this.int32 = int32; + } + + /** + **/ + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("int64") + public Long getInt64() { + return int64; + } + + @JsonProperty("int64") + public void setInt64(Long int64) { + this.int64 = int64; + } + + /** + * minimum: 32.1 + * maximum: 543.2 + **/ + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("number") + @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2")public BigDecimal getNumber() { + return number; + } + + @JsonProperty("number") + public void setNumber(BigDecimal number) { + this.number = number; + } + + /** + * minimum: 54.3 + * maximum: 987.6 + **/ + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("float") + @DecimalMin("54.3") @DecimalMax("987.6")public Float getFloat() { + return _float; + } + + @JsonProperty("float") + public void setFloat(Float _float) { + this._float = _float; + } + + /** + * minimum: 67.8 + * maximum: 123.4 + **/ + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("double") + @DecimalMin("67.8") @DecimalMax("123.4")public Double getDouble() { + return _double; + } + + @JsonProperty("double") + public void setDouble(Double _double) { + this._double = _double; + } + + /** + **/ + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("decimal") + @Valid public BigDecimal getDecimal() { + return decimal; + } + + @JsonProperty("decimal") + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + /** + **/ + public FormatTest string(String string) { + this.string = string; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("string") + @Pattern(regexp="/[a-z]/i")public String getString() { + return string; + } + + @JsonProperty("string") + public void setString(String string) { + this.string = string; + } + + /** + **/ + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("byte") + @NotNull public byte[] getByte() { + return _byte; + } + + @JsonProperty("byte") + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + /** + **/ + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("binary") + public File getBinary() { + return binary; + } + + @JsonProperty("binary") + public void setBinary(File binary) { + this.binary = binary; + } + + /** + **/ + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("date") + @NotNull public LocalDate getDate() { + return date; + } + + @JsonProperty("date") + public void setDate(LocalDate date) { + this.date = date; + } + + /** + **/ + public FormatTest dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("dateTime") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty("dateTime") + public void setDateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") + @JsonProperty("uuid") + public UUID getUuid() { + return uuid; + } + + @JsonProperty("uuid") + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + **/ + public FormatTest password(String password) { + this.password = password; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("password") + @NotNull @Size(min=10,max=64)public String getPassword() { + return password; + } + + @JsonProperty("password") + public void setPassword(String password) { + this.password = password; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty("pattern_with_digits") + @Pattern(regexp="^\\d{10}$")public String getPatternWithDigits() { + return patternWithDigits; + } + + @JsonProperty("pattern_with_digits") + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty("pattern_with_digits_and_delimiter") + @Pattern(regexp="/^image_\\d{1,3}$/i")public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + @JsonProperty("pattern_with_digits_and_delimiter") + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FormatTestBuilder builder() { + return new FormatTestBuilderImpl(); + } + + private static class FormatTestBuilderImpl extends FormatTestBuilder { + + @Override + protected FormatTestBuilderImpl self() { + return this; + } + + @Override + public FormatTest build() { + return new FormatTest(this); + } + } + + public static abstract class FormatTestBuilder> { + private Integer integer; + private Integer int32; + private Long int64; + private BigDecimal number; + private Float _float; + private Double _double; + private BigDecimal decimal; + private String string; + private byte[] _byte; + private File binary; + private LocalDate date; + private LocalDateTime dateTime; + private UUID uuid; + private String password; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; + protected abstract B self(); + + public abstract C build(); + + public B integer(Integer integer) { + this.integer = integer; + return self(); + } + public B int32(Integer int32) { + this.int32 = int32; + return self(); + } + public B int64(Long int64) { + this.int64 = int64; + return self(); + } + public B number(BigDecimal number) { + this.number = number; + return self(); + } + public B _float(Float _float) { + this._float = _float; + return self(); + } + public B _double(Double _double) { + this._double = _double; + return self(); + } + public B decimal(BigDecimal decimal) { + this.decimal = decimal; + return self(); + } + public B string(String string) { + this.string = string; + return self(); + } + public B _byte(byte[] _byte) { + this._byte = _byte; + return self(); + } + public B binary(File binary) { + this.binary = binary; + return self(); + } + public B date(LocalDate date) { + this.date = date; + return self(); + } + public B dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return self(); + } + public B uuid(UUID uuid) { + this.uuid = uuid; + return self(); + } + public B password(String password) { + this.password = password; + return self(); + } + public B patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return self(); + } + public B patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..2a96b715e86 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -0,0 +1,145 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("hasOnlyReadOnly") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HasOnlyReadOnly implements Serializable { + private String bar; + private String foo; + + protected HasOnlyReadOnly(HasOnlyReadOnlyBuilder b) { + this.bar = b.bar; + this.foo = b.foo; + } + + public HasOnlyReadOnly() { + } + + /** + **/ + public HasOnlyReadOnly bar(String bar) { + this.bar = bar; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + @JsonProperty("bar") + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public HasOnlyReadOnly foo(String foo) { + this.foo = foo; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("foo") + public String getFoo() { + return foo; + } + + @JsonProperty("foo") + public void setFoo(String foo) { + this.foo = foo; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HasOnlyReadOnlyBuilder builder() { + return new HasOnlyReadOnlyBuilderImpl(); + } + + private static class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { + + @Override + protected HasOnlyReadOnlyBuilderImpl self() { + return this; + } + + @Override + public HasOnlyReadOnly build() { + return new HasOnlyReadOnly(this); + } + } + + public static abstract class HasOnlyReadOnlyBuilder> { + private String bar; + private String foo; + protected abstract B self(); + + public abstract C build(); + + public B bar(String bar) { + this.bar = bar; + return self(); + } + public B foo(String foo) { + this.foo = foo; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HealthCheckResult.java new file mode 100644 index 00000000000..3a5b5f1376a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/HealthCheckResult.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonTypeName("HealthCheckResult") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HealthCheckResult implements Serializable { + private String nullableMessage; + + protected HealthCheckResult(HealthCheckResultBuilder b) { + this.nullableMessage = b.nullableMessage; + } + + public HealthCheckResult() { + } + + /** + **/ + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("NullableMessage") + public String getNullableMessage() { + return nullableMessage; + } + + @JsonProperty("NullableMessage") + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HealthCheckResultBuilder builder() { + return new HealthCheckResultBuilderImpl(); + } + + private static class HealthCheckResultBuilderImpl extends HealthCheckResultBuilder { + + @Override + protected HealthCheckResultBuilderImpl self() { + return this; + } + + @Override + public HealthCheckResult build() { + return new HealthCheckResult(this); + } + } + + public static abstract class HealthCheckResultBuilder> { + private String nullableMessage; + protected abstract B self(); + + public abstract C build(); + + public B nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MapTest.java new file mode 100644 index 00000000000..3ca6e253400 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MapTest.java @@ -0,0 +1,313 @@ +package org.openapitools.model; + +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("MapTest") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MapTest implements Serializable { + private @Valid Map> mapMapOfString = new HashMap<>(); + public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static InnerEnum fromString(String s) { + for (InnerEnum b : InnerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private @Valid Map mapOfEnumString = new HashMap<>(); + private @Valid Map directMap = new HashMap<>(); + private @Valid Map indirectMap = new HashMap<>(); + + protected MapTest(MapTestBuilder b) { + this.mapMapOfString = b.mapMapOfString; + this.mapOfEnumString = b.mapOfEnumString; + this.directMap = b.directMap; + this.indirectMap = b.indirectMap; + } + + public MapTest() { + } + + /** + **/ + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("map_map_of_string") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + @JsonProperty("map_map_of_string") + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); + } + + return this; + } + /** + **/ + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("map_of_enum_string") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + @JsonProperty("map_of_enum_string") + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); + } + + return this; + } + /** + **/ + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + + @JsonProperty("direct_map") + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + + this.directMap.put(key, directMapItem); + return this; + } + + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); + } + + return this; + } + /** + **/ + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("indirect_map") + public Map getIndirectMap() { + return indirectMap; + } + + @JsonProperty("indirect_map") + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + + this.indirectMap.put(key, indirectMapItem); + return this; + } + + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static MapTestBuilder builder() { + return new MapTestBuilderImpl(); + } + + private static class MapTestBuilderImpl extends MapTestBuilder { + + @Override + protected MapTestBuilderImpl self() { + return this; + } + + @Override + public MapTest build() { + return new MapTest(this); + } + } + + public static abstract class MapTestBuilder> { + private Map> mapMapOfString = new HashMap<>(); + private Map mapOfEnumString = new HashMap<>(); + private Map directMap = new HashMap<>(); + private Map indirectMap = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return self(); + } + public B mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return self(); + } + public B directMap(Map directMap) { + this.directMap = directMap; + return self(); + } + public B indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..cc3963533e4 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,193 @@ +package org.openapitools.model; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.model.Animal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { + private UUID uuid; + private LocalDateTime dateTime; + private @Valid Map map = new HashMap<>(); + + protected MixedPropertiesAndAdditionalPropertiesClass(MixedPropertiesAndAdditionalPropertiesClassBuilder b) { + this.uuid = b.uuid; + this.dateTime = b.dateTime; + this.map = b.map; + } + + public MixedPropertiesAndAdditionalPropertiesClass() { + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("uuid") + public UUID getUuid() { + return uuid; + } + + @JsonProperty("uuid") + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("dateTime") + public LocalDateTime getDateTime() { + return dateTime; + } + + @JsonProperty("dateTime") + public void setDateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + **/ + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("map") + @Valid public Map getMap() { + return map; + } + + @JsonProperty("map") + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + + this.map.put(key, mapItem); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static MixedPropertiesAndAdditionalPropertiesClassBuilder builder() { + return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl(); + } + + private static class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { + + @Override + protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() { + return this; + } + + @Override + public MixedPropertiesAndAdditionalPropertiesClass build() { + return new MixedPropertiesAndAdditionalPropertiesClass(this); + } + } + + public static abstract class MixedPropertiesAndAdditionalPropertiesClassBuilder> { + private UUID uuid; + private LocalDateTime dateTime; + private Map map = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B uuid(UUID uuid) { + this.uuid = uuid; + return self(); + } + public B dateTime(LocalDateTime dateTime) { + this.dateTime = dateTime; + return self(); + } + public B map(Map map) { + this.map = map; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Model200Response.java new file mode 100644 index 00000000000..f7155491ccc --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Model200Response.java @@ -0,0 +1,147 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name starting with number + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name starting with number") +@JsonTypeName("200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Model200Response implements Serializable { + private Integer name; + private String propertyClass; + + protected Model200Response(Model200ResponseBuilder b) { + this.name = b.name; + this.propertyClass = b.propertyClass; + } + + public Model200Response() { + } + + /** + **/ + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + + @JsonProperty("name") + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("class") + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty("class") + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static Model200ResponseBuilder builder() { + return new Model200ResponseBuilderImpl(); + } + + private static class Model200ResponseBuilderImpl extends Model200ResponseBuilder { + + @Override + protected Model200ResponseBuilderImpl self() { + return this; + } + + @Override + public Model200Response build() { + return new Model200Response(this); + } + } + + public static abstract class Model200ResponseBuilder> { + private Integer name; + private String propertyClass; + protected abstract B self(); + + public abstract C build(); + + public B name(Integer name) { + this.name = name; + return self(); + } + public B propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..545f9724820 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,173 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ApiResponse") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelApiResponse implements Serializable { + private Integer code; + private String type; + private String message; + + protected ModelApiResponse(ModelApiResponseBuilder b) { + this.code = b.code; + this.type = b.type; + this.message = b.message; + } + + public ModelApiResponse() { + } + + /** + **/ + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("code") + public Integer getCode() { + return code; + } + + @JsonProperty("code") + public void setCode(Integer code) { + this.code = code; + } + + /** + **/ + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("type") + public String getType() { + return type; + } + + @JsonProperty("type") + public void setType(String type) { + this.type = type; + } + + /** + **/ + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("message") + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ModelApiResponseBuilder builder() { + return new ModelApiResponseBuilderImpl(); + } + + private static class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { + + @Override + protected ModelApiResponseBuilderImpl self() { + return this; + } + + @Override + public ModelApiResponse build() { + return new ModelApiResponse(this); + } + } + + public static abstract class ModelApiResponseBuilder> { + private Integer code; + private String type; + private String message; + protected abstract B self(); + + public abstract C build(); + + public B code(Integer code) { + this.code = code; + return self(); + } + public B type(String type) { + this.type = type; + return self(); + } + public B message(String message) { + this.message = message; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelFile.java new file mode 100644 index 00000000000..d7ee8d7b5b6 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,120 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Must be named `File` for test.") +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelFile implements Serializable { + private String sourceURI; + + protected ModelFile(ModelFileBuilder b) { + this.sourceURI = b.sourceURI; + } + + public ModelFile() { + } + + /** + * Test capitalization + **/ + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Test capitalization") + @JsonProperty("sourceURI") + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty("sourceURI") + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ModelFileBuilder builder() { + return new ModelFileBuilderImpl(); + } + + private static class ModelFileBuilderImpl extends ModelFileBuilder { + + @Override + protected ModelFileBuilderImpl self() { + return this; + } + + @Override + public ModelFile build() { + return new ModelFile(this); + } + } + + public static abstract class ModelFileBuilder> { + private String sourceURI; + protected abstract B self(); + + public abstract C build(); + + public B sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelList.java new file mode 100644 index 00000000000..fee323c08d1 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelList.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelList implements Serializable { + private String _123list; + + protected ModelList(ModelListBuilder b) { + this._123list = b._123list; + } + + public ModelList() { + } + + /** + **/ + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("123-list") + public String get123list() { + return _123list; + } + + @JsonProperty("123-list") + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ModelListBuilder builder() { + return new ModelListBuilderImpl(); + } + + private static class ModelListBuilderImpl extends ModelListBuilder { + + @Override + protected ModelListBuilderImpl self() { + return this; + } + + @Override + public ModelList build() { + return new ModelList(this); + } + } + + public static abstract class ModelListBuilder> { + private String _123list; + protected abstract B self(); + + public abstract C build(); + + public B _123list(String _123list) { + this._123list = _123list; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelReturn.java new file mode 100644 index 00000000000..cdc5cdb4e03 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ModelReturn.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing reserved words + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing reserved words") +@JsonTypeName("Return") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ModelReturn implements Serializable { + private Integer _return; + + protected ModelReturn(ModelReturnBuilder b) { + this._return = b._return; + } + + public ModelReturn() { + } + + /** + **/ + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("return") + public Integer getReturn() { + return _return; + } + + @JsonProperty("return") + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ModelReturnBuilder builder() { + return new ModelReturnBuilderImpl(); + } + + private static class ModelReturnBuilderImpl extends ModelReturnBuilder { + + @Override + protected ModelReturnBuilderImpl self() { + return this; + } + + @Override + public ModelReturn build() { + return new ModelReturn(this); + } + } + + public static abstract class ModelReturnBuilder> { + private Integer _return; + protected abstract B self(); + + public abstract C build(); + + public B _return(Integer _return) { + this._return = _return; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Name.java new file mode 100644 index 00000000000..752ab140b08 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Name.java @@ -0,0 +1,202 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Model for testing model name same as property name + **/ + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name same as property name") +@JsonTypeName("Name") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Name implements Serializable { + private Integer name; + private Integer snakeCase; + private String property; + private Integer _123number; + + protected Name(NameBuilder b) { + this.name = b.name; + this.snakeCase = b.snakeCase; + this.property = b.property; + this._123number = b._123number; + } + + public Name() { + } + + /** + **/ + public Name name(Integer name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("name") + @NotNull public Integer getName() { + return name; + } + + @JsonProperty("name") + public void setName(Integer name) { + this.name = name; + } + + /** + **/ + public Name snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("snake_case") + public Integer getSnakeCase() { + return snakeCase; + } + + @JsonProperty("snake_case") + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + /** + **/ + public Name property(String property) { + this.property = property; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("property") + public String getProperty() { + return property; + } + + @JsonProperty("property") + public void setProperty(String property) { + this.property = property; + } + + /** + **/ + public Name _123number(Integer _123number) { + this._123number = _123number; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("123Number") + public Integer get123number() { + return _123number; + } + + @JsonProperty("123Number") + public void set123number(Integer _123number) { + this._123number = _123number; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static NameBuilder builder() { + return new NameBuilderImpl(); + } + + private static class NameBuilderImpl extends NameBuilder { + + @Override + protected NameBuilderImpl self() { + return this; + } + + @Override + public Name build() { + return new Name(this); + } + } + + public static abstract class NameBuilder> { + private Integer name; + private Integer snakeCase; + private String property; + private Integer _123number; + protected abstract B self(); + + public abstract C build(); + + public B name(Integer name) { + this.name = name; + return self(); + } + public B snakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + return self(); + } + public B property(String property) { + this.property = property; + return self(); + } + public B _123number(Integer _123number) { + this._123number = _123number; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NullableClass.java new file mode 100644 index 00000000000..bfb7bed7dc7 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NullableClass.java @@ -0,0 +1,429 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("NullableClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NullableClass extends HashMap implements Serializable { + private Integer integerProp; + private BigDecimal numberProp; + private Boolean booleanProp; + private String stringProp; + private LocalDate dateProp; + private LocalDateTime datetimeProp; + private @Valid List arrayNullableProp; + private @Valid List arrayAndItemsNullableProp; + private @Valid List arrayItemsNullable = new ArrayList<>(); + private @Valid Map objectNullableProp; + private @Valid Map objectAndItemsNullableProp; + private @Valid Map objectItemsNullable = new HashMap<>(); + + /** + **/ + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("integer_prop") + public Integer getIntegerProp() { + return integerProp; + } + + @JsonProperty("integer_prop") + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + /** + **/ + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("number_prop") + @Valid public BigDecimal getNumberProp() { + return numberProp; + } + + @JsonProperty("number_prop") + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + /** + **/ + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("boolean_prop") + public Boolean getBooleanProp() { + return booleanProp; + } + + @JsonProperty("boolean_prop") + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + /** + **/ + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("string_prop") + public String getStringProp() { + return stringProp; + } + + @JsonProperty("string_prop") + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + /** + **/ + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("date_prop") + public LocalDate getDateProp() { + return dateProp; + } + + @JsonProperty("date_prop") + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + /** + **/ + public NullableClass datetimeProp(LocalDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("datetime_prop") + public LocalDateTime getDatetimeProp() { + return datetimeProp; + } + + @JsonProperty("datetime_prop") + public void setDatetimeProp(LocalDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + /** + **/ + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_nullable_prop") + public List getArrayNullableProp() { + return arrayNullableProp; + } + + @JsonProperty("array_nullable_prop") + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + public NullableClass removeArrayNullablePropItem(Object arrayNullablePropItem) { + if (arrayNullablePropItem != null && this.arrayNullableProp != null) { + this.arrayNullableProp.remove(arrayNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_and_items_nullable_prop") + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + @JsonProperty("array_and_items_nullable_prop") + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + public NullableClass removeArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (arrayAndItemsNullablePropItem != null && this.arrayAndItemsNullableProp != null) { + this.arrayAndItemsNullableProp.remove(arrayAndItemsNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("array_items_nullable") + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + @JsonProperty("array_items_nullable") + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + public NullableClass removeArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (arrayItemsNullableItem != null && this.arrayItemsNullable != null) { + this.arrayItemsNullable.remove(arrayItemsNullableItem); + } + + return this; + } + /** + **/ + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("object_nullable_prop") + public Map getObjectNullableProp() { + return objectNullableProp; + } + + @JsonProperty("object_nullable_prop") + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + public NullableClass removeObjectNullablePropItem(String key) { + if (this.objectNullableProp != null) { + this.objectNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("object_and_items_nullable_prop") + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + @JsonProperty("object_and_items_nullable_prop") + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + public NullableClass removeObjectAndItemsNullablePropItem(String key) { + if (this.objectAndItemsNullableProp != null) { + this.objectAndItemsNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("object_items_nullable") + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + @JsonProperty("object_items_nullable") + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + public NullableClass removeObjectItemsNullableItem(String key) { + if (this.objectItemsNullable != null) { + this.objectItemsNullable.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NumberOnly.java new file mode 100644 index 00000000000..020da59d7d8 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/NumberOnly.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("NumberOnly") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NumberOnly implements Serializable { + private BigDecimal justNumber; + + protected NumberOnly(NumberOnlyBuilder b) { + this.justNumber = b.justNumber; + } + + public NumberOnly() { + } + + /** + **/ + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("JustNumber") + @Valid public BigDecimal getJustNumber() { + return justNumber; + } + + @JsonProperty("JustNumber") + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static NumberOnlyBuilder builder() { + return new NumberOnlyBuilderImpl(); + } + + private static class NumberOnlyBuilderImpl extends NumberOnlyBuilder { + + @Override + protected NumberOnlyBuilderImpl self() { + return this; + } + + @Override + public NumberOnly build() { + return new NumberOnly(this); + } + } + + public static abstract class NumberOnlyBuilder> { + private BigDecimal justNumber; + protected abstract B self(); + + public abstract C build(); + + public B justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..d0b9a39681e --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,221 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.DeprecatedObject; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ObjectWithDeprecatedFields") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ObjectWithDeprecatedFields implements Serializable { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private @Valid List bars = new ArrayList<>(); + + protected ObjectWithDeprecatedFields(ObjectWithDeprecatedFieldsBuilder b) { + this.uuid = b.uuid; + this.id = b.id; + this.deprecatedRef = b.deprecatedRef; + this.bars = b.bars; + } + + public ObjectWithDeprecatedFields() { + } + + /** + **/ + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("uuid") + public String getUuid() { + return uuid; + } + + @JsonProperty("uuid") + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + **/ + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + @Valid public BigDecimal getId() { + return id; + } + + @JsonProperty("id") + public void setId(BigDecimal id) { + this.id = id; + } + + /** + **/ + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("deprecatedRef") + @Valid public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + @JsonProperty("deprecatedRef") + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + /** + **/ + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("bars") + public List getBars() { + return bars; + } + + @JsonProperty("bars") + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + + this.bars.add(barsItem); + return this; + } + + public ObjectWithDeprecatedFields removeBarsItem(String barsItem) { + if (barsItem != null && this.bars != null) { + this.bars.remove(barsItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ObjectWithDeprecatedFieldsBuilder builder() { + return new ObjectWithDeprecatedFieldsBuilderImpl(); + } + + private static class ObjectWithDeprecatedFieldsBuilderImpl extends ObjectWithDeprecatedFieldsBuilder { + + @Override + protected ObjectWithDeprecatedFieldsBuilderImpl self() { + return this; + } + + @Override + public ObjectWithDeprecatedFields build() { + return new ObjectWithDeprecatedFields(this); + } + } + + public static abstract class ObjectWithDeprecatedFieldsBuilder> { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private List bars = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B uuid(String uuid) { + this.uuid = uuid; + return self(); + } + public B id(BigDecimal id) { + this.id = id; + return self(); + } + public B deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return self(); + } + public B bars(List bars) { + this.bars = bars; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..3f871a45035 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Order.java @@ -0,0 +1,305 @@ +package org.openapitools.model; + +import java.time.LocalDateTime; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Order") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Order implements Serializable { + private Long id; + private Long petId; + private Integer quantity; + private LocalDateTime shipDate; + public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private StatusEnum status; + private Boolean complete = false; + + protected Order(OrderBuilder b) { + this.id = b.id; + this.petId = b.petId; + this.quantity = b.quantity; + this.shipDate = b.shipDate; + this.status = b.status; + this.complete = b.complete; + } + + public Order() { + } + + /** + **/ + public Order id(Long id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + @JsonProperty("id") + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("petId") + public Long getPetId() { + return petId; + } + + @JsonProperty("petId") + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + **/ + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("quantity") + public Integer getQuantity() { + return quantity; + } + + @JsonProperty("quantity") + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + **/ + public Order shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("shipDate") + public LocalDateTime getShipDate() { + return shipDate; + } + + @JsonProperty("shipDate") + public void setShipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + **/ + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Order Status") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + + @JsonProperty("status") + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + **/ + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + + @JsonProperty("complete") + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static OrderBuilder builder() { + return new OrderBuilderImpl(); + } + + private static class OrderBuilderImpl extends OrderBuilder { + + @Override + protected OrderBuilderImpl self() { + return this; + } + + @Override + public Order build() { + return new Order(this); + } + } + + public static abstract class OrderBuilder> { + private Long id; + private Long petId; + private Integer quantity; + private LocalDateTime shipDate; + private StatusEnum status; + private Boolean complete = false; + protected abstract B self(); + + public abstract C build(); + + public B id(Long id) { + this.id = id; + return self(); + } + public B petId(Long petId) { + this.petId = petId; + return self(); + } + public B quantity(Integer quantity) { + this.quantity = quantity; + return self(); + } + public B shipDate(LocalDateTime shipDate) { + this.shipDate = shipDate; + return self(); + } + public B status(StatusEnum status) { + this.status = status; + return self(); + } + public B complete(Boolean complete) { + this.complete = complete; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterComposite.java new file mode 100644 index 00000000000..990e7fe8a2e --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterComposite.java @@ -0,0 +1,173 @@ +package org.openapitools.model; + +import java.math.BigDecimal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("OuterComposite") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterComposite implements Serializable { + private BigDecimal myNumber; + private String myString; + private Boolean myBoolean; + + protected OuterComposite(OuterCompositeBuilder b) { + this.myNumber = b.myNumber; + this.myString = b.myString; + this.myBoolean = b.myBoolean; + } + + public OuterComposite() { + } + + /** + **/ + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("my_number") + @Valid public BigDecimal getMyNumber() { + return myNumber; + } + + @JsonProperty("my_number") + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + /** + **/ + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("my_string") + public String getMyString() { + return myString; + } + + @JsonProperty("my_string") + public void setMyString(String myString) { + this.myString = myString; + } + + /** + **/ + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("my_boolean") + public Boolean getMyBoolean() { + return myBoolean; + } + + @JsonProperty("my_boolean") + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static OuterCompositeBuilder builder() { + return new OuterCompositeBuilderImpl(); + } + + private static class OuterCompositeBuilderImpl extends OuterCompositeBuilder { + + @Override + protected OuterCompositeBuilderImpl self() { + return this; + } + + @Override + public OuterComposite build() { + return new OuterComposite(this); + } + } + + public static abstract class OuterCompositeBuilder> { + private BigDecimal myNumber; + private String myString; + private Boolean myBoolean; + protected abstract B self(); + + public abstract C build(); + + public B myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return self(); + } + public B myString(String myString) { + this.myString = myString; + return self(); + } + public B myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnum.java new file mode 100644 index 00000000000..5f86922395d --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnum.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnum fromString(String s) { + for (OuterEnum b : OuterEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + return null; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..f9fd44c8deb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumDefaultValue fromString(String s) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumInteger.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumInteger.java new file mode 100644 index 00000000000..a81c0a77beb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumInteger.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumInteger fromString(String s) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..3f16a4d4e45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumIntegerDefaultValue fromString(String s) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..d6c9017b128 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import org.openapitools.model.OuterEnumInteger; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("OuterObjectWithEnumProperty") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterObjectWithEnumProperty implements Serializable { + private OuterEnumInteger value; + + protected OuterObjectWithEnumProperty(OuterObjectWithEnumPropertyBuilder b) { + this.value = b.value; + } + + public OuterObjectWithEnumProperty() { + } + + /** + **/ + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("value") + @NotNull public OuterEnumInteger getValue() { + return value; + } + + @JsonProperty("value") + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static OuterObjectWithEnumPropertyBuilder builder() { + return new OuterObjectWithEnumPropertyBuilderImpl(); + } + + private static class OuterObjectWithEnumPropertyBuilderImpl extends OuterObjectWithEnumPropertyBuilder { + + @Override + protected OuterObjectWithEnumPropertyBuilderImpl self() { + return this; + } + + @Override + public OuterObjectWithEnumProperty build() { + return new OuterObjectWithEnumProperty(this); + } + } + + public static abstract class OuterObjectWithEnumPropertyBuilder> { + private OuterEnumInteger value; + protected abstract B self(); + + public abstract C build(); + + public B value(OuterEnumInteger value) { + this.value = value; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ParentWithNullable.java new file mode 100644 index 00000000000..fbf1428e73a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ParentWithNullable.java @@ -0,0 +1,199 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ParentWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ParentWithNullable implements Serializable { + public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + private String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static TypeEnum fromString(String s) { + for (TypeEnum b : TypeEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private TypeEnum type; + private String nullableProperty; + + protected ParentWithNullable(ParentWithNullableBuilder b) { + this.type = b.type; + this.nullableProperty = b.nullableProperty; + } + + public ParentWithNullable() { + } + + /** + **/ + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + @JsonProperty("type") + public void setType(TypeEnum type) { + this.type = type; + } + + /** + **/ + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("nullableProperty") + public String getNullableProperty() { + return nullableProperty; + } + + @JsonProperty("nullableProperty") + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + Objects.equals(this.nullableProperty, parentWithNullable.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash(type, nullableProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ParentWithNullableBuilder builder() { + return new ParentWithNullableBuilderImpl(); + } + + private static class ParentWithNullableBuilderImpl extends ParentWithNullableBuilder { + + @Override + protected ParentWithNullableBuilderImpl self() { + return this; + } + + @Override + public ParentWithNullable build() { + return new ParentWithNullable(this); + } + } + + public static abstract class ParentWithNullableBuilder> { + private TypeEnum type; + private String nullableProperty; + protected abstract B self(); + + public abstract C build(); + + public B type(TypeEnum type) { + this.type = type; + return self(); + } + public B nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..028924bdf17 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Pet.java @@ -0,0 +1,345 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Pet") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Pet implements Serializable { + private Long id; + private Category category; + private String name; + private @Valid Set photoUrls = new LinkedHashSet<>(); + private @Valid List<@Valid Tag> tags = new ArrayList<>(); + public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private StatusEnum status; + + protected Pet(PetBuilder b) { + this.id = b.id; + this.category = b.category; + this.name = b.name; + this.photoUrls = b.photoUrls; + this.tags = b.tags; + this.status = b.status; + } + + public Pet() { + } + + /** + **/ + public Pet id(Long id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + @JsonProperty("id") + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Pet category(Category category) { + this.category = category; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("category") + @Valid public Category getCategory() { + return category; + } + + @JsonProperty("category") + public void setCategory(Category category) { + this.category = category; + } + + /** + **/ + public Pet name(String name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "doggie", required = true, description = "") + @JsonProperty("name") + @NotNull public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + /** + **/ + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") + @JsonProperty("photoUrls") + @NotNull public Set getPhotoUrls() { + return photoUrls; + } + + @JsonProperty("photoUrls") + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + + this.photoUrls.add(photoUrlsItem); + return this; + } + + public Pet removePhotoUrlsItem(String photoUrlsItem) { + if (photoUrlsItem != null && this.photoUrls != null) { + this.photoUrls.remove(photoUrlsItem); + } + + return this; + } + /** + **/ + public Pet tags(List<@Valid Tag> tags) { + this.tags = tags; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("tags") + @Valid public List<@Valid Tag> getTags() { + return tags; + } + + @JsonProperty("tags") + public void setTags(List<@Valid Tag> tags) { + this.tags = tags; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + + this.tags.add(tagsItem); + return this; + } + + public Pet removeTagsItem(Tag tagsItem) { + if (tagsItem != null && this.tags != null) { + this.tags.remove(tagsItem); + } + + return this; + } + /** + * pet status in the store + **/ + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "pet status in the store") + @JsonProperty("status") + public StatusEnum getStatus() { + return status; + } + + @JsonProperty("status") + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static PetBuilder builder() { + return new PetBuilderImpl(); + } + + private static class PetBuilderImpl extends PetBuilder { + + @Override + protected PetBuilderImpl self() { + return this; + } + + @Override + public Pet build() { + return new Pet(this); + } + } + + public static abstract class PetBuilder> { + private Long id; + private Category category; + private String name; + private Set photoUrls = new LinkedHashSet<>(); + private List<@Valid Tag> tags = new ArrayList<>(); + private StatusEnum status; + protected abstract B self(); + + public abstract C build(); + + public B id(Long id) { + this.id = id; + return self(); + } + public B category(Category category) { + this.category = category; + return self(); + } + public B name(String name) { + this.name = name; + return self(); + } + public B photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return self(); + } + public B tags(List<@Valid Tag> tags) { + this.tags = tags; + return self(); + } + public B status(StatusEnum status) { + this.status = status; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..5aa6bea920e --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -0,0 +1,144 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("ReadOnlyFirst") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ReadOnlyFirst implements Serializable { + private String bar; + private String baz; + + protected ReadOnlyFirst(ReadOnlyFirstBuilder b) { + this.bar = b.bar; + this.baz = b.baz; + } + + public ReadOnlyFirst() { + } + + /** + **/ + public ReadOnlyFirst bar(String bar) { + this.bar = bar; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + @JsonProperty("bar") + public void setBar(String bar) { + this.bar = bar; + } + + /** + **/ + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("baz") + public String getBaz() { + return baz; + } + + @JsonProperty("baz") + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ReadOnlyFirstBuilder builder() { + return new ReadOnlyFirstBuilderImpl(); + } + + private static class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { + + @Override + protected ReadOnlyFirstBuilderImpl self() { + return this; + } + + @Override + public ReadOnlyFirst build() { + return new ReadOnlyFirst(this); + } + } + + public static abstract class ReadOnlyFirstBuilder> { + private String bar; + private String baz; + protected abstract B self(); + + public abstract C build(); + + public B bar(String bar) { + this.bar = bar; + return self(); + } + public B baz(String baz) { + this.baz = baz; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SingleRefType.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SingleRefType.java new file mode 100644 index 00000000000..3314a0f57b4 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SingleRefType.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static SingleRefType fromString(String s) { + for (SingleRefType b : SingleRefType.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SpecialModelName.java new file mode 100644 index 00000000000..8f3c9aa5e15 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -0,0 +1,117 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("_special_model.name_") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class SpecialModelName implements Serializable { + private Long $specialPropertyName; + + protected SpecialModelName(SpecialModelNameBuilder b) { + this.$specialPropertyName = b.$specialPropertyName; + } + + public SpecialModelName() { + } + + /** + **/ + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("$special[property.name]") + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + @JsonProperty("$special[property.name]") + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static SpecialModelNameBuilder builder() { + return new SpecialModelNameBuilderImpl(); + } + + private static class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { + + @Override + protected SpecialModelNameBuilderImpl self() { + return this; + } + + @Override + public SpecialModelName build() { + return new SpecialModelName(this); + } + } + + public static abstract class SpecialModelNameBuilder> { + private Long $specialPropertyName; + protected abstract B self(); + + public abstract C build(); + + public B $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..f6d7690ff25 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/Tag.java @@ -0,0 +1,144 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("Tag") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Tag implements Serializable { + private Long id; + private String name; + + protected Tag(TagBuilder b) { + this.id = b.id; + this.name = b.name; + } + + public Tag() { + } + + /** + **/ + public Tag id(Long id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + @JsonProperty("id") + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public Tag name(String name) { + this.name = name; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static TagBuilder builder() { + return new TagBuilderImpl(); + } + + private static class TagBuilderImpl extends TagBuilder { + + @Override + protected TagBuilderImpl self() { + return this; + } + + @Override + public Tag build() { + return new Tag(this); + } + } + + public static abstract class TagBuilder> { + private Long id; + private String name; + protected abstract B self(); + + public abstract C build(); + + public B id(Long id) { + this.id = id; + return self(); + } + public B name(String name) { + this.name = name; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..6d66e999f9b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,85 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap implements Serializable { + private String someProperty; + + /** + **/ + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("someProperty") + public String getSomeProperty() { + return someProperty; + } + + @JsonProperty("someProperty") + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderDefault.java similarity index 92% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderDefault.java index b65001c6c43..7e69e1aeb8a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -10,7 +8,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -19,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("TypeHolderDefault") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class TypeHolderDefault implements Serializable { @@ -47,7 +45,7 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("string_item") @NotNull public String getStringItem() { return stringItem; @@ -66,7 +64,7 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("number_item") @NotNull @Valid public BigDecimal getNumberItem() { return numberItem; @@ -85,7 +83,7 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("integer_item") @NotNull public Integer getIntegerItem() { return integerItem; @@ -104,7 +102,7 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("bool_item") @NotNull public Boolean getBoolItem() { return boolItem; @@ -123,7 +121,7 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("array_item") @NotNull public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderExample.java similarity index 90% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderExample.java index 70ce2b8d222..a8c018d5a93 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -10,7 +8,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -19,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("TypeHolderExample") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class TypeHolderExample implements Serializable { @@ -49,7 +47,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "what", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "what", required = true, description = "") @JsonProperty("string_item") @NotNull public String getStringItem() { return stringItem; @@ -68,7 +66,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "1.234", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "") @JsonProperty("number_item") @NotNull @Valid public BigDecimal getNumberItem() { return numberItem; @@ -87,7 +85,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "1.234", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "") @JsonProperty("float_item") @NotNull public Float getFloatItem() { return floatItem; @@ -106,7 +104,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "-2", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", required = true, description = "") @JsonProperty("integer_item") @NotNull public Integer getIntegerItem() { return integerItem; @@ -125,7 +123,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "true", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", required = true, description = "") @JsonProperty("bool_item") @NotNull public Boolean getBoolItem() { return boolItem; @@ -144,7 +142,7 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "[0, 1, 2, 3]", required = true, description = "") @JsonProperty("array_item") @NotNull public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..703d4ab8285 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/User.java @@ -0,0 +1,313 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") +@JsonTypeName("User") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class User implements Serializable { + private Long id; + private String username; + private String firstName; + private String lastName; + private String email; + private String password; + private String phone; + private Integer userStatus; + + protected User(UserBuilder b) { + this.id = b.id; + this.username = b.username; + this.firstName = b.firstName; + this.lastName = b.lastName; + this.email = b.email; + this.password = b.password; + this.phone = b.phone; + this.userStatus = b.userStatus; + } + + public User() { + } + + /** + **/ + public User id(Long id) { + this.id = id; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("id") + public Long getId() { + return id; + } + + @JsonProperty("id") + public void setId(Long id) { + this.id = id; + } + + /** + **/ + public User username(String username) { + this.username = username; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + + @JsonProperty("username") + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("firstName") + public String getFirstName() { + return firstName; + } + + @JsonProperty("firstName") + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + **/ + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("lastName") + public String getLastName() { + return lastName; + } + + @JsonProperty("lastName") + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + **/ + public User email(String email) { + this.email = email; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("email") + public String getEmail() { + return email; + } + + @JsonProperty("email") + public void setEmail(String email) { + this.email = email; + } + + /** + **/ + public User password(String password) { + this.password = password; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + + @JsonProperty("password") + public void setPassword(String password) { + this.password = password; + } + + /** + **/ + public User phone(String phone) { + this.phone = phone; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") + @JsonProperty("phone") + public String getPhone() { + return phone; + } + + @JsonProperty("phone") + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + **/ + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "User Status") + @JsonProperty("userStatus") + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty("userStatus") + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static UserBuilder builder() { + return new UserBuilderImpl(); + } + + private static class UserBuilderImpl extends UserBuilder { + + @Override + protected UserBuilderImpl self() { + return this; + } + + @Override + public User build() { + return new User(this); + } + } + + public static abstract class UserBuilder> { + private Long id; + private String username; + private String firstName; + private String lastName; + private String email; + private String password; + private String phone; + private Integer userStatus; + protected abstract B self(); + + public abstract C build(); + + public B id(Long id) { + this.id = id; + return self(); + } + public B username(String username) { + this.username = username; + return self(); + } + public B firstName(String firstName) { + this.firstName = firstName; + return self(); + } + public B lastName(String lastName) { + this.lastName = lastName; + return self(); + } + public B email(String email) { + this.email = email; + return self(); + } + public B password(String password) { + this.password = password; + return self(); + } + public B phone(String phone) { + this.phone = phone; + return self(); + } + public B userStatus(Integer userStatus) { + this.userStatus = userStatus; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/XmlItem.java similarity index 91% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java rename to samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/XmlItem.java index d6765fb244d..8f1c6870d94 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/model/XmlItem.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -10,7 +8,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -19,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; +@org.eclipse.microprofile.openapi.annotations.media.Schema(description="") @JsonTypeName("XmlItem") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class XmlItem implements Serializable { @@ -95,7 +93,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("attribute_string") public String getAttributeString() { return attributeString; @@ -114,7 +112,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("attribute_number") @Valid public BigDecimal getAttributeNumber() { return attributeNumber; @@ -133,7 +131,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("attribute_integer") public Integer getAttributeInteger() { return attributeInteger; @@ -152,7 +150,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { return attributeBoolean; @@ -171,7 +169,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -206,7 +204,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("name_string") public String getNameString() { return nameString; @@ -225,7 +223,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("name_number") @Valid public BigDecimal getNameNumber() { return nameNumber; @@ -244,7 +242,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("name_integer") public Integer getNameInteger() { return nameInteger; @@ -263,7 +261,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("name_boolean") public Boolean getNameBoolean() { return nameBoolean; @@ -282,7 +280,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -317,7 +315,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -352,7 +350,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("prefix_string") public String getPrefixString() { return prefixString; @@ -371,7 +369,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("prefix_number") @Valid public BigDecimal getPrefixNumber() { return prefixNumber; @@ -390,7 +388,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("prefix_integer") public Integer getPrefixInteger() { return prefixInteger; @@ -409,7 +407,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { return prefixBoolean; @@ -428,7 +426,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -463,7 +461,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -498,7 +496,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("namespace_string") public String getNamespaceString() { return namespaceString; @@ -517,7 +515,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("namespace_number") @Valid public BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -536,7 +534,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { return namespaceInteger; @@ -555,7 +553,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -574,7 +572,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -609,7 +607,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -644,7 +642,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("prefix_ns_string") public String getPrefixNsString() { return prefixNsString; @@ -663,7 +661,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("prefix_ns_number") @Valid public BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -682,7 +680,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { return prefixNsInteger; @@ -701,7 +699,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -720,7 +718,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -755,7 +753,7 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.jvm b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.jvm new file mode 100644 index 00000000000..fa5dabb63eb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.jvm @@ -0,0 +1,34 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode +# +# Before building the docker image run: +# +# mvn package +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/jaxrs-spec-petstore-server-jvm . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/jaxrs-spec-petstore-server-jvm +# +### +FROM fabric8/java-alpine-openjdk8-jre:1.6.5 +ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV AB_ENABLED=jmx_exporter + +# Be prepared for running in OpenShift too +RUN adduser -G root --no-create-home --disabled-password 1001 \ + && chown -R 1001 /deployments \ + && chmod -R "g+rwX" /deployments \ + && chown -R 1001:root /deployments + +COPY target/lib/* /deployments/lib/ +COPY target/*-runner.jar /deployments/app.jar +EXPOSE 8080 + +# run with user 1001 +USER 1001 + +ENTRYPOINT [ "/deployments/run-java.sh" ] \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.native b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.native new file mode 100644 index 00000000000..674f7d9d838 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/docker/Dockerfile.native @@ -0,0 +1,22 @@ +#### +# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode +# +# Before building the docker image run: +# +# mvn package -Pnative -Dquarkus.native.container-build=true +# +# Then, build the image with: +# +# docker build -f src/main/docker/Dockerfile.native -t quarkus/jaxrs-spec-petstore-server . +# +# Then run the container using: +# +# docker run -i --rm -p 8080:8080 quarkus/jaxrs-spec-petstore-server +# +### +FROM registry.access.redhat.com/ubi8/ubi-minimal +WORKDIR /work/ +COPY target/*-runner /work/application +RUN chmod 775 /work +EXPOSE 8080 +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/META-INF/openapi.yaml b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/META-INF/openapi.yaml new file mode 100644 index 00000000000..d456aa0a571 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/META-INF/openapi.yaml @@ -0,0 +1,2451 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-webclient-blocking: false + x-accepts: + - application/json + x-tags: + - tag: store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + x-tags: + - tag: fake + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/application.properties b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/application.properties new file mode 100644 index 00000000000..83b16e96d39 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/main/resources/application.properties @@ -0,0 +1,5 @@ +# Configuration file +# key = value + +mp.openapi.scan.disable=true + diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml index 031d2beeafb..0cd16dc39fd 100644 --- a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java index 0053d3de31e..f1c97ab0d21 100644 --- a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/src/gen/java/org/openapitools/model/ReadonlyAndRequiredProperties.java @@ -43,7 +43,7 @@ public class ReadonlyAndRequiredProperties implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("requiredYesReadonlyYes") - public String getRequiredYesReadonlyYes() { + @NotNull public String getRequiredYesReadonlyYes() { return requiredYesReadonlyYes; } @@ -159,7 +159,7 @@ public class ReadonlyAndRequiredProperties implements Serializable { return new ReadonlyAndRequiredPropertiesBuilderImpl(); } - private static final class ReadonlyAndRequiredPropertiesBuilderImpl extends ReadonlyAndRequiredPropertiesBuilder { + private static class ReadonlyAndRequiredPropertiesBuilderImpl extends ReadonlyAndRequiredPropertiesBuilder { @Override protected ReadonlyAndRequiredPropertiesBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES index 3ed6ff4d23c..7155b1df8e8 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES @@ -3,36 +3,38 @@ pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java src/gen/java/org/openapitools/api/FakeApi.java src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FooApi.java src/gen/java/org/openapitools/api/PetApi.java src/gen/java/org/openapitools/api/RestApplication.java src/gen/java/org/openapitools/api/RestResourceRoot.java src/gen/java/org/openapitools/api/StoreApi.java src/gen/java/org/openapitools/api/UserApi.java -src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java -src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java -src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java -src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/AllOfWithSingleRef.java src/gen/java/org/openapitools/model/Animal.java src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java src/gen/java/org/openapitools/model/ArrayTest.java -src/gen/java/org/openapitools/model/BigCat.java src/gen/java/org/openapitools/model/Capitalization.java src/gen/java/org/openapitools/model/Cat.java src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ChildWithNullable.java src/gen/java/org/openapitools/model/ClassModel.java src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/DeprecatedObject.java src/gen/java/org/openapitools/model/Dog.java src/gen/java/org/openapitools/model/EnumArrays.java src/gen/java/org/openapitools/model/EnumClass.java src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java +src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/Foo.java +src/gen/java/org/openapitools/model/FooGetDefaultResponse.java src/gen/java/org/openapitools/model/FormatTest.java src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/HealthCheckResult.java +src/gen/java/org/openapitools/model/IntegerEnum.java src/gen/java/org/openapitools/model/MapTest.java src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java src/gen/java/org/openapitools/model/Model200Response.java @@ -41,16 +43,23 @@ src/gen/java/org/openapitools/model/ModelFile.java src/gen/java/org/openapitools/model/ModelList.java src/gen/java/org/openapitools/model/ModelReturn.java src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NullableClass.java src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java src/gen/java/org/openapitools/model/Order.java src/gen/java/org/openapitools/model/OuterComposite.java src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java +src/gen/java/org/openapitools/model/OuterEnumInteger.java +src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java +src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +src/gen/java/org/openapitools/model/ParentWithNullable.java src/gen/java/org/openapitools/model/Pet.java src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SingleRefType.java src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/StringEnum.java src/gen/java/org/openapitools/model/Tag.java -src/gen/java/org/openapitools/model/TypeHolderDefault.java -src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java src/gen/java/org/openapitools/model/User.java -src/gen/java/org/openapitools/model/XmlItem.java src/main/openapi/openapi.yaml diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 031d2beeafb..0cd16dc39fd 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java index a7679ad663a..1eb8d9b6629 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import java.util.UUID; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -29,7 +28,7 @@ public class AnotherFakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response call123testSpecialTags(@HeaderParam("uuid_test") @NotNull @ApiParam("to test uuid example value") UUID uuidTest,@Valid @NotNull Client body) { + public Response call123testSpecialTags(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index f2c14af1ad9..3b89dfc7324 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,16 +1,23 @@ package org.openapitools.api; import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; import java.util.Date; +import org.openapitools.model.EnumClass; +import org.openapitools.model.FakeBigDecimalMap200Response; +import org.openapitools.model.FakeTestsDefaultsDefaultResponse; import java.io.File; import org.openapitools.model.FileSchemaTestClass; +import org.openapitools.model.HealthCheckResult; import org.joda.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.model.User; -import org.openapitools.model.XmlItem; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -31,19 +38,45 @@ import javax.validation.Valid; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class FakeApi { - @POST - @Path("/create_xml_item") - @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) - @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake" }) + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + @ApiOperation(value = "", notes = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", response = FakeBigDecimalMap200Response.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) + @ApiResponse(code = 200, message = "successful operation", response = FakeBigDecimalMap200Response.class) }) - public Response createXmlItem(@Valid @NotNull XmlItem xmlItem) { + public Response fakeBigDecimalMap() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/health") + @Produces({ "application/json" }) + @ApiOperation(value = "Health check endpoint", notes = "", response = HealthCheckResult.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResult.class) + }) + public Response fakeHealthGet() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + @ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = { + + @Authorization(value = "http_signature_test") + }, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) + }) + public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") @ApiParam("query parameter") String query1,@HeaderParam("header_1") @ApiParam("header parameter") String header1) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/boolean") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) @ApiResponses(value = { @@ -55,17 +88,19 @@ public class FakeApi { @POST @Path("/outer/composite") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) { + public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/number") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) @ApiResponses(value = { @@ -77,6 +112,7 @@ public class FakeApi { @POST @Path("/outer/string") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) @ApiResponses(value = { @@ -86,14 +122,59 @@ public class FakeApi { return Response.ok().entity("magic!").build(); } - @PUT - @Path("/body-with-file-schema") + @POST + @Path("/property/enum-int") @Consumes({ "application/json" }) - @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake" }) + @Produces({ "*/*" }) + @ApiOperation(value = "", notes = "Test serialization of enum (int) properties with examples", response = OuterObjectWithEnumProperty.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output enum (int)", response = OuterObjectWithEnumProperty.class) + }) + public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/tests/defaults") + @Produces({ "application/json" }) + @ApiOperation(value = "test enum default in request body", notes = "", response = FakeTestsDefaultsDefaultResponse.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "response", response = FakeTestsDefaultsDefaultResponse.class) + }) + public Response fakeTestsDefaults() { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + @ApiOperation(value = "test referenced additionalProperties", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testAdditionalPropertiesReference(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + @ApiOperation(value = "", notes = "For this test, the body has to be a binary file.", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body) { + public Response testBodyWithBinary(@Valid File body) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + @ApiOperation(value = "", notes = "For this test, the body for this request must reference a schema named `File`.", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) + }) + public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { return Response.ok().entity("magic!").build(); } @@ -104,7 +185,7 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body) { + public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } @@ -115,13 +196,13 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@Valid @NotNull Client body) { + public Response testClientModel(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } @POST @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake" }) @@ -143,12 +224,15 @@ public class FakeApi { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { return Response.ok().entity("magic!").build(); } @DELETE - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake" }) + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, authorizations = { + + @Authorization(value = "bearer_test") + }, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Something wrong", response = Void.class) }) @@ -163,7 +247,18 @@ public class FakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@Valid @NotNull Map param) { + public Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + @ApiOperation(value = "test inline free-form additionalProperties", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { return Response.ok().entity("magic!").build(); } @@ -178,13 +273,35 @@ public class FakeApi { return Response.ok().entity("magic!").build(); } + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + @ApiOperation(value = "test nullable parent property", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testNullable(@Valid @NotNull ChildWithNullable childWithNullable) { + return Response.ok().entity("magic!").build(); + } + @PUT @Path("/test-query-parameters") @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context) { + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + @ApiOperation(value = "test referenced string map", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testStringMapReference(@Valid @NotNull Map requestBody) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 7f00bc9fa4f..f8baf0028fb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,7 +31,7 @@ public class FakeClassnameTestApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@Valid @NotNull Client body) { + public Response testClassname(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java new file mode 100644 index 00000000000..dd0befa9678 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java @@ -0,0 +1,33 @@ +package org.openapitools.api; + +import org.openapitools.model.FooGetDefaultResponse; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** +* Represents a collection of functions to interact with the API endpoints. +*/ +@Path("/foo") +@Api(description = "the foo API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooApi { + + @GET + @Produces({ "application/json" }) + @ApiOperation(value = "", notes = "", response = FooGetDefaultResponse.class, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "response", response = FooGetDefaultResponse.class) + }) + public Response fooGet() { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index 1fc3e8a8d53..9d22583fef9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -32,10 +32,10 @@ public class PetApi { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@Valid @NotNull Pet body) { + public Response addPet(@Valid @NotNull Pet pet) { return Response.ok().entity("magic!").build(); } @@ -50,7 +50,7 @@ public class PetApi { @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId) { @@ -113,12 +113,12 @@ public class PetApi { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@Valid @NotNull Pet body) { + public Response updatePet(@Valid @NotNull Pet pet) { return Response.ok().entity("magic!").build(); } @@ -131,6 +131,7 @@ public class PetApi { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java index b8a1301edc2..5b490e280b3 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java @@ -62,13 +62,14 @@ public class StoreApi { @POST @Path("/order") + @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@Valid @NotNull Order body) { + public Response placeOrder(@Valid @NotNull Order order) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java index eb6d3927ad8..a1116269f3f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java @@ -23,31 +23,34 @@ import javax.validation.Valid; public class UserApi { @POST + @Consumes({ "application/json" }) @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@Valid @NotNull User body) { + public Response createUser(@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithArray") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> body) { + public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithList") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> body) { + public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user) { return Response.ok().entity("magic!").build(); } @@ -99,12 +102,13 @@ public class UserApi { @PUT @Path("/{username}") + @Consumes({ "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid @NotNull User body) { + public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 26b25d95990..a23af014ffe 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -2,9 +2,7 @@ package org.openapitools.model; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; @@ -22,30 +20,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap<>(); - private @Valid Map mapNumber = new HashMap<>(); - private @Valid Map mapInteger = new HashMap<>(); - private @Valid Map mapBoolean = new HashMap<>(); - private @Valid Map> mapArrayInteger = new HashMap<>(); - private @Valid Map> mapArrayAnytype = new HashMap<>(); - private @Valid Map> mapMapString = new HashMap<>(); - private @Valid Map> mapMapAnytype = new HashMap<>(); - private Object anytype1; - private Object anytype2; - private Object anytype3; + private @Valid Map mapProperty = new HashMap<>(); + private @Valid Map> mapOfMapProperty = new HashMap<>(); protected AdditionalPropertiesClass(AdditionalPropertiesClassBuilder b) { - this.mapString = b.mapString; - this.mapNumber = b.mapNumber; - this.mapInteger = b.mapInteger; - this.mapBoolean = b.mapBoolean; - this.mapArrayInteger = b.mapArrayInteger; - this.mapArrayAnytype = b.mapArrayAnytype; - this.mapMapString = b.mapMapString; - this.mapMapAnytype = b.mapMapAnytype; - this.anytype1 = b.anytype1; - this.anytype2 = b.anytype2; - this.anytype3 = b.anytype3; + this.mapProperty = b.mapProperty; + this.mapOfMapProperty = b.mapOfMapProperty; } public AdditionalPropertiesClass() { @@ -53,341 +33,74 @@ public class AdditionalPropertiesClass implements Serializable { /** **/ - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_string") - public Map getMapString() { - return mapString; + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; } - @JsonProperty("map_string") - public void setMapString(Map mapString) { - this.mapString = mapString; + @JsonProperty("map_property") + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); } - this.mapString.put(key, mapStringItem); + this.mapProperty.put(key, mapPropertyItem); return this; } - public AdditionalPropertiesClass removeMapStringItem(String mapStringItem) { - if (mapStringItem != null && this.mapString != null) { - this.mapString.remove(mapStringItem); + public AdditionalPropertiesClass removeMapPropertyItem(String key) { + if (this.mapProperty != null) { + this.mapProperty.remove(key); } return this; } /** **/ - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_number") - @Valid public Map getMapNumber() { - return mapNumber; + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - @JsonProperty("map_number") - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + @JsonProperty("map_of_map_property") + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); } - this.mapNumber.put(key, mapNumberItem); + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - public AdditionalPropertiesClass removeMapNumberItem(BigDecimal mapNumberItem) { - if (mapNumberItem != null && this.mapNumber != null) { - this.mapNumber.remove(mapNumberItem); + public AdditionalPropertiesClass removeMapOfMapPropertyItem(String key) { + if (this.mapOfMapProperty != null) { + this.mapOfMapProperty.remove(key); } return this; } - /** - **/ - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_integer") - public Map getMapInteger() { - return mapInteger; - } - - @JsonProperty("map_integer") - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - public AdditionalPropertiesClass removeMapIntegerItem(Integer mapIntegerItem) { - if (mapIntegerItem != null && this.mapInteger != null) { - this.mapInteger.remove(mapIntegerItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_boolean") - public Map getMapBoolean() { - return mapBoolean; - } - - @JsonProperty("map_boolean") - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - public AdditionalPropertiesClass removeMapBooleanItem(Boolean mapBooleanItem) { - if (mapBooleanItem != null && this.mapBoolean != null) { - this.mapBoolean.remove(mapBooleanItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - @JsonProperty("map_array_integer") - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - public AdditionalPropertiesClass removeMapArrayIntegerItem(List mapArrayIntegerItem) { - if (mapArrayIntegerItem != null && this.mapArrayInteger != null) { - this.mapArrayInteger.remove(mapArrayIntegerItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - @JsonProperty("map_array_anytype") - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - public AdditionalPropertiesClass removeMapArrayAnytypeItem(List mapArrayAnytypeItem) { - if (mapArrayAnytypeItem != null && this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(mapArrayAnytypeItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { - return mapMapString; - } - - @JsonProperty("map_map_string") - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - public AdditionalPropertiesClass removeMapMapStringItem(Map mapMapStringItem) { - if (mapMapStringItem != null && this.mapMapString != null) { - this.mapMapString.remove(mapMapStringItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - @JsonProperty("map_map_anytype") - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - public AdditionalPropertiesClass removeMapMapAnytypeItem(Map mapMapAnytypeItem) { - if (mapMapAnytypeItem != null && this.mapMapAnytype != null) { - this.mapMapAnytype.remove(mapMapAnytypeItem); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_1") - public Object getAnytype1() { - return anytype1; - } - - @JsonProperty("anytype_1") - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - /** - **/ - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_2") - public Object getAnytype2() { - return anytype2; - } - - @JsonProperty("anytype_2") - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - /** - **/ - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_3") - public Object getAnytype3() { - return anytype3; - } - - @JsonProperty("anytype_3") - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - @Override public boolean equals(Object o) { @@ -398,22 +111,13 @@ public class AdditionalPropertiesClass implements Serializable { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty); } @Override @@ -421,17 +125,8 @@ public class AdditionalPropertiesClass implements Serializable { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append("}"); return sb.toString(); } @@ -452,7 +147,7 @@ public class AdditionalPropertiesClass implements Serializable { return new AdditionalPropertiesClassBuilderImpl(); } - private static final class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { + private static class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder { @Override protected AdditionalPropertiesClassBuilderImpl self() { @@ -466,63 +161,18 @@ public class AdditionalPropertiesClass implements Serializable { } public static abstract class AdditionalPropertiesClassBuilder> { - private Map mapString = new HashMap<>(); - private Map mapNumber = new HashMap<>(); - private Map mapInteger = new HashMap<>(); - private Map mapBoolean = new HashMap<>(); - private Map> mapArrayInteger = new HashMap<>(); - private Map> mapArrayAnytype = new HashMap<>(); - private Map> mapMapString = new HashMap<>(); - private Map> mapMapAnytype = new HashMap<>(); - private Object anytype1; - private Object anytype2; - private Object anytype3; + private Map mapProperty = new HashMap<>(); + private Map> mapOfMapProperty = new HashMap<>(); protected abstract B self(); public abstract C build(); - public B mapString(Map mapString) { - this.mapString = mapString; + public B mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return self(); } - public B mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return self(); - } - public B mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return self(); - } - public B mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return self(); - } - public B mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return self(); - } - public B mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return self(); - } - public B mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return self(); - } - public B mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return self(); - } - public B anytype1(Object anytype1) { - this.anytype1 = anytype1; - return self(); - } - public B anytype2(Object anytype2) { - this.anytype2 = anytype2; - return self(); - } - public B anytype3(Object anytype3) { - this.anytype3 = anytype3; + public B mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return self(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..3c786494285 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -0,0 +1,147 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.SingleRefType; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("AllOfWithSingleRef") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class AllOfWithSingleRef implements Serializable { + private String username; + private SingleRefType singleRefType; + + protected AllOfWithSingleRef(AllOfWithSingleRefBuilder b) { + this.username = b.username; + this.singleRefType = b.singleRefType; + } + + public AllOfWithSingleRef() { + } + + /** + **/ + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + + @JsonProperty("username") + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("SingleRefType") + public SingleRefType getSingleRefType() { + return singleRefType; + } + + @JsonProperty("SingleRefType") + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static AllOfWithSingleRefBuilder builder() { + return new AllOfWithSingleRefBuilderImpl(); + } + + private static class AllOfWithSingleRefBuilderImpl extends AllOfWithSingleRefBuilder { + + @Override + protected AllOfWithSingleRefBuilderImpl self() { + return this; + } + + @Override + public AllOfWithSingleRef build() { + return new AllOfWithSingleRef(this); + } + } + + public static abstract class AllOfWithSingleRefBuilder> { + private String username; + private SingleRefType singleRefType; + protected abstract B self(); + + public abstract C build(); + + public B username(String username) { + this.username = username; + return self(); + } + public B singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java index 799ad73ce81..2a6429ab32f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java @@ -18,9 +18,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) @@ -122,7 +121,7 @@ public class Animal implements Serializable { return new AnimalBuilderImpl(); } - private static final class AnimalBuilderImpl extends AnimalBuilder { + private static class AnimalBuilderImpl extends AnimalBuilder { @Override protected AnimalBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index ff87ee2df16..98caf420f36 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -110,7 +110,7 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { return new ArrayOfArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { + private static class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder { @Override protected ArrayOfArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 31a04fb8602..bac8c088029 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -110,7 +110,7 @@ public class ArrayOfNumberOnly implements Serializable { return new ArrayOfNumberOnlyBuilderImpl(); } - private static final class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { + private static class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder { @Override protected ArrayOfNumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index badb48793d5..e8b4d951629 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -45,7 +45,7 @@ public class ArrayTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("array_of_string") - public List getArrayOfString() { + @Size(min=0,max=3)public List getArrayOfString() { return arrayOfString; } @@ -80,7 +80,7 @@ public class ArrayTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("array_array_of_integer") - @Valid public List> getArrayArrayOfInteger() { + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -188,7 +188,7 @@ public class ArrayTest implements Serializable { return new ArrayTestBuilderImpl(); } - private static final class ArrayTestBuilderImpl extends ArrayTestBuilder { + private static class ArrayTestBuilderImpl extends ArrayTestBuilder { @Override protected ArrayTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Capitalization.java index b00b8a7b6e7..af7ca0f943b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Capitalization.java @@ -206,7 +206,7 @@ public class Capitalization implements Serializable { return new CapitalizationBuilderImpl(); } - private static final class CapitalizationBuilderImpl extends CapitalizationBuilder { + private static class CapitalizationBuilderImpl extends CapitalizationBuilder { @Override protected CapitalizationBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Cat.java index efa1001e962..d8decd067ea 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Cat.java @@ -93,7 +93,7 @@ public class Cat extends Animal implements Serializable { return new CatBuilderImpl(); } - private static final class CatBuilderImpl extends CatBuilder { + private static class CatBuilderImpl extends CatBuilder { @Override protected CatBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Category.java index af6e6eb7c59..1285eb75eff 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Category.java @@ -113,7 +113,7 @@ public class Category implements Serializable { return new CategoryBuilderImpl(); } - private static final class CategoryBuilderImpl extends CategoryBuilder { + private static class CategoryBuilderImpl extends CategoryBuilder { @Override protected CategoryBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java new file mode 100644 index 00000000000..cbb88c1e4fb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("ChildWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ChildWithNullable extends ParentWithNullable implements Serializable { + private String otherProperty; + + protected ChildWithNullable(ChildWithNullableBuilder b) { + super(b); + this.otherProperty = b.otherProperty; + } + + public ChildWithNullable() { + } + + /** + **/ + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("otherProperty") + public String getOtherProperty() { + return otherProperty; + } + + @JsonProperty("otherProperty") + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ChildWithNullableBuilder builder() { + return new ChildWithNullableBuilderImpl(); + } + + private static class ChildWithNullableBuilderImpl extends ChildWithNullableBuilder { + + @Override + protected ChildWithNullableBuilderImpl self() { + return this; + } + + @Override + public ChildWithNullable build() { + return new ChildWithNullable(this); + } + } + + public static abstract class ChildWithNullableBuilder> extends ParentWithNullableBuilder { + private String otherProperty; + + public B otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ClassModel.java index 2363e65a2d3..596980680fb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ClassModel.java @@ -92,7 +92,7 @@ public class ClassModel implements Serializable { return new ClassModelBuilderImpl(); } - private static final class ClassModelBuilderImpl extends ClassModelBuilder { + private static class ClassModelBuilderImpl extends ClassModelBuilder { @Override protected ClassModelBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Client.java index a4ad39feebe..f6bdcdcd8de 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Client.java @@ -90,7 +90,7 @@ public class Client implements Serializable { return new ClientBuilderImpl(); } - private static final class ClientBuilderImpl extends ClientBuilder { + private static class ClientBuilderImpl extends ClientBuilder { @Override protected ClientBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java new file mode 100644 index 00000000000..2a94d1b7bac --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java @@ -0,0 +1,118 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("DeprecatedObject") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class DeprecatedObject implements Serializable { + private String name; + + protected DeprecatedObject(DeprecatedObjectBuilder b) { + this.name = b.name; + } + + public DeprecatedObject() { + } + + /** + **/ + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("name") + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static DeprecatedObjectBuilder builder() { + return new DeprecatedObjectBuilderImpl(); + } + + private static class DeprecatedObjectBuilderImpl extends DeprecatedObjectBuilder { + + @Override + protected DeprecatedObjectBuilderImpl self() { + return this; + } + + @Override + public DeprecatedObject build() { + return new DeprecatedObject(this); + } + } + + public static abstract class DeprecatedObjectBuilder> { + private String name; + protected abstract B self(); + + public abstract C build(); + + public B name(String name) { + this.name = name; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Dog.java index 90ed29a282a..051bc4f1ef0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Dog.java @@ -93,7 +93,7 @@ public class Dog extends Animal implements Serializable { return new DogBuilderImpl(); } - private static final class DogBuilderImpl extends DogBuilder { + private static class DogBuilderImpl extends DogBuilder { @Override protected DogBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java index 3839c1cbdad..5a86d87e9a5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumArrays.java @@ -226,7 +226,7 @@ public class EnumArrays implements Serializable { return new EnumArraysBuilderImpl(); } - private static final class EnumArraysBuilderImpl extends EnumArraysBuilder { + private static class EnumArraysBuilderImpl extends EnumArraysBuilder { @Override protected EnumArraysBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index 006da54cd04..8cf4df83358 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -3,7 +3,11 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.OuterEnum; +import org.openapitools.model.OuterEnumDefaultValue; +import org.openapitools.model.OuterEnumInteger; +import org.openapitools.model.OuterEnumIntegerDefaultValue; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -213,6 +217,9 @@ public class EnumTest implements Serializable { private EnumNumberEnum enumNumber; private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; protected EnumTest(EnumTestBuilder b) { this.enumString = b.enumString; @@ -220,6 +227,9 @@ public class EnumTest implements Serializable { this.enumInteger = b.enumInteger; this.enumNumber = b.enumNumber; this.outerEnum = b.outerEnum; + this.outerEnumInteger = b.outerEnumInteger; + this.outerEnumDefaultValue = b.outerEnumDefaultValue; + this.outerEnumIntegerDefaultValue = b.outerEnumIntegerDefaultValue; } public EnumTest() { @@ -311,7 +321,7 @@ public class EnumTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("outerEnum") - @Valid public OuterEnum getOuterEnum() { + public OuterEnum getOuterEnum() { return outerEnum; } @@ -320,6 +330,63 @@ public class EnumTest implements Serializable { this.outerEnum = outerEnum; } + /** + **/ + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumInteger") + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + @JsonProperty("outerEnumInteger") + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + /** + **/ + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumDefaultValue") + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + @JsonProperty("outerEnumDefaultValue") + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + /** + **/ + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumIntegerDefaultValue") + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + @JsonProperty("outerEnumIntegerDefaultValue") + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + @Override public boolean equals(Object o) { @@ -334,12 +401,15 @@ public class EnumTest implements Serializable { Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } @Override @@ -352,6 +422,9 @@ public class EnumTest implements Serializable { sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); sb.append("}"); return sb.toString(); } @@ -372,7 +445,7 @@ public class EnumTest implements Serializable { return new EnumTestBuilderImpl(); } - private static final class EnumTestBuilderImpl extends EnumTestBuilder { + private static class EnumTestBuilderImpl extends EnumTestBuilder { @Override protected EnumTestBuilderImpl self() { @@ -391,6 +464,9 @@ public class EnumTest implements Serializable { private EnumIntegerEnum enumInteger; private EnumNumberEnum enumNumber; private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; protected abstract B self(); public abstract C build(); @@ -415,6 +491,18 @@ public class EnumTest implements Serializable { this.outerEnum = outerEnum; return self(); } + public B outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return self(); + } + public B outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return self(); + } + public B outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return self(); + } } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java new file mode 100644 index 00000000000..074891cf018 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,166 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("fakeBigDecimalMap_200_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeBigDecimalMap200Response implements Serializable { + private BigDecimal someId; + private @Valid Map someMap = new HashMap<>(); + + protected FakeBigDecimalMap200Response(FakeBigDecimalMap200ResponseBuilder b) { + this.someId = b.someId; + this.someMap = b.someMap; + } + + public FakeBigDecimalMap200Response() { + } + + /** + **/ + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("someId") + @Valid public BigDecimal getSomeId() { + return someId; + } + + @JsonProperty("someId") + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + **/ + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("someMap") + @Valid public Map getSomeMap() { + return someMap; + } + + @JsonProperty("someMap") + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + + this.someMap.put(key, someMapItem); + return this; + } + + public FakeBigDecimalMap200Response removeSomeMapItem(String key) { + if (this.someMap != null) { + this.someMap.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FakeBigDecimalMap200ResponseBuilder builder() { + return new FakeBigDecimalMap200ResponseBuilderImpl(); + } + + private static class FakeBigDecimalMap200ResponseBuilderImpl extends FakeBigDecimalMap200ResponseBuilder { + + @Override + protected FakeBigDecimalMap200ResponseBuilderImpl self() { + return this; + } + + @Override + public FakeBigDecimalMap200Response build() { + return new FakeBigDecimalMap200Response(this); + } + } + + public static abstract class FakeBigDecimalMap200ResponseBuilder> { + private BigDecimal someId; + private Map someMap = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B someId(BigDecimal someId) { + this.someId = someId; + return self(); + } + public B someMap(Map someMap) { + this.someMap = someMap; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java new file mode 100644 index 00000000000..021b53e6da9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java @@ -0,0 +1,299 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.IntegerEnum; +import org.openapitools.model.StringEnum; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("fake_tests_defaults_default_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FakeTestsDefaultsDefaultResponse implements Serializable { + private StringEnum stringEnum = StringEnum.FOO; + private IntegerEnum integerEnum = IntegerEnum.NUMBER_1; + public enum StringEnumInlineEnum { + + FOO(String.valueOf("foo")), BAR(String.valueOf("bar")), BAZ(String.valueOf("baz")); + + + private String value; + + StringEnumInlineEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StringEnumInlineEnum fromString(String s) { + for (StringEnumInlineEnum b : StringEnumInlineEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StringEnumInlineEnum fromValue(String value) { + for (StringEnumInlineEnum b : StringEnumInlineEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private StringEnumInlineEnum stringEnumInline = StringEnumInlineEnum.FOO; + public enum IntegerEnumInlineEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_2(Integer.valueOf(2)), NUMBER_3(Integer.valueOf(3)); + + + private Integer value; + + IntegerEnumInlineEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static IntegerEnumInlineEnum fromString(String s) { + for (IntegerEnumInlineEnum b : IntegerEnumInlineEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static IntegerEnumInlineEnum fromValue(Integer value) { + for (IntegerEnumInlineEnum b : IntegerEnumInlineEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private IntegerEnumInlineEnum integerEnumInline = IntegerEnumInlineEnum.NUMBER_1; + + protected FakeTestsDefaultsDefaultResponse(FakeTestsDefaultsDefaultResponseBuilder b) { + this.stringEnum = b.stringEnum; + this.integerEnum = b.integerEnum; + this.stringEnumInline = b.stringEnumInline; + this.integerEnumInline = b.integerEnumInline; + } + + public FakeTestsDefaultsDefaultResponse() { + } + + /** + **/ + public FakeTestsDefaultsDefaultResponse stringEnum(StringEnum stringEnum) { + this.stringEnum = stringEnum; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("stringEnum") + public StringEnum getStringEnum() { + return stringEnum; + } + + @JsonProperty("stringEnum") + public void setStringEnum(StringEnum stringEnum) { + this.stringEnum = stringEnum; + } + + /** + **/ + public FakeTestsDefaultsDefaultResponse integerEnum(IntegerEnum integerEnum) { + this.integerEnum = integerEnum; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("integerEnum") + public IntegerEnum getIntegerEnum() { + return integerEnum; + } + + @JsonProperty("integerEnum") + public void setIntegerEnum(IntegerEnum integerEnum) { + this.integerEnum = integerEnum; + } + + /** + **/ + public FakeTestsDefaultsDefaultResponse stringEnumInline(StringEnumInlineEnum stringEnumInline) { + this.stringEnumInline = stringEnumInline; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("stringEnumInline") + public StringEnumInlineEnum getStringEnumInline() { + return stringEnumInline; + } + + @JsonProperty("stringEnumInline") + public void setStringEnumInline(StringEnumInlineEnum stringEnumInline) { + this.stringEnumInline = stringEnumInline; + } + + /** + **/ + public FakeTestsDefaultsDefaultResponse integerEnumInline(IntegerEnumInlineEnum integerEnumInline) { + this.integerEnumInline = integerEnumInline; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("integerEnumInline") + public IntegerEnumInlineEnum getIntegerEnumInline() { + return integerEnumInline; + } + + @JsonProperty("integerEnumInline") + public void setIntegerEnumInline(IntegerEnumInlineEnum integerEnumInline) { + this.integerEnumInline = integerEnumInline; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeTestsDefaultsDefaultResponse fakeTestsDefaultsDefaultResponse = (FakeTestsDefaultsDefaultResponse) o; + return Objects.equals(this.stringEnum, fakeTestsDefaultsDefaultResponse.stringEnum) && + Objects.equals(this.integerEnum, fakeTestsDefaultsDefaultResponse.integerEnum) && + Objects.equals(this.stringEnumInline, fakeTestsDefaultsDefaultResponse.stringEnumInline) && + Objects.equals(this.integerEnumInline, fakeTestsDefaultsDefaultResponse.integerEnumInline); + } + + @Override + public int hashCode() { + return Objects.hash(stringEnum, integerEnum, stringEnumInline, integerEnumInline); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeTestsDefaultsDefaultResponse {\n"); + + sb.append(" stringEnum: ").append(toIndentedString(stringEnum)).append("\n"); + sb.append(" integerEnum: ").append(toIndentedString(integerEnum)).append("\n"); + sb.append(" stringEnumInline: ").append(toIndentedString(stringEnumInline)).append("\n"); + sb.append(" integerEnumInline: ").append(toIndentedString(integerEnumInline)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FakeTestsDefaultsDefaultResponseBuilder builder() { + return new FakeTestsDefaultsDefaultResponseBuilderImpl(); + } + + private static class FakeTestsDefaultsDefaultResponseBuilderImpl extends FakeTestsDefaultsDefaultResponseBuilder { + + @Override + protected FakeTestsDefaultsDefaultResponseBuilderImpl self() { + return this; + } + + @Override + public FakeTestsDefaultsDefaultResponse build() { + return new FakeTestsDefaultsDefaultResponse(this); + } + } + + public static abstract class FakeTestsDefaultsDefaultResponseBuilder> { + private StringEnum stringEnum = StringEnum.FOO; + private IntegerEnum integerEnum = IntegerEnum.NUMBER_1; + private StringEnumInlineEnum stringEnumInline = StringEnumInlineEnum.FOO; + private IntegerEnumInlineEnum integerEnumInline = IntegerEnumInlineEnum.NUMBER_1; + protected abstract B self(); + + public abstract C build(); + + public B stringEnum(StringEnum stringEnum) { + this.stringEnum = stringEnum; + return self(); + } + public B integerEnum(IntegerEnum integerEnum) { + this.integerEnum = integerEnum; + return self(); + } + public B stringEnumInline(StringEnumInlineEnum stringEnumInline) { + this.stringEnumInline = stringEnumInline; + return self(); + } + public B integerEnumInline(IntegerEnumInlineEnum integerEnumInline) { + this.integerEnumInline = integerEnumInline; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index a6a608e652b..62a7769fdf5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -133,7 +133,7 @@ public class FileSchemaTestClass implements Serializable { return new FileSchemaTestClassBuilderImpl(); } - private static final class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { + private static class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder { @Override protected FileSchemaTestClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java new file mode 100644 index 00000000000..500147532d5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java @@ -0,0 +1,118 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("Foo") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class Foo implements Serializable { + private String bar = "bar"; + + protected Foo(FooBuilder b) { + this.bar = b.bar; + } + + public Foo() { + } + + /** + **/ + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + @JsonProperty("bar") + public void setBar(String bar) { + this.bar = bar; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FooBuilder builder() { + return new FooBuilderImpl(); + } + + private static class FooBuilderImpl extends FooBuilder { + + @Override + protected FooBuilderImpl self() { + return this; + } + + @Override + public Foo build() { + return new Foo(this); + } + } + + public static abstract class FooBuilder> { + private String bar = "bar"; + protected abstract B self(); + + public abstract C build(); + + public B bar(String bar) { + this.bar = bar; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..0a00ba0d7ef --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java @@ -0,0 +1,120 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Foo; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("_foo_get_default_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class FooGetDefaultResponse implements Serializable { + private Foo string; + + protected FooGetDefaultResponse(FooGetDefaultResponseBuilder b) { + this.string = b.string; + } + + public FooGetDefaultResponse() { + } + + /** + **/ + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("string") + @Valid public Foo getString() { + return string; + } + + @JsonProperty("string") + public void setString(Foo string) { + this.string = string; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static FooGetDefaultResponseBuilder builder() { + return new FooGetDefaultResponseBuilderImpl(); + } + + private static class FooGetDefaultResponseBuilderImpl extends FooGetDefaultResponseBuilder { + + @Override + protected FooGetDefaultResponseBuilderImpl self() { + return this; + } + + @Override + public FooGetDefaultResponse build() { + return new FooGetDefaultResponse(this); + } + } + + public static abstract class FooGetDefaultResponseBuilder> { + private Foo string; + protected abstract B self(); + + public abstract C build(); + + public B string(Foo string) { + this.string = string; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java index a13f1558ea6..4fe2fbb1c80 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java @@ -31,6 +31,7 @@ public class FormatTest implements Serializable { private BigDecimal number; private Float _float; private Double _double; + private BigDecimal decimal; private String string; private byte[] _byte; private File binary; @@ -38,7 +39,8 @@ public class FormatTest implements Serializable { private Date dateTime; private UUID uuid; private String password; - private BigDecimal bigDecimal; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; protected FormatTest(FormatTestBuilder b) { this.integer = b.integer; @@ -47,6 +49,7 @@ public class FormatTest implements Serializable { this.number = b.number; this._float = b._float; this._double = b._double; + this.decimal = b.decimal; this.string = b.string; this._byte = b._byte; this.binary = b.binary; @@ -54,7 +57,8 @@ public class FormatTest implements Serializable { this.dateTime = b.dateTime; this.uuid = b.uuid; this.password = b.password; - this.bigDecimal = b.bigDecimal; + this.patternWithDigits = b.patternWithDigits; + this.patternWithDigitsAndDelimiter = b.patternWithDigitsAndDelimiter; } public FormatTest() { @@ -184,6 +188,25 @@ public class FormatTest implements Serializable { this._double = _double; } + /** + **/ + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("decimal") + @Valid public BigDecimal getDecimal() { + return decimal; + } + + @JsonProperty("decimal") + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + /** **/ public FormatTest string(String string) { @@ -213,7 +236,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("byte") - @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")public byte[] getByte() { + @NotNull public byte[] getByte() { return _byte; } @@ -232,7 +255,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("binary") - @Valid public File getBinary() { + public File getBinary() { return binary; } @@ -251,7 +274,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(required = true, value = "") @JsonProperty("date") - @NotNull @Valid public LocalDate getDate() { + @NotNull public LocalDate getDate() { return date; } @@ -270,7 +293,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -289,7 +312,7 @@ public class FormatTest implements Serializable { @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -318,22 +341,43 @@ public class FormatTest implements Serializable { } /** + * A string that is a 10 digit number. Can have leading zeros. **/ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; return this; } - @ApiModelProperty(value = "") - @JsonProperty("BigDecimal") - @Valid public BigDecimal getBigDecimal() { - return bigDecimal; + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty("pattern_with_digits") + @Pattern(regexp="^\\d{10}$")public String getPatternWithDigits() { + return patternWithDigits; } - @JsonProperty("BigDecimal") - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + @JsonProperty("pattern_with_digits") + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty("pattern_with_digits_and_delimiter") + @Pattern(regexp="/^image_\\d{1,3}$/i")public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + @JsonProperty("pattern_with_digits_and_delimiter") + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } @@ -352,6 +396,7 @@ public class FormatTest implements Serializable { Objects.equals(this.number, formatTest.number) && Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && @@ -359,12 +404,13 @@ public class FormatTest implements Serializable { Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } @Override @@ -378,6 +424,7 @@ public class FormatTest implements Serializable { sb.append(" number: ").append(toIndentedString(number)).append("\n"); sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); sb.append(" string: ").append(toIndentedString(string)).append("\n"); sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); @@ -385,7 +432,8 @@ public class FormatTest implements Serializable { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append("*").append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); sb.append("}"); return sb.toString(); } @@ -406,7 +454,7 @@ public class FormatTest implements Serializable { return new FormatTestBuilderImpl(); } - private static final class FormatTestBuilderImpl extends FormatTestBuilder { + private static class FormatTestBuilderImpl extends FormatTestBuilder { @Override protected FormatTestBuilderImpl self() { @@ -426,6 +474,7 @@ public class FormatTest implements Serializable { private BigDecimal number; private Float _float; private Double _double; + private BigDecimal decimal; private String string; private byte[] _byte; private File binary; @@ -433,7 +482,8 @@ public class FormatTest implements Serializable { private Date dateTime; private UUID uuid; private String password; - private BigDecimal bigDecimal; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; protected abstract B self(); public abstract C build(); @@ -462,6 +512,10 @@ public class FormatTest implements Serializable { this._double = _double; return self(); } + public B decimal(BigDecimal decimal) { + this.decimal = decimal; + return self(); + } public B string(String string) { this.string = string; return self(); @@ -490,8 +544,12 @@ public class FormatTest implements Serializable { this.password = password; return self(); } - public B bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + public B patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return self(); + } + public B patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; return self(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 3d7dcccef18..e3ca271fa0c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -114,7 +114,7 @@ public class HasOnlyReadOnly implements Serializable { return new HasOnlyReadOnlyBuilderImpl(); } - private static final class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { + private static class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder { @Override protected HasOnlyReadOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HealthCheckResult.java new file mode 100644 index 00000000000..69e84392730 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HealthCheckResult.java @@ -0,0 +1,121 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ +@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonTypeName("HealthCheckResult") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class HealthCheckResult implements Serializable { + private String nullableMessage; + + protected HealthCheckResult(HealthCheckResultBuilder b) { + this.nullableMessage = b.nullableMessage; + } + + public HealthCheckResult() { + } + + /** + **/ + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("NullableMessage") + public String getNullableMessage() { + return nullableMessage; + } + + @JsonProperty("NullableMessage") + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HealthCheckResultBuilder builder() { + return new HealthCheckResultBuilderImpl(); + } + + private static class HealthCheckResultBuilderImpl extends HealthCheckResultBuilder { + + @Override + protected HealthCheckResultBuilderImpl self() { + return this; + } + + @Override + public HealthCheckResult build() { + return new HealthCheckResult(this); + } + } + + public static abstract class HealthCheckResultBuilder> { + private String nullableMessage; + protected abstract B self(); + + public abstract C build(); + + public B nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/IntegerEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/IntegerEnum.java new file mode 100644 index 00000000000..01c18bf99ad --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/IntegerEnum.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets IntegerEnum + */ +public enum IntegerEnum { + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3); + + private Integer value; + + IntegerEnum(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static IntegerEnum fromString(String s) { + for (IntegerEnum b : IntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IntegerEnum fromValue(Integer value) { + for (IntegerEnum b : IntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java index 00d11967c30..77143c03bf6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MapTest.java @@ -92,7 +92,7 @@ public class MapTest implements Serializable { @ApiModelProperty(value = "") @JsonProperty("map_map_of_string") - @Valid public Map> getMapMapOfString() { + public Map> getMapMapOfString() { return mapMapOfString; } @@ -110,9 +110,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapMapOfStringItem(Map mapMapOfStringItem) { - if (mapMapOfStringItem != null && this.mapMapOfString != null) { - this.mapMapOfString.remove(mapMapOfStringItem); + public MapTest removeMapMapOfStringItem(String key) { + if (this.mapMapOfString != null) { + this.mapMapOfString.remove(key); } return this; @@ -145,9 +145,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeMapOfEnumStringItem(InnerEnum mapOfEnumStringItem) { - if (mapOfEnumStringItem != null && this.mapOfEnumString != null) { - this.mapOfEnumString.remove(mapOfEnumStringItem); + public MapTest removeMapOfEnumStringItem(String key) { + if (this.mapOfEnumString != null) { + this.mapOfEnumString.remove(key); } return this; @@ -180,9 +180,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeDirectMapItem(Boolean directMapItem) { - if (directMapItem != null && this.directMap != null) { - this.directMap.remove(directMapItem); + public MapTest removeDirectMapItem(String key) { + if (this.directMap != null) { + this.directMap.remove(key); } return this; @@ -215,9 +215,9 @@ public class MapTest implements Serializable { return this; } - public MapTest removeIndirectMapItem(Boolean indirectMapItem) { - if (indirectMapItem != null && this.indirectMap != null) { - this.indirectMap.remove(indirectMapItem); + public MapTest removeIndirectMapItem(String key) { + if (this.indirectMap != null) { + this.indirectMap.remove(key); } return this; @@ -272,7 +272,7 @@ public class MapTest implements Serializable { return new MapTestBuilderImpl(); } - private static final class MapTestBuilderImpl extends MapTestBuilder { + private static class MapTestBuilderImpl extends MapTestBuilder { @Override protected MapTestBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bed460765d2..4cbfb55af69 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -46,7 +46,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("uuid") - @Valid public UUID getUuid() { + public UUID getUuid() { return uuid; } @@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl @ApiModelProperty(value = "") @JsonProperty("dateTime") - @Valid public Date getDateTime() { + public Date getDateTime() { return dateTime; } @@ -102,9 +102,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return this; } - public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(Animal mapItem) { - if (mapItem != null && this.map != null) { - this.map.remove(mapItem); + public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) { + if (this.map != null) { + this.map.remove(key); } return this; @@ -157,7 +157,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl(); } - private static final class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { + private static class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder { @Override protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java index 644183f099b..411e92d97f8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Model200Response.java @@ -116,7 +116,7 @@ public class Model200Response implements Serializable { return new Model200ResponseBuilderImpl(); } - private static final class Model200ResponseBuilderImpl extends Model200ResponseBuilder { + private static class Model200ResponseBuilderImpl extends Model200ResponseBuilder { @Override protected Model200ResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java index a4a95902880..572761f2864 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -137,7 +137,7 @@ public class ModelApiResponse implements Serializable { return new ModelApiResponseBuilderImpl(); } - private static final class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { + private static class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder { @Override protected ModelApiResponseBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java index 9da42286241..4597f43aeda 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelFile.java @@ -94,7 +94,7 @@ public class ModelFile implements Serializable { return new ModelFileBuilderImpl(); } - private static final class ModelFileBuilderImpl extends ModelFileBuilder { + private static class ModelFileBuilderImpl extends ModelFileBuilder { @Override protected ModelFileBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java index 36a64916c92..67c9616a2e8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelList.java @@ -91,7 +91,7 @@ public class ModelList implements Serializable { return new ModelListBuilderImpl(); } - private static final class ModelListBuilderImpl extends ModelListBuilder { + private static class ModelListBuilderImpl extends ModelListBuilder { @Override protected ModelListBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java index 4177177d94a..abaa5a15dd6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ModelReturn.java @@ -93,7 +93,7 @@ public class ModelReturn implements Serializable { return new ModelReturnBuilderImpl(); } - private static final class ModelReturnBuilderImpl extends ModelReturnBuilder { + private static class ModelReturnBuilderImpl extends ModelReturnBuilder { @Override protected ModelReturnBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Name.java index cadf9d33d07..2f1dea64827 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Name.java @@ -161,7 +161,7 @@ public class Name implements Serializable { return new NameBuilderImpl(); } - private static final class NameBuilderImpl extends NameBuilder { + private static class NameBuilderImpl extends NameBuilder { @Override protected NameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java new file mode 100644 index 00000000000..080eaf039e9 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java @@ -0,0 +1,431 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.joda.time.LocalDate; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("NullableClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class NullableClass extends HashMap implements Serializable { + private Integer integerProp; + private BigDecimal numberProp; + private Boolean booleanProp; + private String stringProp; + private LocalDate dateProp; + private Date datetimeProp; + private @Valid List arrayNullableProp; + private @Valid List arrayAndItemsNullableProp; + private @Valid List arrayItemsNullable = new ArrayList<>(); + private @Valid Map objectNullableProp; + private @Valid Map objectAndItemsNullableProp; + private @Valid Map objectItemsNullable = new HashMap<>(); + + /** + **/ + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("integer_prop") + public Integer getIntegerProp() { + return integerProp; + } + + @JsonProperty("integer_prop") + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + /** + **/ + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("number_prop") + @Valid public BigDecimal getNumberProp() { + return numberProp; + } + + @JsonProperty("number_prop") + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + /** + **/ + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("boolean_prop") + public Boolean getBooleanProp() { + return booleanProp; + } + + @JsonProperty("boolean_prop") + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + /** + **/ + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("string_prop") + public String getStringProp() { + return stringProp; + } + + @JsonProperty("string_prop") + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + /** + **/ + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("date_prop") + public LocalDate getDateProp() { + return dateProp; + } + + @JsonProperty("date_prop") + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + /** + **/ + public NullableClass datetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("datetime_prop") + public Date getDatetimeProp() { + return datetimeProp; + } + + @JsonProperty("datetime_prop") + public void setDatetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + } + + /** + **/ + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_nullable_prop") + public List getArrayNullableProp() { + return arrayNullableProp; + } + + @JsonProperty("array_nullable_prop") + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + public NullableClass removeArrayNullablePropItem(Object arrayNullablePropItem) { + if (arrayNullablePropItem != null && this.arrayNullableProp != null) { + this.arrayNullableProp.remove(arrayNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_and_items_nullable_prop") + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + @JsonProperty("array_and_items_nullable_prop") + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + public NullableClass removeArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (arrayAndItemsNullablePropItem != null && this.arrayAndItemsNullableProp != null) { + this.arrayAndItemsNullableProp.remove(arrayAndItemsNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_items_nullable") + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + @JsonProperty("array_items_nullable") + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + public NullableClass removeArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (arrayItemsNullableItem != null && this.arrayItemsNullable != null) { + this.arrayItemsNullable.remove(arrayItemsNullableItem); + } + + return this; + } + /** + **/ + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_nullable_prop") + public Map getObjectNullableProp() { + return objectNullableProp; + } + + @JsonProperty("object_nullable_prop") + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + public NullableClass removeObjectNullablePropItem(String key) { + if (this.objectNullableProp != null) { + this.objectNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_and_items_nullable_prop") + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + @JsonProperty("object_and_items_nullable_prop") + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + public NullableClass removeObjectAndItemsNullablePropItem(String key) { + if (this.objectAndItemsNullableProp != null) { + this.objectAndItemsNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_items_nullable") + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + @JsonProperty("object_items_nullable") + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + public NullableClass removeObjectItemsNullableItem(String key) { + if (this.objectItemsNullable != null) { + this.objectItemsNullable.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NumberOnly.java index d240989d8ca..09b41c07baf 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NumberOnly.java @@ -91,7 +91,7 @@ public class NumberOnly implements Serializable { return new NumberOnlyBuilderImpl(); } - private static final class NumberOnlyBuilderImpl extends NumberOnlyBuilder { + private static class NumberOnlyBuilderImpl extends NumberOnlyBuilder { @Override protected NumberOnlyBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..d8d13baabe3 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,223 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.DeprecatedObject; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("ObjectWithDeprecatedFields") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ObjectWithDeprecatedFields implements Serializable { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private @Valid List bars = new ArrayList<>(); + + protected ObjectWithDeprecatedFields(ObjectWithDeprecatedFieldsBuilder b) { + this.uuid = b.uuid; + this.id = b.id; + this.deprecatedRef = b.deprecatedRef; + this.bars = b.bars; + } + + public ObjectWithDeprecatedFields() { + } + + /** + **/ + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("uuid") + public String getUuid() { + return uuid; + } + + @JsonProperty("uuid") + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + **/ + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("id") + @Valid public BigDecimal getId() { + return id; + } + + @JsonProperty("id") + public void setId(BigDecimal id) { + this.id = id; + } + + /** + **/ + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("deprecatedRef") + @Valid public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + @JsonProperty("deprecatedRef") + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + /** + **/ + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("bars") + public List getBars() { + return bars; + } + + @JsonProperty("bars") + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + + this.bars.add(barsItem); + return this; + } + + public ObjectWithDeprecatedFields removeBarsItem(String barsItem) { + if (barsItem != null && this.bars != null) { + this.bars.remove(barsItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ObjectWithDeprecatedFieldsBuilder builder() { + return new ObjectWithDeprecatedFieldsBuilderImpl(); + } + + private static class ObjectWithDeprecatedFieldsBuilderImpl extends ObjectWithDeprecatedFieldsBuilder { + + @Override + protected ObjectWithDeprecatedFieldsBuilderImpl self() { + return this; + } + + @Override + public ObjectWithDeprecatedFields build() { + return new ObjectWithDeprecatedFields(this); + } + } + + public static abstract class ObjectWithDeprecatedFieldsBuilder> { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private List bars = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B uuid(String uuid) { + this.uuid = uuid; + return self(); + } + public B id(BigDecimal id) { + this.id = id; + return self(); + } + public B deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return self(); + } + public B bars(List bars) { + this.bars = bars; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java index bc2745576a5..2f3de0ece99 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Order.java @@ -152,7 +152,7 @@ public class Order implements Serializable { @ApiModelProperty(value = "") @JsonProperty("shipDate") - @Valid public Date getShipDate() { + public Date getShipDate() { return shipDate; } @@ -254,7 +254,7 @@ public class Order implements Serializable { return new OrderBuilderImpl(); } - private static final class OrderBuilderImpl extends OrderBuilder { + private static class OrderBuilderImpl extends OrderBuilder { @Override protected OrderBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java index f75e8b5d9a4..f35535da729 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterComposite.java @@ -137,7 +137,7 @@ public class OuterComposite implements Serializable { return new OuterCompositeBuilderImpl(); } - private static final class OuterCompositeBuilderImpl extends OuterCompositeBuilder { + private static class OuterCompositeBuilderImpl extends OuterCompositeBuilder { @Override protected OuterCompositeBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java index a4780a6f690..5f86922395d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java @@ -36,7 +36,7 @@ public enum OuterEnum { return b; } } - throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + return null; } @Override @@ -52,7 +52,7 @@ public enum OuterEnum { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..f9fd44c8deb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumDefaultValue fromString(String s) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java new file mode 100644 index 00000000000..a81c0a77beb --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumInteger fromString(String s) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..3f16a4d4e45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumIntegerDefaultValue fromString(String s) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..94ea53648ce --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.OuterEnumInteger; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("OuterObjectWithEnumProperty") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class OuterObjectWithEnumProperty implements Serializable { + private OuterEnumInteger value; + + protected OuterObjectWithEnumProperty(OuterObjectWithEnumPropertyBuilder b) { + this.value = b.value; + } + + public OuterObjectWithEnumProperty() { + } + + /** + **/ + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("value") + @NotNull public OuterEnumInteger getValue() { + return value; + } + + @JsonProperty("value") + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static OuterObjectWithEnumPropertyBuilder builder() { + return new OuterObjectWithEnumPropertyBuilderImpl(); + } + + private static class OuterObjectWithEnumPropertyBuilderImpl extends OuterObjectWithEnumPropertyBuilder { + + @Override + protected OuterObjectWithEnumPropertyBuilderImpl self() { + return this; + } + + @Override + public OuterObjectWithEnumProperty build() { + return new OuterObjectWithEnumProperty(this); + } + } + + public static abstract class OuterObjectWithEnumPropertyBuilder> { + private OuterEnumInteger value; + protected abstract B self(); + + public abstract C build(); + + public B value(OuterEnumInteger value) { + this.value = value; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java new file mode 100644 index 00000000000..4911a87eb78 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java @@ -0,0 +1,201 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + + +@JsonTypeName("ParentWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class ParentWithNullable implements Serializable { + public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + + private String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static TypeEnum fromString(String s) { + for (TypeEnum b : TypeEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private TypeEnum type; + private String nullableProperty; + + protected ParentWithNullable(ParentWithNullableBuilder b) { + this.type = b.type; + this.nullableProperty = b.nullableProperty; + } + + public ParentWithNullable() { + } + + /** + **/ + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + @JsonProperty("type") + public void setType(TypeEnum type) { + this.type = type; + } + + /** + **/ + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("nullableProperty") + public String getNullableProperty() { + return nullableProperty; + } + + @JsonProperty("nullableProperty") + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + Objects.equals(this.nullableProperty, parentWithNullable.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash(type, nullableProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static ParentWithNullableBuilder builder() { + return new ParentWithNullableBuilderImpl(); + } + + private static class ParentWithNullableBuilderImpl extends ParentWithNullableBuilder { + + @Override + protected ParentWithNullableBuilderImpl self() { + return this; + } + + @Override + public ParentWithNullable build() { + return new ParentWithNullable(this); + } + } + + public static abstract class ParentWithNullableBuilder> { + private TypeEnum type; + private String nullableProperty; + protected abstract B self(); + + public abstract C build(); + + public B type(TypeEnum type) { + this.type = type; + return self(); + } + public B nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 766021b9fb4..360b1fbc218 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -294,7 +294,7 @@ public class Pet implements Serializable { return new PetBuilderImpl(); } - private static final class PetBuilderImpl extends PetBuilder { + private static class PetBuilderImpl extends PetBuilder { @Override protected PetBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 32d770f411e..f1cc43eb007 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -113,7 +113,7 @@ public class ReadOnlyFirst implements Serializable { return new ReadOnlyFirstBuilderImpl(); } - private static final class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { + private static class ReadOnlyFirstBuilderImpl extends ReadOnlyFirstBuilder { @Override protected ReadOnlyFirstBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java new file mode 100644 index 00000000000..3314a0f57b4 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static SingleRefType fromString(String s) { + for (SingleRefType b : SingleRefType.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java index 13b37c03f61..251cf39003f 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") public class SpecialModelName implements Serializable { private Long $specialPropertyName; @@ -56,8 +56,8 @@ public class SpecialModelName implements Serializable { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override @@ -91,7 +91,7 @@ public class SpecialModelName implements Serializable { return new SpecialModelNameBuilderImpl(); } - private static final class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { + private static class SpecialModelNameBuilderImpl extends SpecialModelNameBuilder { @Override protected SpecialModelNameBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringEnum.java new file mode 100644 index 00000000000..4e37a7e483b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/StringEnum.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets StringEnum + */ +public enum StringEnum { + + FOO("foo"), + + BAR("bar"), + + BAZ("baz"); + + private String value; + + StringEnum(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StringEnum fromString(String s) { + for (StringEnum b : StringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StringEnum fromValue(String value) { + for (StringEnum b : StringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Tag.java index 4741d62a2b1..b4f3cc7c4db 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Tag.java @@ -113,7 +113,7 @@ public class Tag implements Serializable { return new TagBuilderImpl(); } - private static final class TagBuilderImpl extends TagBuilder { + private static class TagBuilderImpl extends TagBuilder { @Override protected TagBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 00000000000..8558956e022 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 8.0.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap implements Serializable { + private String someProperty; + + /** + **/ + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("someProperty") + public String getSomeProperty() { + return someProperty; + } + + @JsonProperty("someProperty") + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/User.java index 054d1f487ab..10000099c3b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/User.java @@ -252,7 +252,7 @@ public class User implements Serializable { return new UserBuilderImpl(); } - private static final class UserBuilderImpl extends UserBuilder { + private static class UserBuilderImpl extends UserBuilder { @Override protected UserBuilderImpl self() { diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 6415519aac2..ec445c1aac9 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: description: "This spec is mainly for testing Petstore server and contains fake\ \ endpoints, models. Please do not use this for any other purpose. Special characters:\ @@ -9,7 +9,30 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible tags: - description: Everything about your Pets name: pet @@ -18,25 +41,27 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json /pet: post: + description: "" operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} - description: successful operation + description: Successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,36 +70,24 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json x-tags: - tag: pet put: + description: "" operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: "200": - content: {} - description: successful operation + description: Successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -83,18 +96,37 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body + x-webclient-blocking: true x-content-type: application/json x-accepts: - application/json x-tags: - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus parameters: - - description: Status values that need to be considered for filter + - deprecated: true + description: Status values that need to be considered for filter explode: false in: query name: status @@ -124,7 +156,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -133,6 +164,7 @@ paths: summary: Finds Pets by status tags: - pet + x-webclient-blocking: true x-accepts: - application/json - application/xml @@ -173,7 +205,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -182,6 +213,7 @@ paths: summary: Finds Pets by tags tags: - pet + x-webclient-blocking: true x-accepts: - application/json - application/xml @@ -189,25 +221,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": - content: {} - description: successful operation + description: Successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -225,12 +261,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -242,39 +280,42 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] summary: Find pet by ID tags: - pet + x-webclient-blocking: true x-accepts: - application/json - application/xml x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/updatePetWithForm_request' responses: + "200": + description: Successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -290,15 +331,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -342,16 +386,18 @@ paths: summary: Returns pet inventories by status tags: - store + x-webclient-blocking: false x-accepts: - application/json x-tags: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -367,13 +413,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - application/json - application/xml @@ -386,17 +430,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -411,6 +455,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -419,6 +464,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -430,10 +476,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -449,90 +493,77 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - application/json x-tags: - tag: user /user/createWithArray: post: + description: "" operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - application/json x-tags: - tag: user /user/createWithList: post: + description: "" operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -546,16 +577,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -567,10 +601,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -585,17 +619,17 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -605,14 +639,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -624,10 +661,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -642,30 +677,29 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - application/json x-tags: @@ -675,12 +709,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -693,7 +722,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json @@ -705,44 +733,60 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Something wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake @@ -759,6 +803,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -769,8 +814,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -778,10 +825,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -792,8 +841,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -801,24 +852,40 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form requestBody: content: application/x-www-form-urlencoded: @@ -826,10 +893,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -843,12 +908,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -859,39 +919,35 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json x-tags: - tag: fake post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-content-type: application/x-www-form-urlencoded @@ -905,11 +961,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -919,8 +974,32 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json x-accepts: - '*/*' x-tags: @@ -931,11 +1010,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -945,8 +1023,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - '*/*' x-tags: @@ -957,11 +1034,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -971,8 +1047,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: - '*/*' x-tags: @@ -983,11 +1058,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -997,24 +1071,40 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake x-accepts: - '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -1024,8 +1114,53 @@ paths: - application/json x-tags: - tag: fake + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1038,12 +1173,54 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake x-content-type: application/json x-accepts: - application/json @@ -1053,11 +1230,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1066,74 +1245,20 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json x-tags: - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-content-type: application/xml - x-accepts: - - application/json - x-tags: - - tag: fake /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags - parameters: - - description: to test uuid example value - in: header - name: uuid_test - required: true - schema: - format: uuid - type: string requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1144,7 +1269,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json @@ -1152,7 +1276,7 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: "For this test, the body for this request much reference a schema\ + description: "For this test, the body for this request must reference a schema\ \ named `File`." operationId: testBodyWithFileSchema requestBody: @@ -1163,16 +1287,37 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: - application/json x-tags: - tag: fake + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + x-tags: + - tag: fake /fake/test-query-parameters: put: description: To test the collection format in query parameters @@ -1186,15 +1331,18 @@ paths: items: type: string type: array - style: form - - in: query + style: pipeDelimited + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1220,9 +1368,26 @@ paths: type: string type: array style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": - content: {} description: Success tags: - fake @@ -1232,21 +1397,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1266,8 +1433,114 @@ paths: - application/json x-tags: - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/tests/defaults: + get: + operationId: fake-tests-defaults + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/fake_tests_defaults_default_response' + description: response + summary: test enum default in request body + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 @@ -1433,21 +1706,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1467,7 +1731,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1478,7 +1741,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1486,7 +1748,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1501,20 +1762,11 @@ components: declawed: type: boolean type: object - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: @@ -1557,12 +1809,14 @@ components: maximum: 123.4 minimum: 67.8 type: number + decimal: + format: number + type: string string: pattern: "/[a-z]/i" type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1582,8 +1836,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1626,117 +1886,27 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object MixedPropertiesAndAdditionalPropertiesClass: properties: @@ -1826,6 +1996,8 @@ components: array_of_string: items: type: string + maxItems: 3 + minItems: 0 type: array array_array_of_integer: items: @@ -1877,12 +2049,43 @@ components: type: string type: array type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: enum: - placed - approved - delivered + nullable: true type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1904,6 +2107,29 @@ components: OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable StringBooleanMap: additionalProperties: type: boolean @@ -1932,243 +2158,147 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object xml: - namespace: http://a.com/schema - prefix: pre + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + StringEnum: + default: foo + enum: + - foo + - bar + - baz + type: string + IntegerEnum: + default: 1 + enum: + - 1 + - 2 + - 3 + type: integer + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object updatePetWithForm_request: properties: name: @@ -2212,7 +2342,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2281,6 +2410,19 @@ components: - number - pattern_without_delimiter type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object testJsonFormData_request: properties: param: @@ -2293,6 +2435,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2305,6 +2453,32 @@ components: required: - requiredFile type: object + fake_tests_defaults_default_response: + example: + stringEnum: foo + integerEnum: 0 + stringEnumInline: foo + integerEnumInline: 6 + properties: + stringEnum: + $ref: '#/components/schemas/StringEnum' + integerEnum: + $ref: '#/components/schemas/IntegerEnum' + stringEnumInline: + default: foo + enum: + - foo + - bar + - baz + type: string + integerEnumInline: + default: 1 + enum: + - 1 + - 2 + - 3 + type: integer + type: object securitySchemes: petstore_auth: flows: @@ -2325,4 +2499,10 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 00387e37108..dd7eadbf821 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public class AnotherFakeApi { String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + delegate = (AnotherFakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 97d136c3615..0834d2cc77b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -48,7 +48,7 @@ public class FakeApi { String implClass = servletContext.getInitParameter("FakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeApiService) Class.forName(implClass).newInstance(); + delegate = (FakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -183,7 +183,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) + public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } @@ -207,7 +207,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) + public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } @@ -231,7 +231,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java index 87831b49301..1c8947c0fe4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -40,7 +40,7 @@ public class FakeClassnameTags123Api { String implClass = servletContext.getInitParameter("FakeClassnameTags123Api.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeClassnameTags123ApiService) Class.forName(implClass).newInstance(); + delegate = (FakeClassnameTags123ApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index 79ee38e8b29..b87f2d043a4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -43,7 +43,7 @@ public class PetApi { String implClass = servletContext.getInitParameter("PetApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (PetApiService) Class.forName(implClass).newInstance(); + delegate = (PetApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -107,7 +107,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } @@ -125,7 +125,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java index 18b99595a80..82213fbd1ac 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/StoreApi.java @@ -41,7 +41,7 @@ public class StoreApi { String implClass = servletContext.getInitParameter("StoreApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (StoreApiService) Class.forName(implClass).newInstance(); + delegate = (StoreApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java index 629d416b233..ff57b277afe 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -41,7 +41,7 @@ public class UserApi { String implClass = servletContext.getInitParameter("UserApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (UserApiService) Class.forName(implClass).newInstance(); + delegate = (UserApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index d3277405f2c..21a935e0291 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -219,7 +219,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_array_integer") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -247,7 +247,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_array_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -275,7 +275,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_map_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapString() { return mapMapString; } @@ -303,7 +303,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_map_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapAnytype() { return mapMapAnytype; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index d87046f15e1..70cee48022e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -95,7 +95,7 @@ public class ArrayTest { **/ @JsonProperty(value = "array_array_of_integer") @ApiModelProperty(value = "") - @Valid + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index c07a1b383da..fbef2a7f547 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -276,7 +276,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnum") @ApiModelProperty(value = "") - @Valid + public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index 6964f05371b..4894c8722a5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -102,7 +102,7 @@ public class MapTest { **/ @JsonProperty(value = "map_map_of_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java index c7836faf3cd..d7f95098d63 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public class AnotherFakeApi { String implClass = servletContext.getInitParameter("AnotherFakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (AnotherFakeApiService) Class.forName(implClass).newInstance(); + delegate = (AnotherFakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 6cde1f9eae7..30d9c56f16e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -49,7 +49,7 @@ public class FakeApi { String implClass = servletContext.getInitParameter("FakeApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeApiService) Class.forName(implClass).newInstance(); + delegate = (FakeApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -184,7 +184,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) + public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); } @@ -208,7 +208,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) + public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); } @@ -232,7 +232,7 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 3e1fd94e7e6..659d776ecea 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -40,7 +40,7 @@ public class FakeClassnameTestApi { String implClass = servletContext.getInitParameter("FakeClassnameTestApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (FakeClassnameTestApiService) Class.forName(implClass).newInstance(); + delegate = (FakeClassnameTestApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index 8ad2cebe734..96415372be1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -43,7 +43,7 @@ public class PetApi { String implClass = servletContext.getInitParameter("PetApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (PetApiService) Class.forName(implClass).newInstance(); + delegate = (PetApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } @@ -107,7 +107,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) - public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) + public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } @@ -125,7 +125,7 @@ public class PetApi { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java index 2bce0668e5d..e0a14f67035 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/StoreApi.java @@ -41,7 +41,7 @@ public class StoreApi { String implClass = servletContext.getInitParameter("StoreApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (StoreApiService) Class.forName(implClass).newInstance(); + delegate = (StoreApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java index d600fc5a882..4ec98afc566 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java @@ -41,7 +41,7 @@ public class UserApi { String implClass = servletContext.getInitParameter("UserApi.implementation"); if (implClass != null && !"".equals(implClass.trim())) { try { - delegate = (UserApiService) Class.forName(implClass).newInstance(); + delegate = (UserApiService) Class.forName(implClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index d3277405f2c..21a935e0291 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -219,7 +219,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_array_integer") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -247,7 +247,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_array_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -275,7 +275,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_map_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapString() { return mapMapString; } @@ -303,7 +303,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_map_anytype") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapAnytype() { return mapMapAnytype; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java index d87046f15e1..70cee48022e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java @@ -95,7 +95,7 @@ public class ArrayTest { **/ @JsonProperty(value = "array_array_of_integer") @ApiModelProperty(value = "") - @Valid + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index c07a1b383da..fbef2a7f547 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -276,7 +276,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnum") @ApiModelProperty(value = "") - @Valid + public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index 6964f05371b..4894c8722a5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -102,7 +102,7 @@ public class MapTest { **/ @JsonProperty(value = "map_map_of_string") @ApiModelProperty(value = "") - @Valid + public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java index 9381550d89a..f516d0bebfc 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/FakeApi.java @@ -185,7 +185,7 @@ public class FakeApi { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ "fake", }) - public Response testAdditionalPropertiesReference(@Schema(description = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testAdditionalPropertiesReference(@Schema(description = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testAdditionalPropertiesReference(requestBody, securityContext); } @@ -261,7 +261,7 @@ public class FakeApi { @ApiResponse(responseCode = "404", description = "Not found", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ "fake", }) - public Response testEnumParameters(@Schema(description = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@Schema(description = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@Schema(description = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@Schema(description = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@Schema(description = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@Schema(description = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@Schema(description = "") @QueryParam("enum_query_model_array") @Valid List enumQueryModelArray,@Schema(description = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @QueryParam("enum_form_string_array") List enumFormStringArray,@Schema(description = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) + public Response testEnumParameters(@Schema(description = "Header parameter enum test (string array)" , allowableValues=">, $")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@Schema(description = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@Schema(description = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") List enumQueryStringArray,@Schema(description = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@Schema(description = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@Schema(description = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@Schema(description = "") @QueryParam("enum_query_model_array") List enumQueryModelArray,@Schema(description = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @QueryParam("enum_form_string_array") List enumFormStringArray,@Schema(description = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @QueryParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, securityContext); } @@ -285,7 +285,7 @@ public class FakeApi { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ "fake", }) - public Response testInlineAdditionalProperties(@Schema(description = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testInlineAdditionalProperties(@Schema(description = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(requestBody, securityContext); } @@ -332,7 +332,7 @@ public class FakeApi { @ApiResponse(responseCode = "200", description = "Success", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ "fake", }) - public Response testQueryParameterCollectionFormat(@Schema(description = "") @QueryParam("pipe") @NotNull @Valid List pipe,@Schema(description = "") @QueryParam("ioutil") @NotNull @Valid List ioutil,@Schema(description = "") @QueryParam("http") @NotNull @Valid List http,@Schema(description = "") @QueryParam("url") @NotNull @Valid List url,@Schema(description = "") @QueryParam("context") @NotNull @Valid List context,@Schema(description = "") @QueryParam("allowEmpty") @NotNull String allowEmpty,@Schema(description = "") @Parameter(description="language") @Valid Map language,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@Schema(description = "") @QueryParam("pipe") @NotNull List pipe,@Schema(description = "") @QueryParam("ioutil") @NotNull List ioutil,@Schema(description = "") @QueryParam("http") @NotNull List http,@Schema(description = "") @QueryParam("url") @NotNull List url,@Schema(description = "") @QueryParam("context") @NotNull List context,@Schema(description = "") @QueryParam("allowEmpty") @NotNull String allowEmpty,@Schema(description = "") @Parameter(description="language") Map language,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } @@ -344,7 +344,7 @@ public class FakeApi { @ApiResponse(responseCode = "200", description = "successful operation", content = @Content(schema = @Schema(implementation = Void.class))), }, tags={ "fake", }) - public Response testStringMapReference(@Schema(description = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) + public Response testStringMapReference(@Schema(description = "request body", required = true) @NotNull Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testStringMapReference(requestBody, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/PetApi.java index 701559179ea..65e1a00d417 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/api/PetApi.java @@ -104,7 +104,7 @@ public class PetApi { },security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) }, tags={ "pet", }) - public Response findPetsByStatus(@Schema(description = "Status values that need to be considered for filter") @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) + public Response findPetsByStatus(@Schema(description = "Status values that need to be considered for filter") @QueryParam("status") @NotNull List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); } @@ -120,7 +120,7 @@ public class PetApi { },security = { @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) }, tags={ "pet", }) - public Response findPetsByTags(@Schema(description = "Tags to filter by") @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) + public Response findPetsByTags(@Schema(description = "Tags to filter by") @QueryParam("tags") @NotNull Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ba64410f1b0..8e79ea57a1e 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -87,7 +87,7 @@ public class AdditionalPropertiesClass { **/ @JsonProperty(value = "map_of_map_property") @Schema(description = "") - @Valid + public Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java index 1e3256e74c9..d67de557540 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -71,7 +71,7 @@ public class AllOfWithSingleRef { **/ @JsonProperty(value = "SingleRefType") @Schema(description = "") - @Valid + public SingleRefType getSingleRefType() { return singleRefType; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ArrayTest.java index 7efac496b5c..cc0c89715bd 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ArrayTest.java @@ -94,7 +94,7 @@ public class ArrayTest { **/ @JsonProperty(value = "array_array_of_integer") @Schema(description = "") - @Valid + public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/EnumTest.java index abf121844fb..141093c6c08 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/EnumTest.java @@ -293,7 +293,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnum") @Schema(description = "") - @Valid + public OuterEnum getOuterEnum() { return outerEnum; } @@ -313,7 +313,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumInteger") @Schema(description = "") - @Valid + public OuterEnumInteger getOuterEnumInteger() { return outerEnumInteger; } @@ -333,7 +333,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumDefaultValue") @Schema(description = "") - @Valid + public OuterEnumDefaultValue getOuterEnumDefaultValue() { return outerEnumDefaultValue; } @@ -353,7 +353,7 @@ public class EnumTest { **/ @JsonProperty(value = "outerEnumIntegerDefaultValue") @Schema(description = "") - @Valid + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/MapTest.java index a2194e3a190..15f514ea98d 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/MapTest.java @@ -101,7 +101,7 @@ public class MapTest { **/ @JsonProperty(value = "map_map_of_string") @Schema(description = "") - @Valid + public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java index a27b402800e..cb67082e32a 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -46,7 +46,7 @@ public class OuterObjectWithEnumProperty { **/ @JsonProperty(value = "value") @Schema(required = true, description = "") - @NotNull @Valid + @NotNull public OuterEnumInteger getValue() { return value; } diff --git a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ParentWithNullable.java index 92ed25c2465..14d36067460 100644 --- a/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/jaxrs/jersey3/src/gen/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/kotlin-spring-cloud/.openapi-generator-ignore b/samples/server/petstore/kotlin-spring-cloud/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-spring-cloud/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-spring-cloud/.openapi-generator/FILES b/samples/server/petstore/kotlin-spring-cloud/.openapi-generator/FILES similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/.openapi-generator/FILES rename to samples/server/petstore/kotlin-spring-cloud/.openapi-generator/FILES diff --git a/samples/server/petstore/kotlin-spring-cloud/.openapi-generator/VERSION b/samples/server/petstore/kotlin-spring-cloud/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-spring-cloud/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/client/petstore/kotlin-spring-cloud/README.md b/samples/server/petstore/kotlin-spring-cloud/README.md similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/README.md rename to samples/server/petstore/kotlin-spring-cloud/README.md diff --git a/samples/client/petstore/kotlin-spring-cloud/build.gradle.kts b/samples/server/petstore/kotlin-spring-cloud/build.gradle.kts similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/build.gradle.kts rename to samples/server/petstore/kotlin-spring-cloud/build.gradle.kts diff --git a/samples/client/petstore/kotlin-spring-cloud/pom.xml b/samples/server/petstore/kotlin-spring-cloud/pom.xml similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/pom.xml rename to samples/server/petstore/kotlin-spring-cloud/pom.xml diff --git a/samples/client/petstore/kotlin-spring-cloud/settings.gradle b/samples/server/petstore/kotlin-spring-cloud/settings.gradle similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/settings.gradle rename to samples/server/petstore/kotlin-spring-cloud/settings.gradle diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApiClient.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApiClient.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApiClient.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApiClient.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApiClient.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApiClient.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApiClient.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApiClient.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApiClient.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApiClient.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApiClient.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApiClient.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ApiKeyRequestInterceptor.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ApiKeyRequestInterceptor.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ApiKeyRequestInterceptor.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ApiKeyRequestInterceptor.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ClientConfiguration.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ClientConfiguration.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ClientConfiguration.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/configuration/ClientConfiguration.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt diff --git a/samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt similarity index 100% rename from samples/client/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt rename to samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt diff --git a/samples/server/petstore/kotlin-wiremock/.gitignore b/samples/server/petstore/kotlin-wiremock/.gitignore new file mode 100644 index 00000000000..2983e3c1db3 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/.gitignore @@ -0,0 +1,106 @@ +./bin/ +# Created by https://www.gitignore.io/api/java,intellij,gradle + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +# End of https://www.gitignore.io/api/java,intellij,gradle diff --git a/samples/server/petstore/kotlin-wiremock/.openapi-generator-ignore b/samples/server/petstore/kotlin-wiremock/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/kotlin-wiremock/.openapi-generator/FILES b/samples/server/petstore/kotlin-wiremock/.openapi-generator/FILES new file mode 100644 index 00000000000..20ae24df387 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +build.gradle.kts +gradle/libs.versions.toml +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle.kts +src/main/kotlin/org/openapitools/apis/PetApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/PetApiStubs.kt +src/main/kotlin/org/openapitools/apis/StoreApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/StoreApiStubs.kt +src/main/kotlin/org/openapitools/apis/UserApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/UserApiStubs.kt +src/main/kotlin/org/openapitools/models/ApiResponse.kt +src/main/kotlin/org/openapitools/models/Category.kt +src/main/kotlin/org/openapitools/models/Order.kt +src/main/kotlin/org/openapitools/models/Pet.kt +src/main/kotlin/org/openapitools/models/Tag.kt +src/main/kotlin/org/openapitools/models/User.kt diff --git a/samples/server/petstore/kotlin-wiremock/.openapi-generator/VERSION b/samples/server/petstore/kotlin-wiremock/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/kotlin-wiremock/build.gradle.kts b/samples/server/petstore/kotlin-wiremock/build.gradle.kts new file mode 100644 index 00000000000..f5d878978f3 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/build.gradle.kts @@ -0,0 +1,21 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +group = "org.openapitools" +version = "1.0.0" + +tasks.wrapper { + gradleVersion = "8.7" +} + +plugins { + alias(libs.plugins.kotlin.jvm) +} + +tasks.withType { + kotlinOptions.jvmTarget = "11" +} + +dependencies { + implementation(libs.wiremock) + implementation(libs.jackson.databind) +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-wiremock/gradle/libs.versions.toml b/samples/server/petstore/kotlin-wiremock/gradle/libs.versions.toml new file mode 100644 index 00000000000..23fdd0ddbc1 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/gradle/libs.versions.toml @@ -0,0 +1,10 @@ +[versions] +kotlin = "1.9.23" +wiremock = "3.5.4" + +[libraries] +wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" } +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version = "2.17.1" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } \ No newline at end of file diff --git a/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar b/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..d64cd491770 Binary files /dev/null and b/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties b/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..e7646dead06 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/server/petstore/kotlin-wiremock/gradlew b/samples/server/petstore/kotlin-wiremock/gradlew new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/server/petstore/kotlin-wiremock/gradlew.bat b/samples/server/petstore/kotlin-wiremock/gradlew.bat new file mode 100644 index 00000000000..9d0ce634cb1 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/gradlew.bat @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/server/petstore/kotlin-wiremock/settings.gradle.kts b/samples/server/petstore/kotlin-wiremock/settings.gradle.kts new file mode 100644 index 00000000000..537908ca655 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/settings.gradle.kts @@ -0,0 +1,7 @@ +rootProject.name = "kotlin-wiremock" + +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubBuilders.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubBuilders.kt new file mode 100644 index 00000000000..429cb65a3ce --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubBuilders.kt @@ -0,0 +1,525 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation addPet. + */ +class AddPetStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for addPet respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for addPet respond with HTTP status code 405. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith405( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(405) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for addPet respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation deletePet. + */ +class DeletePetStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for deletePet respond with HTTP status code 400. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .configurer() + ) + + /** + * Let the stub for deletePet respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation findPetsByStatus. + */ +class FindPetsByStatusStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for findPetsByStatus respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.collections.List, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for findPetsByStatus respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: kotlin.collections.List, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for findPetsByStatus respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation findPetsByTags. + */ +class FindPetsByTagsStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for findPetsByTags respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.collections.List, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for findPetsByTags respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: kotlin.collections.List, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for findPetsByTags respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation getPetById. + */ +class GetPetByIdStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for getPetById respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getPetById respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getPetById respond with HTTP status code 404. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getPetById respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation updatePet. + */ +class UpdatePetStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for updatePet respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for updatePet respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for updatePet respond with HTTP status code 404. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for updatePet respond with HTTP status code 405. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith405( + body: Pet, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(405) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for updatePet respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation updatePetWithForm. + */ +class UpdatePetWithFormStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for updatePetWithForm respond with HTTP status code 405. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith405( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(405) + .configurer() + ) + + /** + * Let the stub for updatePetWithForm respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation uploadFile. + */ +class UploadFileStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for uploadFile respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: ApiResponse, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for uploadFile respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubs.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubs.kt new file mode 100644 index 00000000000..133e670964e --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/PetApiStubs.kt @@ -0,0 +1,120 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class PetApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation addPet. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [AddPetStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun addPet(configurer: MappingBuilder.() -> MappingBuilder = { this }): AddPetStubBuilder = + AddPetStubBuilder(objectMapper, post(urlPathTemplate("/pet")) + .configurer() + ) + + /** + * Construct a stub for the operation deletePet. + * + * @param petId path parameter petId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [DeletePetStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun deletePet(petId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): DeletePetStubBuilder = + DeletePetStubBuilder(objectMapper, delete(urlPathTemplate("/pet/{petId}")) + .withPathParam("petId", petId) + .configurer() + ) + + /** + * Construct a stub for the operation findPetsByStatus. + * + * @param status query parameter status pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [FindPetsByStatusStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun findPetsByStatus(status: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): FindPetsByStatusStubBuilder = + FindPetsByStatusStubBuilder(objectMapper, get(urlPathTemplate("/pet/findByStatus")) + .apply { status?.let { withQueryParam("status", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation findPetsByTags. + * + * @param tags query parameter tags pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [FindPetsByTagsStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun findPetsByTags(tags: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): FindPetsByTagsStubBuilder = + FindPetsByTagsStubBuilder(objectMapper, get(urlPathTemplate("/pet/findByTags")) + .apply { tags?.let { withQueryParam("tags", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation getPetById. + * + * @param petId path parameter petId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [GetPetByIdStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun getPetById(petId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): GetPetByIdStubBuilder = + GetPetByIdStubBuilder(objectMapper, get(urlPathTemplate("/pet/{petId}")) + .withPathParam("petId", petId) + .configurer() + ) + + /** + * Construct a stub for the operation updatePet. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [UpdatePetStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun updatePet(configurer: MappingBuilder.() -> MappingBuilder = { this }): UpdatePetStubBuilder = + UpdatePetStubBuilder(objectMapper, put(urlPathTemplate("/pet")) + .configurer() + ) + + /** + * Construct a stub for the operation updatePetWithForm. + * + * @param petId path parameter petId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [UpdatePetWithFormStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun updatePetWithForm(petId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): UpdatePetWithFormStubBuilder = + UpdatePetWithFormStubBuilder(objectMapper, post(urlPathTemplate("/pet/{petId}")) + .withPathParam("petId", petId) + .configurer() + ) + + /** + * Construct a stub for the operation uploadFile. + * + * @param petId path parameter petId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [UploadFileStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun uploadFile(petId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): UploadFileStubBuilder = + UploadFileStubBuilder(objectMapper, post(urlPathTemplate("/pet/{petId}/uploadImage")) + .withPathParam("petId", petId) + .configurer() + ) +} diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubBuilders.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubBuilders.kt new file mode 100644 index 00000000000..297a5498bf2 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubBuilders.kt @@ -0,0 +1,266 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation deleteOrder. + */ +class DeleteOrderStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for deleteOrder respond with HTTP status code 400. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .configurer() + ) + + /** + * Let the stub for deleteOrder respond with HTTP status code 404. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .configurer() + ) + + /** + * Let the stub for deleteOrder respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation getInventory. + */ +class GetInventoryStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for getInventory respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.collections.Map, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getInventory respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation getOrderById. + */ +class GetOrderByIdStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for getOrderById respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Order, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getOrderById respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: Order, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getOrderById respond with HTTP status code 404. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + body: Order, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getOrderById respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation placeOrder. + */ +class PlaceOrderStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for placeOrder respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: Order, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for placeOrder respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: Order, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for placeOrder respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubs.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubs.kt new file mode 100644 index 00000000000..dc6a5385574 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/StoreApiStubs.kt @@ -0,0 +1,68 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class StoreApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation deleteOrder. + * + * @param orderId path parameter orderId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [DeleteOrderStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun deleteOrder(orderId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): DeleteOrderStubBuilder = + DeleteOrderStubBuilder(objectMapper, delete(urlPathTemplate("/store/order/{orderId}")) + .withPathParam("orderId", orderId) + .configurer() + ) + + /** + * Construct a stub for the operation getInventory. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [GetInventoryStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun getInventory(configurer: MappingBuilder.() -> MappingBuilder = { this }): GetInventoryStubBuilder = + GetInventoryStubBuilder(objectMapper, get(urlPathTemplate("/store/inventory")) + .configurer() + ) + + /** + * Construct a stub for the operation getOrderById. + * + * @param orderId path parameter orderId pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [GetOrderByIdStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun getOrderById(orderId: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): GetOrderByIdStubBuilder = + GetOrderByIdStubBuilder(objectMapper, get(urlPathTemplate("/store/order/{orderId}")) + .withPathParam("orderId", orderId) + .configurer() + ) + + /** + * Construct a stub for the operation placeOrder. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [PlaceOrderStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun placeOrder(configurer: MappingBuilder.() -> MappingBuilder = { this }): PlaceOrderStubBuilder = + PlaceOrderStubBuilder(objectMapper, post(urlPathTemplate("/store/order")) + .configurer() + ) +} diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubBuilders.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubBuilders.kt new file mode 100644 index 00000000000..817c40844f2 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubBuilders.kt @@ -0,0 +1,387 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation createUser. + */ +class CreateUserStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for createUser respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation createUsersWithArrayInput. + */ +class CreateUsersWithArrayInputStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for createUsersWithArrayInput respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation createUsersWithListInput. + */ +class CreateUsersWithListInputStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for createUsersWithListInput respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation deleteUser. + */ +class DeleteUserStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for deleteUser respond with HTTP status code 400. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .configurer() + ) + + /** + * Let the stub for deleteUser respond with HTTP status code 404. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .configurer() + ) + + /** + * Let the stub for deleteUser respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation getUserByName. + */ +class GetUserByNameStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for getUserByName respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: User, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getUserByName respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: User, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getUserByName respond with HTTP status code 404. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + body: User, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for getUserByName respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation loginUser. + */ +class LoginUserStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for loginUser respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for loginUser respond with HTTP status code 400. + * + * @param body response body for the [MappingBuilder]. + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for loginUser respond with HTTP status code [code]. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation logoutUser. + */ +class LogoutUserStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for logoutUser respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + +/** + * Builder for WireMock stubs of operation updateUser. + */ +class UpdateUserStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for updateUser respond with HTTP status code 400. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith400( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(400) + .configurer() + ) + + /** + * Let the stub for updateUser respond with HTTP status code 404. + * + * @param configurer fonfigurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith404( + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(404) + .configurer() + ) + + /** + * Let the stub for updateUser respond with HTTP status code [code]. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubs.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubs.kt new file mode 100644 index 00000000000..72a45808686 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/UserApiStubs.kt @@ -0,0 +1,118 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class UserApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation createUser. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [CreateUserStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun createUser(configurer: MappingBuilder.() -> MappingBuilder = { this }): CreateUserStubBuilder = + CreateUserStubBuilder(objectMapper, post(urlPathTemplate("/user")) + .configurer() + ) + + /** + * Construct a stub for the operation createUsersWithArrayInput. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [CreateUsersWithArrayInputStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun createUsersWithArrayInput(configurer: MappingBuilder.() -> MappingBuilder = { this }): CreateUsersWithArrayInputStubBuilder = + CreateUsersWithArrayInputStubBuilder(objectMapper, post(urlPathTemplate("/user/createWithArray")) + .configurer() + ) + + /** + * Construct a stub for the operation createUsersWithListInput. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [CreateUsersWithListInputStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun createUsersWithListInput(configurer: MappingBuilder.() -> MappingBuilder = { this }): CreateUsersWithListInputStubBuilder = + CreateUsersWithListInputStubBuilder(objectMapper, post(urlPathTemplate("/user/createWithList")) + .configurer() + ) + + /** + * Construct a stub for the operation deleteUser. + * + * @param username path parameter username pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [DeleteUserStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun deleteUser(username: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): DeleteUserStubBuilder = + DeleteUserStubBuilder(objectMapper, delete(urlPathTemplate("/user/{username}")) + .withPathParam("username", username) + .configurer() + ) + + /** + * Construct a stub for the operation getUserByName. + * + * @param username path parameter username pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [GetUserByNameStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun getUserByName(username: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): GetUserByNameStubBuilder = + GetUserByNameStubBuilder(objectMapper, get(urlPathTemplate("/user/{username}")) + .withPathParam("username", username) + .configurer() + ) + + /** + * Construct a stub for the operation loginUser. + * + * @param username query parameter username pattern. + * @param password query parameter password pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [LoginUserStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun loginUser(username: StringValuePattern? = null, password: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): LoginUserStubBuilder = + LoginUserStubBuilder(objectMapper, get(urlPathTemplate("/user/login")) + .apply { username?.let { withQueryParam("username", it) } } + .apply { password?.let { withQueryParam("password", it) } } + .configurer() + ) + + /** + * Construct a stub for the operation logoutUser. + * + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [LogoutUserStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun logoutUser(configurer: MappingBuilder.() -> MappingBuilder = { this }): LogoutUserStubBuilder = + LogoutUserStubBuilder(objectMapper, get(urlPathTemplate("/user/logout")) + .configurer() + ) + + /** + * Construct a stub for the operation updateUser. + * + * @param username path parameter username pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [UpdateUserStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun updateUser(username: StringValuePattern, configurer: MappingBuilder.() -> MappingBuilder = { this }): UpdateUserStubBuilder = + UpdateUserStubBuilder(objectMapper, put(urlPathTemplate("/user/{username}")) + .withPathParam("username", username) + .configurer() + ) +} diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/ApiResponse.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/ApiResponse.kt new file mode 100644 index 00000000000..762ff9aefc9 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/ApiResponse.kt @@ -0,0 +1,20 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class ApiResponse( + @field:JsonProperty("code") + val code: kotlin.Int? = null, + + @field:JsonProperty("type") + val type: kotlin.String? = null, + + @field:JsonProperty("message") + val message: kotlin.String? = null, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt new file mode 100644 index 00000000000..8904ea0c3b8 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Category.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Category( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Order.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Order.kt new file mode 100644 index 00000000000..bd5fb164188 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Order.kt @@ -0,0 +1,29 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Order( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("petId") + val petId: kotlin.Long? = null, + + @field:JsonProperty("quantity") + val quantity: kotlin.Int? = null, + + @field:JsonProperty("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + @field:JsonProperty("status") + val status: kotlin.String? = null, + + @field:JsonProperty("complete") + val complete: kotlin.Boolean? = false, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt new file mode 100644 index 00000000000..2498edf6052 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Pet.kt @@ -0,0 +1,29 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Pet( + @field:JsonProperty("name") + val name: kotlin.String, + + @field:JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("category") + val category: Category? = null, + + @field:JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + @field:JsonProperty("status") + val status: kotlin.String? = null, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt new file mode 100644 index 00000000000..b1b72f4cd18 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/Tag.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Tag( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/User.kt b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/User.kt new file mode 100644 index 00000000000..1090a716110 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/main/kotlin/org/openapitools/models/User.kt @@ -0,0 +1,35 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class User( + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("username") + val username: kotlin.String? = null, + + @field:JsonProperty("firstName") + val firstName: kotlin.String? = null, + + @field:JsonProperty("lastName") + val lastName: kotlin.String? = null, + + @field:JsonProperty("email") + val email: kotlin.String? = null, + + @field:JsonProperty("password") + val password: kotlin.String? = null, + + @field:JsonProperty("phone") + val phone: kotlin.String? = null, + + @field:JsonProperty("userStatus") + val userStatus: kotlin.Int? = null, + +) diff --git a/samples/server/petstore/kotlin-wiremock/src/test/kotlin/org/openapitools/apis/PetApiStubsTest.kt b/samples/server/petstore/kotlin-wiremock/src/test/kotlin/org/openapitools/apis/PetApiStubsTest.kt new file mode 100644 index 00000000000..2b3bb824e93 --- /dev/null +++ b/samples/server/petstore/kotlin-wiremock/src/test/kotlin/org/openapitools/apis/PetApiStubsTest.kt @@ -0,0 +1,44 @@ +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule +import com.fasterxml.jackson.module.kotlin.kotlinModule +import com.github.tomakehurst.wiremock.client.WireMock.equalTo +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo +import com.github.tomakehurst.wiremock.junit5.WireMockTest +import org.openapitools.models.Pet +import java.net.URI +import java.net.http.HttpClient +import java.net.http.HttpRequest +import java.net.http.HttpResponse +import kotlin.test.Test +import kotlin.test.assertEquals + +@WireMockTest +class PetApiStubsTest { + + private val objectMapper = ObjectMapper() + .registerModules(JavaTimeModule()) + .registerModules(kotlinModule()) + + private val stubs = PetApiStubs(objectMapper) + + private val client = HttpClient.newBuilder().build() + + @Test + fun `stub and retrieve`(wiremock: WireMockRuntimeInfo) { + val pet = Pet("Pet", emptyList(), null, null, null, null) + + wiremock.wireMock.register( + stubs.getPetById(equalTo("2")).respondWith200(pet) + ) + + val request = HttpRequest.newBuilder(URI.create(wiremock.httpBaseUrl + "/pet/1")) + .GET() + .build() + + val response = client.send(request, HttpResponse.BodyHandlers.ofString()) + + assertEquals(pet, objectMapper.readValue(response.body(), Pet::class.java)) + } +} \ No newline at end of file diff --git a/samples/server/petstore/php-flight/.gitignore b/samples/server/petstore/php-flight/.gitignore new file mode 100644 index 00000000000..931a98c71bd --- /dev/null +++ b/samples/server/petstore/php-flight/.gitignore @@ -0,0 +1,28 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# phplint tool creates cache file which is not necessary in a codebase +/.phplint-cache + +# Do not commit local PHPUnit config +/phpunit.xml +/.phpunit.result.cache + +# Do not commit local PHP_CodeSniffer config +/phpcs.xml + +# Application config may contain sensitive data +/config/**/*.* +!/config/.htaccess +!/config/dev/default.inc.php +!/config/prod/default.inc.php + +# Logs folder +/logs/**/*.* +!/logs/.htaccess diff --git a/samples/server/petstore/php-flight/.openapi-generator-ignore b/samples/server/petstore/php-flight/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/php-flight/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/php-flight/.openapi-generator/FILES b/samples/server/petstore/php-flight/.openapi-generator/FILES new file mode 100644 index 00000000000..248dfdf733d --- /dev/null +++ b/samples/server/petstore/php-flight/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +Api/AbstractPetApi.php +Api/AbstractStoreApi.php +Api/AbstractUserApi.php +Model/ApiResponse.php +Model/Category.php +Model/FindPetsByStatusStatusParameterInner.php +Model/Order.php +Model/OrderStatus.php +Model/Pet.php +Model/PetStatus.php +Model/Tag.php +Model/User.php +README.md +RegisterRoutes.php +Test/RegisterRoutesTest.php +composer.json +phpunit.xml.dist diff --git a/samples/server/petstore/php-flight/.openapi-generator/VERSION b/samples/server/petstore/php-flight/.openapi-generator/VERSION new file mode 100644 index 00000000000..f1358e30d8a --- /dev/null +++ b/samples/server/petstore/php-flight/.openapi-generator/VERSION @@ -0,0 +1 @@ +8.0.0-SNAPSHOT diff --git a/samples/server/petstore/php-flight/Api/AbstractPetApi.php b/samples/server/petstore/php-flight/Api/AbstractPetApi.php new file mode 100644 index 00000000000..949e7d1f2f1 --- /dev/null +++ b/samples/server/petstore/php-flight/Api/AbstractPetApi.php @@ -0,0 +1,268 @@ +code = $code; + $this->type = $type; + $this->message = $message; + } + + public static function fromArray(array $data): self + { + return new self( + $data['code'] ?? null, + $data['type'] ?? null, + $data['message'] ?? null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'code' => $this->code, + 'type' => $this->type, + 'message' => $this->message, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/Model/Category.php b/samples/server/petstore/php-flight/Model/Category.php new file mode 100644 index 00000000000..4f3f6e9d81b --- /dev/null +++ b/samples/server/petstore/php-flight/Model/Category.php @@ -0,0 +1,83 @@ +id = $id; + $this->name = $name; + } + + public static function fromArray(array $data): self + { + return new self( + $data['id'] ?? null, + $data['name'] ?? null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'id' => $this->id, + 'name' => $this->name, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php b/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php new file mode 100644 index 00000000000..752121f877d --- /dev/null +++ b/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php @@ -0,0 +1,41 @@ +id = $id; + $this->petId = $petId; + $this->quantity = $quantity; + $this->shipDate = $shipDate; + $this->status = $status; + $this->complete = $complete; + } + + public static function fromArray(array $data): self + { + return new self( + $data['id'] ?? null, + $data['petId'] ?? null, + $data['quantity'] ?? null, + isset($data['shipDate']) ? new \DateTime($data['shipDate']) : null, + isset($data['status']) ? OrderStatus::tryFrom($data['status']) : null, + $data['complete'] ?? null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'id' => $this->id, + 'petId' => $this->petId, + 'quantity' => $this->quantity, + 'shipDate' => $this->shipDate?->format('c'), + 'status' => $this->status, + 'complete' => $this->complete, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/Model/OrderStatus.php b/samples/server/petstore/php-flight/Model/OrderStatus.php new file mode 100644 index 00000000000..92a8d69c54b --- /dev/null +++ b/samples/server/petstore/php-flight/Model/OrderStatus.php @@ -0,0 +1,43 @@ +") + */ + public array $photoUrls; + + /** + * @var Tag[]|null + * @SerializedName("tags") + * @Assert\All({ + * @Assert\Type("\OpenAPIServer\Model\Tag") + * }) + * @Type("array<\OpenAPIServer\Model\Tag>") + */ + public ?array $tags; + + /** + * @var PetStatus|null + * @SerializedName("status") + * @Accessor(getter="getSerializedStatus") + * @Type("string") + */ + public ?PetStatus $status; + + /** + * Constructor + * + * @param int|null $id + * @param Category|null $category + * @param string $name + * @param string[] $photoUrls + * @param Tag[]|null $tags + * @param PetStatus|null $status + */ + public function __construct(?int $id, ?Category $category, string $name, array $photoUrls, ?array $tags, ?PetStatus $status) + { + $this->id = $id; + $this->category = $category; + $this->name = $name; + $this->photoUrls = $photoUrls; + $this->tags = $tags; + $this->status = $status; + } + + public static function fromArray(array $data): self + { + return new self( + $data['id'] ?? null, + isset($data['category']) ? Category::fromArray($data['category']) : null, + $data['name'] ?? null, + $data['photoUrls'] ?? null, + isset($data['tags']) ? array_map(fn($item) => Tag::fromArray($item), $data['tags']) : null, + isset($data['status']) ? PetStatus::tryFrom($data['status']) : null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'id' => $this->id, + 'category' => $this->category, + 'name' => $this->name, + 'photoUrls' => $this->photoUrls, + 'tags' => $this->tags, + 'status' => $this->status, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/Model/PetStatus.php b/samples/server/petstore/php-flight/Model/PetStatus.php new file mode 100644 index 00000000000..b0c5fedb730 --- /dev/null +++ b/samples/server/petstore/php-flight/Model/PetStatus.php @@ -0,0 +1,43 @@ +id = $id; + $this->name = $name; + } + + public static function fromArray(array $data): self + { + return new self( + $data['id'] ?? null, + $data['name'] ?? null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'id' => $this->id, + 'name' => $this->name, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/Model/User.php b/samples/server/petstore/php-flight/Model/User.php new file mode 100644 index 00000000000..d5d4fbd5871 --- /dev/null +++ b/samples/server/petstore/php-flight/Model/User.php @@ -0,0 +1,156 @@ +id = $id; + $this->username = $username; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->email = $email; + $this->password = $password; + $this->phone = $phone; + $this->userStatus = $userStatus; + } + + public static function fromArray(array $data): self + { + return new self( + $data['id'] ?? null, + $data['username'] ?? null, + $data['firstName'] ?? null, + $data['lastName'] ?? null, + $data['email'] ?? null, + $data['password'] ?? null, + $data['phone'] ?? null, + $data['userStatus'] ?? null, + ); + } + + public function jsonSerialize(): mixed { + return [ + 'id' => $this->id, + 'username' => $this->username, + 'firstName' => $this->firstName, + 'lastName' => $this->lastName, + 'email' => $this->email, + 'password' => $this->password, + 'phone' => $this->phone, + 'userStatus' => $this->userStatus, + ]; + } +} + + diff --git a/samples/server/petstore/php-flight/README.md b/samples/server/petstore/php-flight/README.md new file mode 100644 index 00000000000..d510c3a5535 --- /dev/null +++ b/samples/server/petstore/php-flight/README.md @@ -0,0 +1,10 @@ +## Requirements + +PHP 8.1 and later + +## Installation & Usage + +1. Set up flight as usual - see [Flight documentation](https://docs.flightphp.com/install) +2. Generate using the OpenAPI generator +3. Subclass some/all generated `Abstract*Api` and overwrite the methods you'd like handled. When implementing the `*Stream` methods, make sure to stream the response and not implement the non-stream method. +4. Register routes for your subclassed apis: `RegisterRoutes::registerRoutes(new MyApiHandler());` diff --git a/samples/server/petstore/php-flight/RegisterRoutes.php b/samples/server/petstore/php-flight/RegisterRoutes.php new file mode 100644 index 00000000000..abae0ec3bd8 --- /dev/null +++ b/samples/server/petstore/php-flight/RegisterRoutes.php @@ -0,0 +1,538 @@ +addPet( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Pet') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'addPetStream')) { + \Flight::route('POST /pet', function () use ($handler) { + $r = \Flight::request(); + $handler->addPetStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Pet') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'deletePet') && declaresMethod($reflectionClass, 'deletePetStream')) { + throw new \Exception('Operation deletePet cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'deletePet')) { + \Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->deletePet( + parseParam($petId, 'int'), + parseParam($r->getHeader('api_key'), '?string') + ); + \Flight::halt(400); + }); + } + if (declaresMethod($reflectionClass, 'deletePetStream')) { + \Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->deletePetStream( + parseParam($petId, 'int'), + parseParam($r->getHeader('api_key'), '?string') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 400]); + } + + if (declaresMethod($reflectionClass, 'findPetsByStatus') && declaresMethod($reflectionClass, 'findPetsByStatusStream')) { + throw new \Exception('Operation findPetsByStatus cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'findPetsByStatus')) { + \Flight::route('GET /pet/findByStatus', function () use ($handler) { + $r = \Flight::request(); + $result = $handler->findPetsByStatus( + parseParam($r->query['status'] ?? null, '\\OpenAPIServer\\Model\\FindPetsByStatusStatusParameterInner[]') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'findPetsByStatusStream')) { + \Flight::route('GET /pet/findByStatus', function () use ($handler) { + $r = \Flight::request(); + $handler->findPetsByStatusStream( + parseParam($r->query['status'] ?? null, '\\OpenAPIServer\\Model\\FindPetsByStatusStatusParameterInner[]') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'findPetsByTags') && declaresMethod($reflectionClass, 'findPetsByTagsStream')) { + throw new \Exception('Operation findPetsByTags cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'findPetsByTags')) { + \Flight::route('GET /pet/findByTags', function () use ($handler) { + $r = \Flight::request(); + $result = $handler->findPetsByTags( + parseParam($r->query['tags'] ?? null, 'string[]') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'findPetsByTagsStream')) { + \Flight::route('GET /pet/findByTags', function () use ($handler) { + $r = \Flight::request(); + $handler->findPetsByTagsStream( + parseParam($r->query['tags'] ?? null, 'string[]') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'getPetById') && declaresMethod($reflectionClass, 'getPetByIdStream')) { + throw new \Exception('Operation getPetById cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'getPetById')) { + \Flight::route('GET /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $result = $handler->getPetById( + parseParam($petId, 'int') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'getPetByIdStream')) { + \Flight::route('GET /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->getPetByIdStream( + parseParam($petId, 'int') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'updatePet') && declaresMethod($reflectionClass, 'updatePetStream')) { + throw new \Exception('Operation updatePet cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'updatePet')) { + \Flight::route('PUT /pet', function () use ($handler) { + $r = \Flight::request(); + $result = $handler->updatePet( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Pet') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'updatePetStream')) { + \Flight::route('PUT /pet', function () use ($handler) { + $r = \Flight::request(); + $handler->updatePetStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Pet') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'updatePetWithForm') && declaresMethod($reflectionClass, 'updatePetWithFormStream')) { + throw new \Exception('Operation updatePetWithForm cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'updatePetWithForm')) { + \Flight::route('POST /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->updatePetWithForm( + parseParam($petId, 'int') + ); + \Flight::halt(405); + }); + } + if (declaresMethod($reflectionClass, 'updatePetWithFormStream')) { + \Flight::route('POST /pet/@petId', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->updatePetWithFormStream( + parseParam($petId, 'int') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 405]); + } + + if (declaresMethod($reflectionClass, 'uploadFile') && declaresMethod($reflectionClass, 'uploadFileStream')) { + throw new \Exception('Operation uploadFile cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'uploadFile')) { + \Flight::route('POST /pet/@petId/uploadImage', function (string $petId) use ($handler) { + $r = \Flight::request(); + $result = $handler->uploadFile( + parseParam($petId, 'int') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'uploadFileStream')) { + \Flight::route('POST /pet/@petId/uploadImage', function (string $petId) use ($handler) { + $r = \Flight::request(); + $handler->uploadFileStream( + parseParam($petId, 'int') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'deleteOrder') && declaresMethod($reflectionClass, 'deleteOrderStream')) { + throw new \Exception('Operation deleteOrder cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'deleteOrder')) { + \Flight::route('DELETE /store/order/@orderId', function (string $orderId) use ($handler) { + $r = \Flight::request(); + $handler->deleteOrder( + parseParam($orderId, 'string') + ); + \Flight::halt(400); + }); + } + if (declaresMethod($reflectionClass, 'deleteOrderStream')) { + \Flight::route('DELETE /store/order/@orderId', function (string $orderId) use ($handler) { + $r = \Flight::request(); + $handler->deleteOrderStream( + parseParam($orderId, 'string') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 400]); + } + + if (declaresMethod($reflectionClass, 'getInventory') && declaresMethod($reflectionClass, 'getInventoryStream')) { + throw new \Exception('Operation getInventory cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'getInventory')) { + \Flight::route('GET /store/inventory', function () use ($handler) { + $r = \Flight::request(); + $handler->getInventory( + ); + \Flight::halt(200); + }); + } + if (declaresMethod($reflectionClass, 'getInventoryStream')) { + \Flight::route('GET /store/inventory', function () use ($handler) { + $r = \Flight::request(); + $handler->getInventoryStream( + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200]); + } + + if (declaresMethod($reflectionClass, 'getOrderById') && declaresMethod($reflectionClass, 'getOrderByIdStream')) { + throw new \Exception('Operation getOrderById cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'getOrderById')) { + \Flight::route('GET /store/order/@orderId', function (string $orderId) use ($handler) { + $r = \Flight::request(); + $result = $handler->getOrderById( + parseParam($orderId, 'int') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'getOrderByIdStream')) { + \Flight::route('GET /store/order/@orderId', function (string $orderId) use ($handler) { + $r = \Flight::request(); + $handler->getOrderByIdStream( + parseParam($orderId, 'int') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'placeOrder') && declaresMethod($reflectionClass, 'placeOrderStream')) { + throw new \Exception('Operation placeOrder cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'placeOrder')) { + \Flight::route('POST /store/order', function () use ($handler) { + $r = \Flight::request(); + $result = $handler->placeOrder( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Order') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'placeOrderStream')) { + \Flight::route('POST /store/order', function () use ($handler) { + $r = \Flight::request(); + $handler->placeOrderStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\Order') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'createUser') && declaresMethod($reflectionClass, 'createUserStream')) { + throw new \Exception('Operation createUser cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'createUser')) { + \Flight::route('POST /user', function () use ($handler) { + $r = \Flight::request(); + $handler->createUser( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') + ); + \Flight::halt(200); + }); + } + if (declaresMethod($reflectionClass, 'createUserStream')) { + \Flight::route('POST /user', function () use ($handler) { + $r = \Flight::request(); + $handler->createUserStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200]); + } + + if (declaresMethod($reflectionClass, 'createUsersWithArrayInput') && declaresMethod($reflectionClass, 'createUsersWithArrayInputStream')) { + throw new \Exception('Operation createUsersWithArrayInput cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'createUsersWithArrayInput')) { + \Flight::route('POST /user/createWithArray', function () use ($handler) { + $r = \Flight::request(); + $handler->createUsersWithArrayInput( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User[]') + ); + \Flight::halt(200); + }); + } + if (declaresMethod($reflectionClass, 'createUsersWithArrayInputStream')) { + \Flight::route('POST /user/createWithArray', function () use ($handler) { + $r = \Flight::request(); + $handler->createUsersWithArrayInputStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User[]') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200]); + } + + if (declaresMethod($reflectionClass, 'createUsersWithListInput') && declaresMethod($reflectionClass, 'createUsersWithListInputStream')) { + throw new \Exception('Operation createUsersWithListInput cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'createUsersWithListInput')) { + \Flight::route('POST /user/createWithList', function () use ($handler) { + $r = \Flight::request(); + $handler->createUsersWithListInput( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User[]') + ); + \Flight::halt(200); + }); + } + if (declaresMethod($reflectionClass, 'createUsersWithListInputStream')) { + \Flight::route('POST /user/createWithList', function () use ($handler) { + $r = \Flight::request(); + $handler->createUsersWithListInputStream( + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User[]') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200]); + } + + if (declaresMethod($reflectionClass, 'deleteUser') && declaresMethod($reflectionClass, 'deleteUserStream')) { + throw new \Exception('Operation deleteUser cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'deleteUser')) { + \Flight::route('DELETE /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $handler->deleteUser( + parseParam($username, 'string') + ); + \Flight::halt(400); + }); + } + if (declaresMethod($reflectionClass, 'deleteUserStream')) { + \Flight::route('DELETE /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $handler->deleteUserStream( + parseParam($username, 'string') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 400]); + } + + if (declaresMethod($reflectionClass, 'getUserByName') && declaresMethod($reflectionClass, 'getUserByNameStream')) { + throw new \Exception('Operation getUserByName cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'getUserByName')) { + \Flight::route('GET /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $result = $handler->getUserByName( + parseParam($username, 'string') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'getUserByNameStream')) { + \Flight::route('GET /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $handler->getUserByNameStream( + parseParam($username, 'string') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'loginUser') && declaresMethod($reflectionClass, 'loginUserStream')) { + throw new \Exception('Operation loginUser cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'loginUser')) { + \Flight::route('GET /user/login', function () use ($handler) { + $r = \Flight::request(); + $result = $handler->loginUser( + parseParam($r->query['username'] ?? null, 'string'), + parseParam($r->query['password'] ?? null, 'string') + ); + if ($result === null) { + \Flight::halt(200); + } else { + \Flight::json($result, 200); + } + }); + } + if (declaresMethod($reflectionClass, 'loginUserStream')) { + \Flight::route('GET /user/login', function () use ($handler) { + $r = \Flight::request(); + $handler->loginUserStream( + parseParam($r->query['username'] ?? null, 'string'), + parseParam($r->query['password'] ?? null, 'string') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200, 'Content-Type' => 'application/json']); + } + + if (declaresMethod($reflectionClass, 'logoutUser') && declaresMethod($reflectionClass, 'logoutUserStream')) { + throw new \Exception('Operation logoutUser cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'logoutUser')) { + \Flight::route('GET /user/logout', function () use ($handler) { + $r = \Flight::request(); + $handler->logoutUser( + ); + \Flight::halt(200); + }); + } + if (declaresMethod($reflectionClass, 'logoutUserStream')) { + \Flight::route('GET /user/logout', function () use ($handler) { + $r = \Flight::request(); + $handler->logoutUserStream( + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 200]); + } + + if (declaresMethod($reflectionClass, 'updateUser') && declaresMethod($reflectionClass, 'updateUserStream')) { + throw new \Exception('Operation updateUser cannot be both streaming and non-streaming'); + } + if (declaresMethod($reflectionClass, 'updateUser')) { + \Flight::route('PUT /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $handler->updateUser( + parseParam($username, 'string'), + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') + ); + \Flight::halt(400); + }); + } + if (declaresMethod($reflectionClass, 'updateUserStream')) { + \Flight::route('PUT /user/@username', function (string $username) use ($handler) { + $r = \Flight::request(); + $handler->updateUserStream( + parseParam($username, 'string'), + parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') + ); + // ignore return value: streaming expected + })->streamWithHeaders(['status' => 400]); + } + + } +} + + +function parseParam(mixed $param, string $type) +{ + $nonNullType = str_replace('?', '', $type); + if ($param === null) { + return null; + } elseif ($nonNullType === 'int') { + return intval($param); + } elseif ($nonNullType === 'float') { + return floatval($param); + } elseif ($nonNullType === 'bool') { + return filter_var($param, FILTER_VALIDATE_BOOLEAN); + } elseif (str_ends_with($type, '[]')) { + return array_map(fn($el) => parseParam($el, substr($type, 0, -2)), $param); + } elseif (str_starts_with($nonNullType, '\\OpenAPIServer\\Model')) { + if (enum_exists($nonNullType)) { + return $nonNullType::tryFrom($param); + } + return $nonNullType::fromArray($param); + } else { + return $param; + } +} + +function declaresMethod(\ReflectionClass $reflectionClass, string $methodName): bool +{ + return $reflectionClass->hasMethod($methodName) && $reflectionClass->getMethod($methodName)->getDeclaringClass()->getName() === $reflectionClass->getName(); +} diff --git a/samples/server/petstore/php-flight/Test/RegisterRoutesTest.php b/samples/server/petstore/php-flight/Test/RegisterRoutesTest.php new file mode 100644 index 00000000000..737debbe455 --- /dev/null +++ b/samples/server/petstore/php-flight/Test/RegisterRoutesTest.php @@ -0,0 +1,78 @@ +assertTrue(true); + } + public function testRegisterRoutesAbstractStoreApi(): void + { + $handler = new class extends \OpenAPIServer\Api\AbstractStoreApi { + public function deleteOrder(string $orderId): void + { + } + }; + \OpenAPIServer\RegisterRoutes::registerRoutes($handler); + $this->assertTrue(true); + } + public function testRegisterRoutesAbstractUserApi(): void + { + $handler = new class extends \OpenAPIServer\Api\AbstractUserApi { + public function createUser(\OpenAPIServer\Model\User $user): void + { + } + }; + \OpenAPIServer\RegisterRoutes::registerRoutes($handler); + $this->assertTrue(true); + } + public function testParseParamsEnumFindPetsByStatusStatusParameterInner(): void + { + $value = 'available'; + $this->assertEquals( + parseParam($value, '\\OpenAPIServer\\Model\\FindPetsByStatusStatusParameterInner'), + \OpenAPIServer\Model\FindPetsByStatusStatusParameterInner::AVAILABLE + ); + } + public function testParseParamsEnumOrderStatus(): void + { + $value = 'placed'; + $this->assertEquals( + parseParam($value, '\\OpenAPIServer\\Model\\OrderStatus'), + \OpenAPIServer\Model\OrderStatus::PLACED + ); + } + public function testParseParamsEnumPetStatus(): void + { + $value = 'available'; + $this->assertEquals( + parseParam($value, '\\OpenAPIServer\\Model\\PetStatus'), + \OpenAPIServer\Model\PetStatus::AVAILABLE + ); + } +} diff --git a/samples/server/petstore/php-flight/composer.json b/samples/server/petstore/php-flight/composer.json new file mode 100644 index 00000000000..782987a751a --- /dev/null +++ b/samples/server/petstore/php-flight/composer.json @@ -0,0 +1,34 @@ +{ + "description": "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters..", + "keywords": ["openapi", "php", "framework", "flightphp"], + "version": "1.0.0", + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI", + "homepage": "https://openapi-generator.tech" + } + ], + "type": "library", + "require": { + "php": "^8.1.0", + "flightphp/core": "^3.5.1", + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "autoload": { + "psr-4": { + "OpenAPIServer\\": "" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/samples/server/petstore/php-flight/phpunit.xml.dist b/samples/server/petstore/php-flight/phpunit.xml.dist new file mode 100644 index 00000000000..0a03f35e357 --- /dev/null +++ b/samples/server/petstore/php-flight/phpunit.xml.dist @@ -0,0 +1,28 @@ + + + + + ./Api + ./Model + . + + + ./Test + + + + + ./Test + + + + + + diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php index f1d6d929d53..abaf02d5b8c 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php @@ -102,7 +102,7 @@ class Controller extends AbstractController $json = $this->exceptionToArray($exception); $json['statusCode'] = $statusCode; - return new Response(json_encode($json, 15, 512), $statusCode, $headers); + return new Response(json_encode($json, 15), $statusCode, $headers); } /** @@ -229,7 +229,7 @@ class Controller extends AbstractController public static function isContentTypeAllowed(Request $request, array $consumes = []): bool { if (!empty($consumes) && $consumes[0] !== '*/*') { - $currentFormat = $request->getContentType(); + $currentFormat = $request->getContentTypeFormat(); foreach ($consumes as $mimeType) { // canonize mime type if (is_string($mimeType) && false !== $pos = strpos($mimeType, ';')) { @@ -240,7 +240,7 @@ class Controller extends AbstractController // add custom format to request $format = $mimeType; $request->setFormat($format, $format); - $currentFormat = $request->getContentType(); + $currentFormat = $request->getContentTypeFormat(); } if ($format === $currentFormat) { diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php index 66cec11ee39..c9bf53c92e2 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php @@ -88,7 +88,7 @@ class PetController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -117,18 +117,11 @@ class PetController extends Controller $result = $handler->addPet($pet, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 405: - $message = 'Invalid input'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 405 => 'Invalid input', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -202,15 +195,10 @@ class PetController extends Controller $handler->deletePet($petId, $apiKey, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 400: - $message = 'Invalid pet value'; - break; - } + $message = match($responseCode) { + 400 => 'Invalid pet value', + default => '', + }; return new Response( '', @@ -291,18 +279,11 @@ class PetController extends Controller $result = $handler->findPetsByStatus($status, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid status value'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid status value', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -382,18 +363,11 @@ class PetController extends Controller $result = $handler->findPetsByTags($tags, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid tag value'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid tag value', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -468,21 +442,12 @@ class PetController extends Controller $result = $handler->getPetById($petId, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid ID supplied'; - break; - case 404: - $message = 'Pet not found'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid ID supplied', + 404 => 'Pet not found', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -538,7 +503,7 @@ class PetController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -567,24 +532,13 @@ class PetController extends Controller $result = $handler->updatePet($pet, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid ID supplied'; - break; - case 404: - $message = 'Pet not found'; - break; - case 405: - $message = 'Validation exception'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid ID supplied', + 404 => 'Pet not found', + 405 => 'Validation exception', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -666,15 +620,10 @@ class PetController extends Controller $handler->updatePetWithForm($petId, $name, $status, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 405: - $message = 'Invalid input'; - break; - } + $message = match($responseCode) { + 405 => 'Invalid input', + default => '', + }; return new Response( '', @@ -763,15 +712,10 @@ class PetController extends Controller $result = $handler->uploadFile($petId, $additionalMetadata, $file, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php index 28a894894f6..79b38c784f4 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -92,18 +92,11 @@ class StoreController extends Controller $handler->deleteOrder($orderId, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 400: - $message = 'Invalid ID supplied'; - break; - case 404: - $message = 'Order not found'; - break; - } + $message = match($responseCode) { + 400 => 'Invalid ID supplied', + 404 => 'Order not found', + default => '', + }; return new Response( '', @@ -163,15 +156,10 @@ class StoreController extends Controller $result = $handler->getInventory($responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -243,21 +231,12 @@ class StoreController extends Controller $result = $handler->getOrderById($orderId, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid ID supplied'; - break; - case 404: - $message = 'Order not found'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid ID supplied', + 404 => 'Order not found', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -310,7 +289,7 @@ class StoreController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $order = $this->deserialize($order, 'OpenAPI\Server\Model\Order', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -337,18 +316,11 @@ class StoreController extends Controller $result = $handler->placeOrder($order, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid Order'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid Order', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php index 49287cbbe20..fac6cc02250 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php @@ -78,7 +78,7 @@ class UserController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -107,15 +107,10 @@ class UserController extends Controller $handler->createUser($user, $responseCode, $responseHeaders); - // Find default response message - $message = 'successful operation'; - - // Find a more specific message, if available - switch ($responseCode) { - case 0: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 0 => 'successful operation', + default => 'successful operation', + }; return new Response( '', @@ -161,7 +156,7 @@ class UserController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $user = $this->deserialize($user, 'array', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -192,15 +187,10 @@ class UserController extends Controller $handler->createUsersWithArrayInput($user, $responseCode, $responseHeaders); - // Find default response message - $message = 'successful operation'; - - // Find a more specific message, if available - switch ($responseCode) { - case 0: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 0 => 'successful operation', + default => 'successful operation', + }; return new Response( '', @@ -246,7 +236,7 @@ class UserController extends Controller // Deserialize the input values that needs it try { - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $user = $this->deserialize($user, 'array', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -277,15 +267,10 @@ class UserController extends Controller $handler->createUsersWithListInput($user, $responseCode, $responseHeaders); - // Find default response message - $message = 'successful operation'; - - // Find a more specific message, if available - switch ($responseCode) { - case 0: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 0 => 'successful operation', + default => 'successful operation', + }; return new Response( '', @@ -350,18 +335,11 @@ class UserController extends Controller $handler->deleteUser($username, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 400: - $message = 'Invalid username supplied'; - break; - case 404: - $message = 'User not found'; - break; - } + $message = match($responseCode) { + 400 => 'Invalid username supplied', + 404 => 'User not found', + default => '', + }; return new Response( '', @@ -430,21 +408,12 @@ class UserController extends Controller $result = $handler->getUserByName($username, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid username supplied'; - break; - case 404: - $message = 'User not found'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid username supplied', + 404 => 'User not found', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -525,18 +494,11 @@ class UserController extends Controller $result = $handler->loginUser($username, $password, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 200: - $message = 'successful operation'; - break; - case 400: - $message = 'Invalid username/password supplied'; - break; - } + $message = match($responseCode) { + 200 => 'successful operation', + 400 => 'Invalid username/password supplied', + default => '', + }; return new Response( $result !== null ?$this->serialize($result, $responseFormat):'', @@ -588,15 +550,10 @@ class UserController extends Controller $handler->logoutUser($responseCode, $responseHeaders); - // Find default response message - $message = 'successful operation'; - - // Find a more specific message, if available - switch ($responseCode) { - case 0: - $message = 'successful operation'; - break; - } + $message = match($responseCode) { + 0 => 'successful operation', + default => 'successful operation', + }; return new Response( '', @@ -643,7 +600,7 @@ class UserController extends Controller // Deserialize the input values that needs it try { $username = $this->deserialize($username, 'string', 'string'); - $inputFormat = $request->getMimeType($request->getContentType()); + $inputFormat = $request->getMimeType($request->getContentTypeFormat()); $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); } catch (SerializerRuntimeException $exception) { return $this->createBadRequestResponse($exception->getMessage()); @@ -679,18 +636,11 @@ class UserController extends Controller $handler->updateUser($username, $user, $responseCode, $responseHeaders); - // Find default response message - $message = ''; - - // Find a more specific message, if available - switch ($responseCode) { - case 400: - $message = 'Invalid user supplied'; - break; - case 404: - $message = 'User not found'; - break; - } + $message = match($responseCode) { + 400 => 'Invalid user supplied', + 404 => 'User not found', + default => '', + }; return new Response( '', diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php index 34a16b5e734..12c69bab088 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php @@ -47,14 +47,11 @@ class JmsSerializer implements SerializerInterface private function convertFormat(string $format): ?string { - switch ($format) { - case 'application/json': - return 'json'; - case 'application/xml': - return 'xml'; - } - - return null; + return match($format) { + 'application/json' => 'json', + 'application/xml' => 'xml', + default => null, + }; } private function deserializeString($data, string $type) @@ -132,22 +129,13 @@ class JmsSerializer implements SerializerInterface } // Parse the string using the correct separator - switch ($format) { - case 'csv': - $data = explode(',', $data); - break; - case 'ssv': - $data = explode(' ', $data); - break; - case 'tsv': - $data = explode("\t", $data); - break; - case 'pipes': - $data = explode('|', $data); - break; - default; - $data = []; - } + $data = match($format) { + 'csv' => explode(',', $data), + 'ssv' => explode(' ', $data), + 'tsv' => explode("\t", $data), + 'pipes' => explode('|', $data), + default => [], + }; // Deserialize each of the array elements foreach ($data as $key => $item) { diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Controller/ControllerTest.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Controller/ControllerTest.php index 9e2328a813f..bf0edd41b45 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Controller/ControllerTest.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/Controller/ControllerTest.php @@ -65,7 +65,7 @@ class ControllerTest extends TestCase ); } - public function dataProviderIsContentTypeAllowed(): array + public static function dataProviderIsContentTypeAllowed(): array { return [ 'usual JSON content type' => [ diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json index 7aaf83d9c76..258c6637103 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json @@ -16,19 +16,19 @@ } ], "require": { - "php": ">=7.4.0|>=8.0.2", + "php": ">=8.1", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "symfony/validator": "^5.0|^6.0", - "jms/serializer-bundle": "^4.0", - "symfony/framework-bundle": "^5.0|^6.0" + "symfony/validator": "^6.4|^7.0", + "jms/serializer-bundle": "^5.4", + "symfony/framework-bundle": "^6.4|^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", - "friendsofphp/php-cs-fixer": "^2.16.3", - "symfony/browser-kit": "^5.0|^6.0", - "symfony/yaml": "^5.0|^6.0", + "phpunit/phpunit": "^10.5|^11.0", + "friendsofphp/php-cs-fixer": "*", + "symfony/browser-kit": "^6.4|7.0", + "symfony/yaml": "^6.4|^7.0", "hoa/regex": "~1.0" }, "autoload": { diff --git a/samples/server/petstore/python-fastapi/requirements.txt b/samples/server/petstore/python-fastapi/requirements.txt index d8e19d7ac0f..b54bc7478ed 100644 --- a/samples/server/petstore/python-fastapi/requirements.txt +++ b/samples/server/petstore/python-fastapi/requirements.txt @@ -5,7 +5,7 @@ async-generator==1.10 certifi==2023.7.22 chardet==4.0.0 click==7.1.2 -dnspython==2.1.0 +dnspython==2.6.1 email-validator==2.0.0 fastapi==0.109.2 graphene==2.1.8 @@ -14,9 +14,9 @@ graphql-relay==2.0.1 h11==0.12.0 httptools==0.1.2 httpx==0.24.1 -idna==2.10 +idna==3.7 itsdangerous==1.1.0 -Jinja2==2.11.3 +Jinja2==3.1.4 MarkupSafe==2.0.1 orjson==3.9.15 promise==2.3 @@ -24,7 +24,7 @@ pydantic>=2 python-dotenv==0.17.1 python-multipart==0.0.7 PyYAML==5.4.1 -requests==2.31.0 +requests==2.32.0 Rx==1.6.1 starlette==0.36.3 typing-extensions==4.8.0 diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES index ea1c5b8c5be..683914c4c64 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore Cargo.toml README.md +src/apis/default.rs +src/apis/mod.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/README.md b/samples/server/petstore/rust-axum/output/multipart-v3/README.md index f4f456c04bd..68f1c75bf6c 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/README.md +++ b/samples/server/petstore/rust-axum/output/multipart-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.7 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs new file mode 100644 index 00000000000..27d8cf2ee30 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/default.rs @@ -0,0 +1,64 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MultipartRelatedRequestPostResponse { + /// OK + Status201_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MultipartRequestPostResponse { + /// OK + Status201_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MultipleIdenticalMimeTypesPostResponse { + /// OK + Status200_OK, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// MultipartRelatedRequestPost - POST /multipart_related_request + async fn multipart_related_request_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: axum::body::Body, + ) -> Result; + + /// MultipartRequestPost - POST /multipart_request + async fn multipart_request_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Multipart, + ) -> Result; + + /// MultipleIdenticalMimeTypesPost - POST /multiple-identical-mime-types + async fn multiple_identical_mime_types_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: axum::body::Body, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs index f34355edde0..cc053adc1ca 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/lib.rs @@ -8,79 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0.7"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MultipartRelatedRequestPostResponse { - /// OK - Status201_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MultipartRequestPostResponse { - /// OK - Status201_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MultipleIdenticalMimeTypesPostResponse { - /// OK - Status200_OK, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// MultipartRelatedRequestPost - POST /multipart_related_request - async fn multipart_related_request_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: axum::body::Body, - ) -> Result; - - /// MultipartRequestPost - POST /multipart_request - async fn multipart_request_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Multipart, - ) -> Result; - - /// MultipleIdenticalMimeTypesPost - POST /multiple-identical-mime-types - async fn multiple_identical_mime_types_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: axum::body::Body, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs index ea53d41e0e8..89fd45ae461 100644 --- a/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/multipart-v3/src/server/mod.rs @@ -10,18 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - Api, MultipartRelatedRequestPostResponse, MultipartRequestPostResponse, - MultipleIdenticalMimeTypesPostResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::default::Default + 'static, { // build our application with a route Router::new() @@ -52,7 +47,7 @@ async fn multipart_related_request_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = @@ -76,7 +71,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MultipartRelatedRequestPostResponse::Status201_OK => { + apis::default::MultipartRelatedRequestPostResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } @@ -109,7 +104,7 @@ async fn multipart_request_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || multipart_request_post_validation()) @@ -132,7 +127,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MultipartRequestPostResponse::Status201_OK => { + apis::default::MultipartRequestPostResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } @@ -165,7 +160,7 @@ async fn multiple_identical_mime_types_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = @@ -189,7 +184,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MultipleIdenticalMimeTypesPostResponse::Status200_OK => { + apis::default::MultipleIdenticalMimeTypesPostResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES index ea1c5b8c5be..2c6783a8355 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/FILES @@ -1,6 +1,10 @@ .gitignore Cargo.toml README.md +src/apis/default.rs +src/apis/info_repo.rs +src/apis/mod.rs +src/apis/repo.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/README.md b/samples/server/petstore/rust-axum/output/openapi-v3/README.md index cce3ce70309..20b9a33bcac 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-axum/output/openapi-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.7 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs new file mode 100644 index 00000000000..d7d7e8232db --- /dev/null +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/default.rs @@ -0,0 +1,458 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum AnyOfGetResponse { + /// Success + Status200_Success(models::AnyOfObject), + /// AlternateSuccess + Status201_AlternateSuccess(models::Model12345AnyOfObject), + /// AnyOfSuccess + Status202_AnyOfSuccess(models::AnyOfGet202Response), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CallbackWithHeaderPostResponse { + /// OK + Status204_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum ComplexQueryParamGetResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum EnumInPathPathParamGetResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum JsonComplexQueryParamGetResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MandatoryRequestHeaderGetResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MergePatchJsonGetResponse { + /// merge-patch+json-encoded response + Status200_Merge(models::AnotherXmlObject), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MultigetGetResponse { + /// JSON rsp + Status200_JSONRsp(models::AnotherXmlObject), + /// XML rsp + Status201_XMLRsp(String), + /// octet rsp + Status202_OctetRsp(ByteArray), + /// string rsp + Status203_StringRsp(String), + /// Duplicate Response long text. One. + Status204_DuplicateResponseLongText(models::AnotherXmlObject), + /// Duplicate Response long text. Two. + Status205_DuplicateResponseLongText(models::AnotherXmlObject), + /// Duplicate Response long text. Three. + Status206_DuplicateResponseLongText(models::AnotherXmlObject), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MultipleAuthSchemeGetResponse { + /// Check that limiting to multiple required auth schemes works + Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum OneOfGetResponse { + /// Success + Status200_Success(models::OneOfGet200Response), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum OverrideServerGetResponse { + /// Success. + Status204_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum ParamgetGetResponse { + /// JSON rsp + Status200_JSONRsp(models::AnotherXmlObject), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum ReadonlyAuthSchemeGetResponse { + /// Check that limiting to a single required auth scheme works + Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum RegisterCallbackPostResponse { + /// OK + Status204_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum RequiredOctetStreamPutResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum ResponsesWithHeadersGetResponse { + /// Success + Status200_Success { + body: String, + success_info: String, + bool_header: Option, + object_header: Option, + }, + /// Precondition Failed + Status412_PreconditionFailed { + further_info: Option, + failure_info: Option, + }, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Rfc7807GetResponse { + /// OK + Status204_OK(models::ObjectWithArrayOfObjects), + /// NotFound + Status404_NotFound(models::ObjectWithArrayOfObjects), + /// NotAcceptable + Status406_NotAcceptable(String), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UntypedPropertyGetResponse { + /// Check that untyped properties works + Status200_CheckThatUntypedPropertiesWorks, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UuidGetResponse { + /// Duplicate Response long text. One. + Status200_DuplicateResponseLongText(uuid::Uuid), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum XmlExtraPostResponse { + /// OK + Status201_OK, + /// Bad Request + Status400_BadRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum XmlOtherPostResponse { + /// OK + Status201_OK(String), + /// Bad Request + Status400_BadRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum XmlOtherPutResponse { + /// OK + Status201_OK, + /// Bad Request + Status400_BadRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum XmlPostResponse { + /// OK + Status201_OK, + /// Bad Request + Status400_BadRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum XmlPutResponse { + /// OK + Status201_OK, + /// Bad Request + Status400_BadRequest, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// AnyOfGet - GET /any-of + async fn any_of_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::AnyOfGetQueryParams, + ) -> Result; + + /// CallbackWithHeaderPost - POST /callback-with-header + async fn callback_with_header_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::CallbackWithHeaderPostQueryParams, + ) -> Result; + + /// ComplexQueryParamGet - GET /complex-query-param + async fn complex_query_param_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::ComplexQueryParamGetQueryParams, + ) -> Result; + + /// EnumInPathPathParamGet - GET /enum_in_path/{path_param} + async fn enum_in_path_path_param_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::EnumInPathPathParamGetPathParams, + ) -> Result; + + /// JsonComplexQueryParamGet - GET /json-complex-query-param + async fn json_complex_query_param_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::JsonComplexQueryParamGetQueryParams, + ) -> Result; + + /// MandatoryRequestHeaderGet - GET /mandatory-request-header + async fn mandatory_request_header_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + header_params: models::MandatoryRequestHeaderGetHeaderParams, + ) -> Result; + + /// MergePatchJsonGet - GET /merge-patch-json + async fn merge_patch_json_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Get some stuff.. + /// + /// MultigetGet - GET /multiget + async fn multiget_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// MultipleAuthSchemeGet - GET /multiple_auth_scheme + async fn multiple_auth_scheme_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// OneOfGet - GET /one-of + async fn one_of_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// OverrideServerGet - GET /override-server + async fn override_server_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Get some stuff with parameters.. + /// + /// ParamgetGet - GET /paramget + async fn paramget_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::ParamgetGetQueryParams, + ) -> Result; + + /// ReadonlyAuthSchemeGet - GET /readonly_auth_scheme + async fn readonly_auth_scheme_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// RegisterCallbackPost - POST /register-callback + async fn register_callback_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::RegisterCallbackPostQueryParams, + ) -> Result; + + /// RequiredOctetStreamPut - PUT /required_octet_stream + async fn required_octet_stream_put( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; + + /// ResponsesWithHeadersGet - GET /responses_with_headers + async fn responses_with_headers_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Rfc7807Get - GET /rfc7807 + async fn rfc7807_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// UntypedPropertyGet - GET /untyped_property + async fn untyped_property_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Option, + ) -> Result; + + /// UuidGet - GET /uuid + async fn uuid_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// XmlExtraPost - POST /xml_extra + async fn xml_extra_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; + + /// XmlOtherPost - POST /xml_other + async fn xml_other_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; + + /// XmlOtherPut - PUT /xml_other + async fn xml_other_put( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; + + /// Post an array. + /// + /// XmlPost - POST /xml + async fn xml_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; + + /// XmlPut - PUT /xml + async fn xml_put( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Bytes, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs new file mode 100644 index 00000000000..bd68394bf23 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/info_repo.rs @@ -0,0 +1,30 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetRepoInfoResponse { + /// OK + Status200_OK(String), +} + +/// InfoRepo +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait InfoRepo { + /// GetRepoInfo - GET /repos/{repoId} + async fn get_repo_info( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetRepoInfoPathParams, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs new file mode 100644 index 00000000000..63ecd2990e8 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/mod.rs @@ -0,0 +1,3 @@ +pub mod default; +pub mod info_repo; +pub mod repo; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs new file mode 100644 index 00000000000..e08336d7799 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/apis/repo.rs @@ -0,0 +1,30 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateRepoResponse { + /// Success + Status200_Success, +} + +/// Repo +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Repo { + /// CreateRepo - POST /repos + async fn create_repo( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::ObjectParam, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs index 999fa523c36..cc053adc1ca 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/lib.rs @@ -8,507 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0.7"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum AnyOfGetResponse { - /// Success - Status200_Success(models::AnyOfObject), - /// AlternateSuccess - Status201_AlternateSuccess(models::Model12345AnyOfObject), - /// AnyOfSuccess - Status202_AnyOfSuccess(models::AnyOfGet202Response), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CallbackWithHeaderPostResponse { - /// OK - Status204_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum ComplexQueryParamGetResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum EnumInPathPathParamGetResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum JsonComplexQueryParamGetResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MandatoryRequestHeaderGetResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MergePatchJsonGetResponse { - /// merge-patch+json-encoded response - Status200_Merge(models::AnotherXmlObject), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MultigetGetResponse { - /// JSON rsp - Status200_JSONRsp(models::AnotherXmlObject), - /// XML rsp - Status201_XMLRsp(String), - /// octet rsp - Status202_OctetRsp(ByteArray), - /// string rsp - Status203_StringRsp(String), - /// Duplicate Response long text. One. - Status204_DuplicateResponseLongText(models::AnotherXmlObject), - /// Duplicate Response long text. Two. - Status205_DuplicateResponseLongText(models::AnotherXmlObject), - /// Duplicate Response long text. Three. - Status206_DuplicateResponseLongText(models::AnotherXmlObject), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum MultipleAuthSchemeGetResponse { - /// Check that limiting to multiple required auth schemes works - Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum OneOfGetResponse { - /// Success - Status200_Success(models::OneOfGet200Response), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum OverrideServerGetResponse { - /// Success. - Status204_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum ParamgetGetResponse { - /// JSON rsp - Status200_JSONRsp(models::AnotherXmlObject), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum ReadonlyAuthSchemeGetResponse { - /// Check that limiting to a single required auth scheme works - Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum RegisterCallbackPostResponse { - /// OK - Status204_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum RequiredOctetStreamPutResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum ResponsesWithHeadersGetResponse { - /// Success - Status200_Success { - body: String, - success_info: String, - bool_header: Option, - object_header: Option, - }, - /// Precondition Failed - Status412_PreconditionFailed { - further_info: Option, - failure_info: Option, - }, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Rfc7807GetResponse { - /// OK - Status204_OK(models::ObjectWithArrayOfObjects), - /// NotFound - Status404_NotFound(models::ObjectWithArrayOfObjects), - /// NotAcceptable - Status406_NotAcceptable(String), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UntypedPropertyGetResponse { - /// Check that untyped properties works - Status200_CheckThatUntypedPropertiesWorks, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UuidGetResponse { - /// Duplicate Response long text. One. - Status200_DuplicateResponseLongText(uuid::Uuid), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum XmlExtraPostResponse { - /// OK - Status201_OK, - /// Bad Request - Status400_BadRequest, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum XmlOtherPostResponse { - /// OK - Status201_OK(String), - /// Bad Request - Status400_BadRequest, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum XmlOtherPutResponse { - /// OK - Status201_OK, - /// Bad Request - Status400_BadRequest, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum XmlPostResponse { - /// OK - Status201_OK, - /// Bad Request - Status400_BadRequest, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum XmlPutResponse { - /// OK - Status201_OK, - /// Bad Request - Status400_BadRequest, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateRepoResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetRepoInfoResponse { - /// OK - Status200_OK(String), -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// AnyOfGet - GET /any-of - async fn any_of_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::AnyOfGetQueryParams, - ) -> Result; - - /// CallbackWithHeaderPost - POST /callback-with-header - async fn callback_with_header_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::CallbackWithHeaderPostQueryParams, - ) -> Result; - - /// ComplexQueryParamGet - GET /complex-query-param - async fn complex_query_param_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::ComplexQueryParamGetQueryParams, - ) -> Result; - - /// EnumInPathPathParamGet - GET /enum_in_path/{path_param} - async fn enum_in_path_path_param_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::EnumInPathPathParamGetPathParams, - ) -> Result; - - /// JsonComplexQueryParamGet - GET /json-complex-query-param - async fn json_complex_query_param_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::JsonComplexQueryParamGetQueryParams, - ) -> Result; - - /// MandatoryRequestHeaderGet - GET /mandatory-request-header - async fn mandatory_request_header_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - header_params: models::MandatoryRequestHeaderGetHeaderParams, - ) -> Result; - - /// MergePatchJsonGet - GET /merge-patch-json - async fn merge_patch_json_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Get some stuff.. - /// - /// MultigetGet - GET /multiget - async fn multiget_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// MultipleAuthSchemeGet - GET /multiple_auth_scheme - async fn multiple_auth_scheme_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// OneOfGet - GET /one-of - async fn one_of_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// OverrideServerGet - GET /override-server - async fn override_server_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Get some stuff with parameters.. - /// - /// ParamgetGet - GET /paramget - async fn paramget_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::ParamgetGetQueryParams, - ) -> Result; - - /// ReadonlyAuthSchemeGet - GET /readonly_auth_scheme - async fn readonly_auth_scheme_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// RegisterCallbackPost - POST /register-callback - async fn register_callback_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::RegisterCallbackPostQueryParams, - ) -> Result; - - /// RequiredOctetStreamPut - PUT /required_octet_stream - async fn required_octet_stream_put( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// ResponsesWithHeadersGet - GET /responses_with_headers - async fn responses_with_headers_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Rfc7807Get - GET /rfc7807 - async fn rfc7807_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// UntypedPropertyGet - GET /untyped_property - async fn untyped_property_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Option, - ) -> Result; - - /// UuidGet - GET /uuid - async fn uuid_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// XmlExtraPost - POST /xml_extra - async fn xml_extra_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// XmlOtherPost - POST /xml_other - async fn xml_other_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// XmlOtherPut - PUT /xml_other - async fn xml_other_put( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// Post an array. - /// - /// XmlPost - POST /xml - async fn xml_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// XmlPut - PUT /xml - async fn xml_put( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Bytes, - ) -> Result; - - /// CreateRepo - POST /repos - async fn create_repo( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::ObjectParam, - ) -> Result; - - /// GetRepoInfo - GET /repos/{repoId} - async fn get_repo_info( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetRepoInfoPathParams, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs index 77ff323cab4..cc8091d104d 100644 --- a/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/openapi-v3/src/server/mod.rs @@ -10,24 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - AnyOfGetResponse, Api, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, - CreateRepoResponse, EnumInPathPathParamGetResponse, GetRepoInfoResponse, - JsonComplexQueryParamGetResponse, MandatoryRequestHeaderGetResponse, MergePatchJsonGetResponse, - MultigetGetResponse, MultipleAuthSchemeGetResponse, OneOfGetResponse, - OverrideServerGetResponse, ParamgetGetResponse, ReadonlyAuthSchemeGetResponse, - RegisterCallbackPostResponse, RequiredOctetStreamPutResponse, ResponsesWithHeadersGetResponse, - Rfc7807GetResponse, UntypedPropertyGetResponse, UuidGetResponse, XmlExtraPostResponse, - XmlOtherPostResponse, XmlOtherPutResponse, XmlPostResponse, XmlPutResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::default::Default + apis::info_repo::InfoRepo + apis::repo::Repo + 'static, { // build our application with a route Router::new() @@ -107,7 +96,7 @@ async fn any_of_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = any_of_get_validation(query_params); @@ -127,7 +116,7 @@ where let resp = match result { Ok(rsp) => match rsp { - AnyOfGetResponse::Status200_Success(body) => { + apis::default::AnyOfGetResponse::Status200_Success(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -150,7 +139,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - AnyOfGetResponse::Status201_AlternateSuccess(body) => { + apis::default::AnyOfGetResponse::Status201_AlternateSuccess(body) => { let mut response = response.status(201); { let mut response_headers = response.headers_mut().unwrap(); @@ -173,7 +162,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - AnyOfGetResponse::Status202_AnyOfSuccess(body) => { + apis::default::AnyOfGetResponse::Status202_AnyOfSuccess(body) => { let mut response = response.status(202); { let mut response_headers = response.headers_mut().unwrap(); @@ -229,7 +218,7 @@ async fn callback_with_header_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = callback_with_header_post_validation(query_params); @@ -249,7 +238,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CallbackWithHeaderPostResponse::Status204_OK => { + apis::default::CallbackWithHeaderPostResponse::Status204_OK => { let mut response = response.status(204); response.body(Body::empty()) } @@ -286,7 +275,7 @@ async fn complex_query_param_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = complex_query_param_get_validation(query_params); @@ -306,7 +295,7 @@ where let resp = match result { Ok(rsp) => match rsp { - ComplexQueryParamGetResponse::Status200_Success => { + apis::default::ComplexQueryParamGetResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -343,7 +332,7 @@ async fn enum_in_path_path_param_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = enum_in_path_path_param_get_validation(path_params); @@ -363,7 +352,7 @@ where let resp = match result { Ok(rsp) => match rsp { - EnumInPathPathParamGetResponse::Status200_Success => { + apis::default::EnumInPathPathParamGetResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -400,7 +389,7 @@ async fn json_complex_query_param_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = json_complex_query_param_get_validation(query_params); @@ -420,7 +409,7 @@ where let resp = match result { Ok(rsp) => match rsp { - JsonComplexQueryParamGetResponse::Status200_Success => { + apis::default::JsonComplexQueryParamGetResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -457,7 +446,7 @@ async fn mandatory_request_header_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { // Header parameters let header_params = { @@ -510,7 +499,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MandatoryRequestHeaderGetResponse::Status200_Success => { + apis::default::MandatoryRequestHeaderGetResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -542,7 +531,7 @@ async fn merge_patch_json_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = merge_patch_json_get_validation(); @@ -562,7 +551,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MergePatchJsonGetResponse::Status200_Merge(body) => { + apis::default::MergePatchJsonGetResponse::Status200_Merge(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -613,7 +602,7 @@ async fn multiget_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = multiget_get_validation(); @@ -630,7 +619,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MultigetGetResponse::Status200_JSONRsp(body) => { + apis::default::MultigetGetResponse::Status200_JSONRsp(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -653,7 +642,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - MultigetGetResponse::Status201_XMLRsp(body) => { + apis::default::MultigetGetResponse::Status201_XMLRsp(body) => { let mut response = response.status(201); { let mut response_headers = response.headers_mut().unwrap(); @@ -669,7 +658,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - MultigetGetResponse::Status202_OctetRsp(body) => { + apis::default::MultigetGetResponse::Status202_OctetRsp(body) => { let mut response = response.status(202); { let mut response_headers = response.headers_mut().unwrap(); @@ -685,7 +674,7 @@ where let body_content = body.0; response.body(Body::from(body_content)) } - MultigetGetResponse::Status203_StringRsp(body) => { + apis::default::MultigetGetResponse::Status203_StringRsp(body) => { let mut response = response.status(203); { let mut response_headers = response.headers_mut().unwrap(); @@ -701,7 +690,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - MultigetGetResponse::Status204_DuplicateResponseLongText(body) => { + apis::default::MultigetGetResponse::Status204_DuplicateResponseLongText(body) => { let mut response = response.status(204); { let mut response_headers = response.headers_mut().unwrap(); @@ -724,7 +713,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - MultigetGetResponse::Status205_DuplicateResponseLongText(body) => { + apis::default::MultigetGetResponse::Status205_DuplicateResponseLongText(body) => { let mut response = response.status(205); { let mut response_headers = response.headers_mut().unwrap(); @@ -747,7 +736,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - MultigetGetResponse::Status206_DuplicateResponseLongText(body) => { + apis::default::MultigetGetResponse::Status206_DuplicateResponseLongText(body) => { let mut response = response.status(206); { let mut response_headers = response.headers_mut().unwrap(); @@ -798,7 +787,7 @@ async fn multiple_auth_scheme_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = multiple_auth_scheme_get_validation(); @@ -818,7 +807,7 @@ where let resp = match result { Ok(rsp) => match rsp { - MultipleAuthSchemeGetResponse::Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks + apis::default::MultipleAuthSchemeGetResponse::Status200_CheckThatLimitingToMultipleRequiredAuthSchemesWorks => { let mut response = response.status(200); @@ -852,7 +841,7 @@ async fn one_of_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = one_of_get_validation(); @@ -869,7 +858,7 @@ where let resp = match result { Ok(rsp) => match rsp { - OneOfGetResponse::Status200_Success(body) => { + apis::default::OneOfGetResponse::Status200_Success(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -920,7 +909,7 @@ async fn override_server_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = override_server_get_validation(); @@ -940,7 +929,7 @@ where let resp = match result { Ok(rsp) => match rsp { - OverrideServerGetResponse::Status204_Success => { + apis::default::OverrideServerGetResponse::Status204_Success => { let mut response = response.status(204); response.body(Body::empty()) } @@ -977,7 +966,7 @@ async fn paramget_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = paramget_get_validation(query_params); @@ -997,7 +986,7 @@ where let resp = match result { Ok(rsp) => match rsp { - ParamgetGetResponse::Status200_JSONRsp(body) => { + apis::default::ParamgetGetResponse::Status200_JSONRsp(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1048,7 +1037,7 @@ async fn readonly_auth_scheme_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = readonly_auth_scheme_get_validation(); @@ -1068,7 +1057,7 @@ where let resp = match result { Ok(rsp) => match rsp { - ReadonlyAuthSchemeGetResponse::Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks + apis::default::ReadonlyAuthSchemeGetResponse::Status200_CheckThatLimitingToASingleRequiredAuthSchemeWorks => { let mut response = response.status(200); @@ -1107,7 +1096,7 @@ async fn register_callback_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = register_callback_post_validation(query_params); @@ -1127,7 +1116,7 @@ where let resp = match result { Ok(rsp) => match rsp { - RegisterCallbackPostResponse::Status204_OK => { + apis::default::RegisterCallbackPostResponse::Status204_OK => { let mut response = response.status(204); response.body(Body::empty()) } @@ -1168,7 +1157,7 @@ async fn required_octet_stream_put( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = required_octet_stream_put_validation(body); @@ -1188,7 +1177,7 @@ where let resp = match result { Ok(rsp) => match rsp { - RequiredOctetStreamPutResponse::Status200_OK => { + apis::default::RequiredOctetStreamPutResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1220,7 +1209,7 @@ async fn responses_with_headers_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = responses_with_headers_get_validation(); @@ -1240,7 +1229,7 @@ where let resp = match result { Ok(rsp) => match rsp { - ResponsesWithHeadersGetResponse::Status200_Success { + apis::default::ResponsesWithHeadersGetResponse::Status200_Success { body, success_info, bool_header, @@ -1312,7 +1301,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - ResponsesWithHeadersGetResponse::Status412_PreconditionFailed { + apis::default::ResponsesWithHeadersGetResponse::Status412_PreconditionFailed { further_info, failure_info, } => { @@ -1378,7 +1367,7 @@ async fn rfc7807_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = rfc7807_get_validation(); @@ -1395,7 +1384,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Rfc7807GetResponse::Status204_OK(body) => { + apis::default::Rfc7807GetResponse::Status204_OK(body) => { let mut response = response.status(204); { let mut response_headers = response.headers_mut().unwrap(); @@ -1418,7 +1407,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - Rfc7807GetResponse::Status404_NotFound(body) => { + apis::default::Rfc7807GetResponse::Status404_NotFound(body) => { let mut response = response.status(404); { let mut response_headers = response.headers_mut().unwrap(); @@ -1441,7 +1430,7 @@ where .unwrap()?; response.body(Body::from(body_content)) } - Rfc7807GetResponse::Status406_NotAcceptable(body) => { + apis::default::Rfc7807GetResponse::Status406_NotAcceptable(body) => { let mut response = response.status(406); { let mut response_headers = response.headers_mut().unwrap(); @@ -1500,7 +1489,7 @@ async fn untyped_property_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = untyped_property_get_validation(body); @@ -1519,18 +1508,20 @@ where let mut response = Response::builder(); let resp = match result { - Ok(rsp) => match rsp { - UntypedPropertyGetResponse::Status200_CheckThatUntypedPropertiesWorks => { - let mut response = response.status(200); - response.body(Body::empty()) - } - }, - Err(_) => { - // Application code returned an error. This should not happen, as the implementation should - // return a valid response. - response.status(500).body(Body::empty()) - } - }; + Ok(rsp) => match rsp { + apis::default::UntypedPropertyGetResponse::Status200_CheckThatUntypedPropertiesWorks + => { + + let mut response = response.status(200); + response.body(Body::empty()) + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.status(500).body(Body::empty()) + }, + }; resp.map_err(|e| { error!(error = ?e); @@ -1552,7 +1543,7 @@ async fn uuid_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = uuid_get_validation(); @@ -1569,7 +1560,7 @@ where let resp = match result { Ok(rsp) => match rsp { - UuidGetResponse::Status200_DuplicateResponseLongText(body) => { + apis::default::UuidGetResponse::Status200_DuplicateResponseLongText(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1627,7 +1618,7 @@ async fn xml_extra_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = xml_extra_post_validation(body); @@ -1647,11 +1638,11 @@ where let resp = match result { Ok(rsp) => match rsp { - XmlExtraPostResponse::Status201_OK => { + apis::default::XmlExtraPostResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } - XmlExtraPostResponse::Status400_BadRequest => { + apis::default::XmlExtraPostResponse::Status400_BadRequest => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1690,7 +1681,7 @@ async fn xml_other_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = xml_other_post_validation(body); @@ -1710,7 +1701,7 @@ where let resp = match result { Ok(rsp) => match rsp { - XmlOtherPostResponse::Status201_OK(body) => { + apis::default::XmlOtherPostResponse::Status201_OK(body) => { let mut response = response.status(201); { let mut response_headers = response.headers_mut().unwrap(); @@ -1726,7 +1717,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - XmlOtherPostResponse::Status400_BadRequest => { + apis::default::XmlOtherPostResponse::Status400_BadRequest => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1765,7 +1756,7 @@ async fn xml_other_put( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = xml_other_put_validation(body); @@ -1785,11 +1776,11 @@ where let resp = match result { Ok(rsp) => match rsp { - XmlOtherPutResponse::Status201_OK => { + apis::default::XmlOtherPutResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } - XmlOtherPutResponse::Status400_BadRequest => { + apis::default::XmlOtherPutResponse::Status400_BadRequest => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1828,7 +1819,7 @@ async fn xml_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = xml_post_validation(body); @@ -1848,11 +1839,11 @@ where let resp = match result { Ok(rsp) => match rsp { - XmlPostResponse::Status201_OK => { + apis::default::XmlPostResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } - XmlPostResponse::Status400_BadRequest => { + apis::default::XmlPostResponse::Status400_BadRequest => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1891,7 +1882,7 @@ async fn xml_put( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { let validation = xml_put_validation(body); @@ -1908,11 +1899,11 @@ where let resp = match result { Ok(rsp) => match rsp { - XmlPutResponse::Status201_OK => { + apis::default::XmlPutResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } - XmlPutResponse::Status400_BadRequest => { + apis::default::XmlPutResponse::Status400_BadRequest => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1930,6 +1921,82 @@ where }) } +#[tracing::instrument(skip_all)] +fn get_repo_info_validation( + path_params: models::GetRepoInfoPathParams, +) -> std::result::Result<(models::GetRepoInfoPathParams,), ValidationErrors> { + path_params.validate()?; + + Ok((path_params,)) +} +/// GetRepoInfo - GET /repos/{repoId} +#[tracing::instrument(skip_all)] +async fn get_repo_info( + method: Method, + host: Host, + cookies: CookieJar, + Path(path_params): Path, + State(api_impl): State, +) -> Result +where + I: AsRef + Send + Sync, + A: apis::info_repo::InfoRepo, +{ + let validation = get_repo_info_validation(path_params); + + let Ok((path_params,)) = validation else { + return Response::builder() + .status(StatusCode::BAD_REQUEST) + .body(Body::from(validation.unwrap_err().to_string())) + .map_err(|_| StatusCode::BAD_REQUEST); + }; + + let result = api_impl + .as_ref() + .get_repo_info(method, host, cookies, path_params) + .await; + + let mut response = Response::builder(); + + let resp = match result { + Ok(rsp) => match rsp { + apis::info_repo::GetRepoInfoResponse::Status200_OK(body) => { + let mut response = response.status(200); + { + let mut response_headers = response.headers_mut().unwrap(); + response_headers.insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json").map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + })?, + ); + } + + let body_content = tokio::task::spawn_blocking(move || { + serde_json::to_vec(&body).map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }) + }) + .await + .unwrap()?; + response.body(Body::from(body_content)) + } + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.status(500).body(Body::empty()) + } + }; + + resp.map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }) +} + #[derive(validator::Validate)] #[allow(dead_code)] struct CreateRepoBodyValidator<'a> { @@ -1957,7 +2024,7 @@ async fn create_repo( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::repo::Repo, { let validation = create_repo_validation(body); @@ -1977,7 +2044,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateRepoResponse::Status200_Success => { + apis::repo::CreateRepoResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1994,79 +2061,3 @@ where StatusCode::INTERNAL_SERVER_ERROR }) } - -#[tracing::instrument(skip_all)] -fn get_repo_info_validation( - path_params: models::GetRepoInfoPathParams, -) -> std::result::Result<(models::GetRepoInfoPathParams,), ValidationErrors> { - path_params.validate()?; - - Ok((path_params,)) -} -/// GetRepoInfo - GET /repos/{repoId} -#[tracing::instrument(skip_all)] -async fn get_repo_info( - method: Method, - host: Host, - cookies: CookieJar, - Path(path_params): Path, - State(api_impl): State, -) -> Result -where - I: AsRef + Send + Sync, - A: Api, -{ - let validation = get_repo_info_validation(path_params); - - let Ok((path_params,)) = validation else { - return Response::builder() - .status(StatusCode::BAD_REQUEST) - .body(Body::from(validation.unwrap_err().to_string())) - .map_err(|_| StatusCode::BAD_REQUEST); - }; - - let result = api_impl - .as_ref() - .get_repo_info(method, host, cookies, path_params) - .await; - - let mut response = Response::builder(); - - let resp = match result { - Ok(rsp) => match rsp { - GetRepoInfoResponse::Status200_OK(body) => { - let mut response = response.status(200); - { - let mut response_headers = response.headers_mut().unwrap(); - response_headers.insert( - CONTENT_TYPE, - HeaderValue::from_str("application/json").map_err(|e| { - error!(error = ?e); - StatusCode::INTERNAL_SERVER_ERROR - })?, - ); - } - - let body_content = tokio::task::spawn_blocking(move || { - serde_json::to_vec(&body).map_err(|e| { - error!(error = ?e); - StatusCode::INTERNAL_SERVER_ERROR - }) - }) - .await - .unwrap()?; - response.body(Body::from(body_content)) - } - }, - Err(_) => { - // Application code returned an error. This should not happen, as the implementation should - // return a valid response. - response.status(500).body(Body::empty()) - } - }; - - resp.map_err(|e| { - error!(error = ?e); - StatusCode::INTERNAL_SERVER_ERROR - }) -} diff --git a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES index ea1c5b8c5be..683914c4c64 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore Cargo.toml README.md +src/apis/default.rs +src/apis/mod.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ops-v3/README.md b/samples/server/petstore/rust-axum/output/ops-v3/README.md index 3cf44f6b023..9be673f9440 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/README.md +++ b/samples/server/petstore/rust-axum/output/ops-v3/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 0.0.1 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs new file mode 100644 index 00000000000..c24558c161d --- /dev/null +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/default.rs @@ -0,0 +1,605 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op10GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op11GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op12GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op13GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op14GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op15GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op16GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op17GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op18GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op19GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op1GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op20GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op21GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op22GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op23GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op24GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op25GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op26GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op27GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op28GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op29GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op2GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op30GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op31GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op32GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op33GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op34GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op35GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op36GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op37GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op3GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op4GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op5GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op6GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op7GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op8GetResponse { + /// OK + Status200_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Op9GetResponse { + /// OK + Status200_OK, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// Op10Get - GET /op10 + async fn op10_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op11Get - GET /op11 + async fn op11_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op12Get - GET /op12 + async fn op12_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op13Get - GET /op13 + async fn op13_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op14Get - GET /op14 + async fn op14_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op15Get - GET /op15 + async fn op15_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op16Get - GET /op16 + async fn op16_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op17Get - GET /op17 + async fn op17_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op18Get - GET /op18 + async fn op18_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op19Get - GET /op19 + async fn op19_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op1Get - GET /op1 + async fn op1_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op20Get - GET /op20 + async fn op20_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op21Get - GET /op21 + async fn op21_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op22Get - GET /op22 + async fn op22_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op23Get - GET /op23 + async fn op23_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op24Get - GET /op24 + async fn op24_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op25Get - GET /op25 + async fn op25_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op26Get - GET /op26 + async fn op26_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op27Get - GET /op27 + async fn op27_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op28Get - GET /op28 + async fn op28_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op29Get - GET /op29 + async fn op29_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op2Get - GET /op2 + async fn op2_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op30Get - GET /op30 + async fn op30_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op31Get - GET /op31 + async fn op31_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op32Get - GET /op32 + async fn op32_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op33Get - GET /op33 + async fn op33_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op34Get - GET /op34 + async fn op34_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op35Get - GET /op35 + async fn op35_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op36Get - GET /op36 + async fn op36_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op37Get - GET /op37 + async fn op37_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op3Get - GET /op3 + async fn op3_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op4Get - GET /op4 + async fn op4_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op5Get - GET /op5 + async fn op5_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op6Get - GET /op6 + async fn op6_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op7Get - GET /op7 + async fn op7_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op8Get - GET /op8 + async fn op8_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Op9Get - GET /op9 + async fn op9_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs index 19337219b02..bfdd7c89923 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs @@ -8,620 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "0.0.1"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op10GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op11GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op12GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op13GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op14GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op15GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op16GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op17GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op18GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op19GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op1GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op20GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op21GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op22GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op23GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op24GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op25GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op26GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op27GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op28GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op29GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op2GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op30GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op31GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op32GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op33GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op34GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op35GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op36GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op37GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op3GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op4GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op5GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op6GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op7GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op8GetResponse { - /// OK - Status200_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Op9GetResponse { - /// OK - Status200_OK, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// Op10Get - GET /op10 - async fn op10_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op11Get - GET /op11 - async fn op11_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op12Get - GET /op12 - async fn op12_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op13Get - GET /op13 - async fn op13_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op14Get - GET /op14 - async fn op14_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op15Get - GET /op15 - async fn op15_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op16Get - GET /op16 - async fn op16_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op17Get - GET /op17 - async fn op17_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op18Get - GET /op18 - async fn op18_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op19Get - GET /op19 - async fn op19_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op1Get - GET /op1 - async fn op1_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op20Get - GET /op20 - async fn op20_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op21Get - GET /op21 - async fn op21_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op22Get - GET /op22 - async fn op22_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op23Get - GET /op23 - async fn op23_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op24Get - GET /op24 - async fn op24_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op25Get - GET /op25 - async fn op25_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op26Get - GET /op26 - async fn op26_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op27Get - GET /op27 - async fn op27_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op28Get - GET /op28 - async fn op28_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op29Get - GET /op29 - async fn op29_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op2Get - GET /op2 - async fn op2_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op30Get - GET /op30 - async fn op30_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op31Get - GET /op31 - async fn op31_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op32Get - GET /op32 - async fn op32_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op33Get - GET /op33 - async fn op33_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op34Get - GET /op34 - async fn op34_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op35Get - GET /op35 - async fn op35_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op36Get - GET /op36 - async fn op36_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op37Get - GET /op37 - async fn op37_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op3Get - GET /op3 - async fn op3_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op4Get - GET /op4 - async fn op4_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op5Get - GET /op5 - async fn op5_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op6Get - GET /op6 - async fn op6_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op7Get - GET /op7 - async fn op7_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op8Get - GET /op8 - async fn op8_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Op9Get - GET /op9 - async fn op9_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs index e9bc23c2cd3..a8b3ed89bc7 100644 --- a/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ops-v3/src/server/mod.rs @@ -10,24 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - Api, Op10GetResponse, Op11GetResponse, Op12GetResponse, Op13GetResponse, Op14GetResponse, - Op15GetResponse, Op16GetResponse, Op17GetResponse, Op18GetResponse, Op19GetResponse, - Op1GetResponse, Op20GetResponse, Op21GetResponse, Op22GetResponse, Op23GetResponse, - Op24GetResponse, Op25GetResponse, Op26GetResponse, Op27GetResponse, Op28GetResponse, - Op29GetResponse, Op2GetResponse, Op30GetResponse, Op31GetResponse, Op32GetResponse, - Op33GetResponse, Op34GetResponse, Op35GetResponse, Op36GetResponse, Op37GetResponse, - Op3GetResponse, Op4GetResponse, Op5GetResponse, Op6GetResponse, Op7GetResponse, Op8GetResponse, - Op9GetResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::default::Default + 'static, { // build our application with a route Router::new() @@ -85,7 +74,7 @@ async fn op10_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op10_get_validation()) @@ -105,7 +94,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op10GetResponse::Status200_OK => { + apis::default::Op10GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -137,7 +126,7 @@ async fn op11_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op11_get_validation()) @@ -157,7 +146,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op11GetResponse::Status200_OK => { + apis::default::Op11GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -189,7 +178,7 @@ async fn op12_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op12_get_validation()) @@ -209,7 +198,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op12GetResponse::Status200_OK => { + apis::default::Op12GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -241,7 +230,7 @@ async fn op13_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op13_get_validation()) @@ -261,7 +250,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op13GetResponse::Status200_OK => { + apis::default::Op13GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -293,7 +282,7 @@ async fn op14_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op14_get_validation()) @@ -313,7 +302,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op14GetResponse::Status200_OK => { + apis::default::Op14GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -345,7 +334,7 @@ async fn op15_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op15_get_validation()) @@ -365,7 +354,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op15GetResponse::Status200_OK => { + apis::default::Op15GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -397,7 +386,7 @@ async fn op16_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op16_get_validation()) @@ -417,7 +406,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op16GetResponse::Status200_OK => { + apis::default::Op16GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -449,7 +438,7 @@ async fn op17_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op17_get_validation()) @@ -469,7 +458,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op17GetResponse::Status200_OK => { + apis::default::Op17GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -501,7 +490,7 @@ async fn op18_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op18_get_validation()) @@ -521,7 +510,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op18GetResponse::Status200_OK => { + apis::default::Op18GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -553,7 +542,7 @@ async fn op19_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op19_get_validation()) @@ -573,7 +562,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op19GetResponse::Status200_OK => { + apis::default::Op19GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -605,7 +594,7 @@ async fn op1_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op1_get_validation()) @@ -625,7 +614,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op1GetResponse::Status200_OK => { + apis::default::Op1GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -657,7 +646,7 @@ async fn op20_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op20_get_validation()) @@ -677,7 +666,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op20GetResponse::Status200_OK => { + apis::default::Op20GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -709,7 +698,7 @@ async fn op21_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op21_get_validation()) @@ -729,7 +718,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op21GetResponse::Status200_OK => { + apis::default::Op21GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -761,7 +750,7 @@ async fn op22_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op22_get_validation()) @@ -781,7 +770,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op22GetResponse::Status200_OK => { + apis::default::Op22GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -813,7 +802,7 @@ async fn op23_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op23_get_validation()) @@ -833,7 +822,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op23GetResponse::Status200_OK => { + apis::default::Op23GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -865,7 +854,7 @@ async fn op24_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op24_get_validation()) @@ -885,7 +874,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op24GetResponse::Status200_OK => { + apis::default::Op24GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -917,7 +906,7 @@ async fn op25_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op25_get_validation()) @@ -937,7 +926,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op25GetResponse::Status200_OK => { + apis::default::Op25GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -969,7 +958,7 @@ async fn op26_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op26_get_validation()) @@ -989,7 +978,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op26GetResponse::Status200_OK => { + apis::default::Op26GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1021,7 +1010,7 @@ async fn op27_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op27_get_validation()) @@ -1041,7 +1030,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op27GetResponse::Status200_OK => { + apis::default::Op27GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1073,7 +1062,7 @@ async fn op28_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op28_get_validation()) @@ -1093,7 +1082,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op28GetResponse::Status200_OK => { + apis::default::Op28GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1125,7 +1114,7 @@ async fn op29_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op29_get_validation()) @@ -1145,7 +1134,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op29GetResponse::Status200_OK => { + apis::default::Op29GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1177,7 +1166,7 @@ async fn op2_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op2_get_validation()) @@ -1197,7 +1186,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op2GetResponse::Status200_OK => { + apis::default::Op2GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1229,7 +1218,7 @@ async fn op30_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op30_get_validation()) @@ -1249,7 +1238,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op30GetResponse::Status200_OK => { + apis::default::Op30GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1281,7 +1270,7 @@ async fn op31_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op31_get_validation()) @@ -1301,7 +1290,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op31GetResponse::Status200_OK => { + apis::default::Op31GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1333,7 +1322,7 @@ async fn op32_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op32_get_validation()) @@ -1353,7 +1342,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op32GetResponse::Status200_OK => { + apis::default::Op32GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1385,7 +1374,7 @@ async fn op33_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op33_get_validation()) @@ -1405,7 +1394,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op33GetResponse::Status200_OK => { + apis::default::Op33GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1437,7 +1426,7 @@ async fn op34_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op34_get_validation()) @@ -1457,7 +1446,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op34GetResponse::Status200_OK => { + apis::default::Op34GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1489,7 +1478,7 @@ async fn op35_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op35_get_validation()) @@ -1509,7 +1498,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op35GetResponse::Status200_OK => { + apis::default::Op35GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1541,7 +1530,7 @@ async fn op36_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op36_get_validation()) @@ -1561,7 +1550,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op36GetResponse::Status200_OK => { + apis::default::Op36GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1593,7 +1582,7 @@ async fn op37_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op37_get_validation()) @@ -1613,7 +1602,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op37GetResponse::Status200_OK => { + apis::default::Op37GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1645,7 +1634,7 @@ async fn op3_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op3_get_validation()) @@ -1665,7 +1654,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op3GetResponse::Status200_OK => { + apis::default::Op3GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1697,7 +1686,7 @@ async fn op4_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op4_get_validation()) @@ -1717,7 +1706,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op4GetResponse::Status200_OK => { + apis::default::Op4GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1749,7 +1738,7 @@ async fn op5_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op5_get_validation()) @@ -1769,7 +1758,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op5GetResponse::Status200_OK => { + apis::default::Op5GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1801,7 +1790,7 @@ async fn op6_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op6_get_validation()) @@ -1821,7 +1810,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op6GetResponse::Status200_OK => { + apis::default::Op6GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1853,7 +1842,7 @@ async fn op7_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op7_get_validation()) @@ -1873,7 +1862,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op7GetResponse::Status200_OK => { + apis::default::Op7GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1905,7 +1894,7 @@ async fn op8_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op8_get_validation()) @@ -1925,7 +1914,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op8GetResponse::Status200_OK => { + apis::default::Op8GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1957,7 +1946,7 @@ async fn op9_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || op9_get_validation()) @@ -1977,7 +1966,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Op9GetResponse::Status200_OK => { + apis::default::Op9GetResponse::Status200_OK => { let mut response = response.status(200); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES index ea1c5b8c5be..c4774ff1a7c 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES @@ -1,6 +1,13 @@ .gitignore Cargo.toml README.md +src/apis/another_fake.rs +src/apis/fake.rs +src/apis/fake_classname_tags123.rs +src/apis/mod.rs +src/apis/pet.rs +src/apis/store.rs +src/apis/user.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md index e48c2df3d01..69a87cb8bb1 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.0 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs new file mode 100644 index 00000000000..99c6307abe8 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/another_fake.rs @@ -0,0 +1,32 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestSpecialTagsResponse { + /// successful operation + Status200_SuccessfulOperation(models::Client), +} + +/// AnotherFake +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait AnotherFake { + /// To test special tags. + /// + /// TestSpecialTags - PATCH /v2/another-fake/dummy + async fn test_special_tags( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Client, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs new file mode 100644 index 00000000000..38c5c477b25 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake.rs @@ -0,0 +1,249 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum Call123exampleResponse { + /// success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FakeOuterBooleanSerializeResponse { + /// Output boolean + Status200_OutputBoolean(bool), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FakeOuterCompositeSerializeResponse { + /// Output composite + Status200_OutputComposite(models::OuterComposite), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FakeOuterNumberSerializeResponse { + /// Output number + Status200_OutputNumber(f64), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FakeOuterStringSerializeResponse { + /// Output string + Status200_OutputString(String), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FakeResponseWithNumericalDescriptionResponse { + /// 1234 + Status200, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum HyphenParamResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestBodyWithQueryParamsResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestClientModelResponse { + /// successful operation + Status200_SuccessfulOperation(models::Client), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestEndpointParametersResponse { + /// Invalid username supplied + Status400_InvalidUsernameSupplied, + /// User not found + Status404_UserNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestEnumParametersResponse { + /// Invalid request + Status400_InvalidRequest, + /// Not found + Status404_NotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestInlineAdditionalPropertiesResponse { + /// successful operation + Status200_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestJsonFormDataResponse { + /// successful operation + Status200_SuccessfulOperation, +} + +/// Fake +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Fake { + /// Call123example - GET /v2/fake/operation-with-numeric-id + async fn call123example( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// FakeOuterBooleanSerialize - POST /v2/fake/outer/boolean + async fn fake_outer_boolean_serialize( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Option, + ) -> Result; + + /// FakeOuterCompositeSerialize - POST /v2/fake/outer/composite + async fn fake_outer_composite_serialize( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Option, + ) -> Result; + + /// FakeOuterNumberSerialize - POST /v2/fake/outer/number + async fn fake_outer_number_serialize( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Option, + ) -> Result; + + /// FakeOuterStringSerialize - POST /v2/fake/outer/string + async fn fake_outer_string_serialize( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Option, + ) -> Result; + + /// FakeResponseWithNumericalDescription - GET /v2/fake/response-with-numerical-description + async fn fake_response_with_numerical_description( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// HyphenParam - GET /v2/fake/hyphenParam/{hyphen-param} + async fn hyphen_param( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::HyphenParamPathParams, + ) -> Result; + + /// TestBodyWithQueryParams - PUT /v2/fake/body-with-query-params + async fn test_body_with_query_params( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::TestBodyWithQueryParamsQueryParams, + body: models::User, + ) -> Result; + + /// To test \"client\" model. + /// + /// TestClientModel - PATCH /v2/fake + async fn test_client_model( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Client, + ) -> Result; + + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. + /// + /// TestEndpointParameters - POST /v2/fake + async fn test_endpoint_parameters( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::TestEndpointParametersRequest, + ) -> Result; + + /// To test enum parameters. + /// + /// TestEnumParameters - GET /v2/fake + async fn test_enum_parameters( + &self, + method: Method, + host: Host, + cookies: CookieJar, + header_params: models::TestEnumParametersHeaderParams, + query_params: models::TestEnumParametersQueryParams, + body: Option, + ) -> Result; + + /// test inline additionalProperties. + /// + /// TestInlineAdditionalProperties - POST /v2/fake/inline-additionalProperties + async fn test_inline_additional_properties( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: std::collections::HashMap, + ) -> Result; + + /// test json serialization of form data. + /// + /// TestJsonFormData - GET /v2/fake/jsonFormData + async fn test_json_form_data( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::TestJsonFormDataRequest, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs new file mode 100644 index 00000000000..dbc5f4b6184 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/fake_classname_tags123.rs @@ -0,0 +1,32 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum TestClassnameResponse { + /// successful operation + Status200_SuccessfulOperation(models::Client), +} + +/// FakeClassnameTags123 +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait FakeClassnameTags123 { + /// To test class name in snake case. + /// + /// TestClassname - PATCH /v2/fake_classname_test + async fn test_classname( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Client, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs new file mode 100644 index 00000000000..fa714e56bee --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/mod.rs @@ -0,0 +1,6 @@ +pub mod another_fake; +pub mod fake; +pub mod fake_classname_tags123; +pub mod pet; +pub mod store; +pub mod user; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs new file mode 100644 index 00000000000..f2c36cd51af --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/pet.rs @@ -0,0 +1,180 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum AddPetResponse { + /// Invalid input + Status405_InvalidInput, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeletePetResponse { + /// Invalid pet value + Status400_InvalidPetValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FindPetsByStatusResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid status value + Status400_InvalidStatusValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FindPetsByTagsResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid tag value + Status400_InvalidTagValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetPetByIdResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Pet not found + Status404_PetNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdatePetResponse { + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Pet not found + Status404_PetNotFound, + /// Validation exception + Status405_ValidationException, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdatePetWithFormResponse { + /// Invalid input + Status405_InvalidInput, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UploadFileResponse { + /// successful operation + Status200_SuccessfulOperation(models::ApiResponse), +} + +/// Pet +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Pet { + /// Add a new pet to the store. + /// + /// AddPet - POST /v2/pet + async fn add_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Pet, + ) -> Result; + + /// Deletes a pet. + /// + /// DeletePet - DELETE /v2/pet/{petId} + async fn delete_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + header_params: models::DeletePetHeaderParams, + path_params: models::DeletePetPathParams, + ) -> Result; + + /// Finds Pets by status. + /// + /// FindPetsByStatus - GET /v2/pet/findByStatus + async fn find_pets_by_status( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::FindPetsByStatusQueryParams, + ) -> Result; + + /// Finds Pets by tags. + /// + /// FindPetsByTags - GET /v2/pet/findByTags + async fn find_pets_by_tags( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::FindPetsByTagsQueryParams, + ) -> Result; + + /// Find pet by ID. + /// + /// GetPetById - GET /v2/pet/{petId} + async fn get_pet_by_id( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetPetByIdPathParams, + ) -> Result; + + /// Update an existing pet. + /// + /// UpdatePet - PUT /v2/pet + async fn update_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Pet, + ) -> Result; + + /// Updates a pet in the store with form data. + /// + /// UpdatePetWithForm - POST /v2/pet/{petId} + async fn update_pet_with_form( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UpdatePetWithFormPathParams, + body: Option, + ) -> Result; + + /// uploads an image. + /// + /// UploadFile - POST /v2/pet/{petId}/uploadImage + async fn upload_file( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UploadFilePathParams, + body: Multipart, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs new file mode 100644 index 00000000000..607bf6f568f --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/store.rs @@ -0,0 +1,96 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeleteOrderResponse { + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Order not found + Status404_OrderNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetInventoryResponse { + /// successful operation + Status200_SuccessfulOperation(std::collections::HashMap), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetOrderByIdResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Order not found + Status404_OrderNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum PlaceOrderResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid Order + Status400_InvalidOrder, +} + +/// Store +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Store { + /// Delete purchase order by ID. + /// + /// DeleteOrder - DELETE /v2/store/order/{order_id} + async fn delete_order( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::DeleteOrderPathParams, + ) -> Result; + + /// Returns pet inventories by status. + /// + /// GetInventory - GET /v2/store/inventory + async fn get_inventory( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Find purchase order by ID. + /// + /// GetOrderById - GET /v2/store/order/{order_id} + async fn get_order_by_id( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetOrderByIdPathParams, + ) -> Result; + + /// Place an order for a pet. + /// + /// PlaceOrder - POST /v2/store/order + async fn place_order( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Order, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs new file mode 100644 index 00000000000..ba3e68d8424 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/apis/user.rs @@ -0,0 +1,179 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUserResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUsersWithArrayInputResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUsersWithListInputResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeleteUserResponse { + /// Invalid username supplied + Status400_InvalidUsernameSupplied, + /// User not found + Status404_UserNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetUserByNameResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid username supplied + Status400_InvalidUsernameSupplied, + /// User not found + Status404_UserNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum LoginUserResponse { + /// successful operation + Status200_SuccessfulOperation { + body: String, + x_rate_limit: Option, + x_expires_after: Option>, + }, + /// Invalid username/password supplied + Status400_InvalidUsername, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum LogoutUserResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdateUserResponse { + /// Invalid user supplied + Status400_InvalidUserSupplied, + /// User not found + Status404_UserNotFound, +} + +/// User +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait User { + /// Create user. + /// + /// CreateUser - POST /v2/user + async fn create_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::User, + ) -> Result; + + /// Creates list of users with given input array. + /// + /// CreateUsersWithArrayInput - POST /v2/user/createWithArray + async fn create_users_with_array_input( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Vec, + ) -> Result; + + /// Creates list of users with given input array. + /// + /// CreateUsersWithListInput - POST /v2/user/createWithList + async fn create_users_with_list_input( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Vec, + ) -> Result; + + /// Delete user. + /// + /// DeleteUser - DELETE /v2/user/{username} + async fn delete_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::DeleteUserPathParams, + ) -> Result; + + /// Get user by user name. + /// + /// GetUserByName - GET /v2/user/{username} + async fn get_user_by_name( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetUserByNamePathParams, + ) -> Result; + + /// Logs user into the system. + /// + /// LoginUser - GET /v2/user/login + async fn login_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::LoginUserQueryParams, + ) -> Result; + + /// Logs out current logged in user session. + /// + /// LogoutUser - GET /v2/user/logout + async fn logout_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Updated user. + /// + /// UpdateUser - PUT /v2/user/{username} + async fn update_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UpdateUserPathParams, + body: models::User, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 5cc0e76a1a5..91d8f87a36a 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -8,714 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = "/v2"; pub const API_VERSION: &str = "1.0.0"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestSpecialTagsResponse { - /// successful operation - Status200_SuccessfulOperation(models::Client), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum Call123exampleResponse { - /// success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FakeOuterBooleanSerializeResponse { - /// Output boolean - Status200_OutputBoolean(bool), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FakeOuterCompositeSerializeResponse { - /// Output composite - Status200_OutputComposite(models::OuterComposite), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FakeOuterNumberSerializeResponse { - /// Output number - Status200_OutputNumber(f64), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FakeOuterStringSerializeResponse { - /// Output string - Status200_OutputString(String), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FakeResponseWithNumericalDescriptionResponse { - /// 1234 - Status200, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum HyphenParamResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestBodyWithQueryParamsResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestClientModelResponse { - /// successful operation - Status200_SuccessfulOperation(models::Client), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestEndpointParametersResponse { - /// Invalid username supplied - Status400_InvalidUsernameSupplied, - /// User not found - Status404_UserNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestEnumParametersResponse { - /// Invalid request - Status400_InvalidRequest, - /// Not found - Status404_NotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestInlineAdditionalPropertiesResponse { - /// successful operation - Status200_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestJsonFormDataResponse { - /// successful operation - Status200_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum TestClassnameResponse { - /// successful operation - Status200_SuccessfulOperation(models::Client), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum AddPetResponse { - /// Invalid input - Status405_InvalidInput, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeletePetResponse { - /// Invalid pet value - Status400_InvalidPetValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FindPetsByStatusResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid status value - Status400_InvalidStatusValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FindPetsByTagsResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid tag value - Status400_InvalidTagValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetPetByIdResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Pet not found - Status404_PetNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdatePetResponse { - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Pet not found - Status404_PetNotFound, - /// Validation exception - Status405_ValidationException, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdatePetWithFormResponse { - /// Invalid input - Status405_InvalidInput, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UploadFileResponse { - /// successful operation - Status200_SuccessfulOperation(models::ApiResponse), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeleteOrderResponse { - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Order not found - Status404_OrderNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetInventoryResponse { - /// successful operation - Status200_SuccessfulOperation(std::collections::HashMap), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetOrderByIdResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Order not found - Status404_OrderNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum PlaceOrderResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid Order - Status400_InvalidOrder, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUserResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUsersWithArrayInputResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUsersWithListInputResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeleteUserResponse { - /// Invalid username supplied - Status400_InvalidUsernameSupplied, - /// User not found - Status404_UserNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetUserByNameResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid username supplied - Status400_InvalidUsernameSupplied, - /// User not found - Status404_UserNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum LoginUserResponse { - /// successful operation - Status200_SuccessfulOperation { - body: String, - x_rate_limit: Option, - x_expires_after: Option>, - }, - /// Invalid username/password supplied - Status400_InvalidUsername, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum LogoutUserResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdateUserResponse { - /// Invalid user supplied - Status400_InvalidUserSupplied, - /// User not found - Status404_UserNotFound, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// To test special tags. - /// - /// TestSpecialTags - PATCH /v2/another-fake/dummy - async fn test_special_tags( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Client, - ) -> Result; - - /// Call123example - GET /v2/fake/operation-with-numeric-id - async fn call123example( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// FakeOuterBooleanSerialize - POST /v2/fake/outer/boolean - async fn fake_outer_boolean_serialize( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Option, - ) -> Result; - - /// FakeOuterCompositeSerialize - POST /v2/fake/outer/composite - async fn fake_outer_composite_serialize( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Option, - ) -> Result; - - /// FakeOuterNumberSerialize - POST /v2/fake/outer/number - async fn fake_outer_number_serialize( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Option, - ) -> Result; - - /// FakeOuterStringSerialize - POST /v2/fake/outer/string - async fn fake_outer_string_serialize( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Option, - ) -> Result; - - /// FakeResponseWithNumericalDescription - GET /v2/fake/response-with-numerical-description - async fn fake_response_with_numerical_description( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// HyphenParam - GET /v2/fake/hyphenParam/{hyphen-param} - async fn hyphen_param( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::HyphenParamPathParams, - ) -> Result; - - /// TestBodyWithQueryParams - PUT /v2/fake/body-with-query-params - async fn test_body_with_query_params( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::TestBodyWithQueryParamsQueryParams, - body: models::User, - ) -> Result; - - /// To test \"client\" model. - /// - /// TestClientModel - PATCH /v2/fake - async fn test_client_model( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Client, - ) -> Result; - - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. - /// - /// TestEndpointParameters - POST /v2/fake - async fn test_endpoint_parameters( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// To test enum parameters. - /// - /// TestEnumParameters - GET /v2/fake - async fn test_enum_parameters( - &self, - method: Method, - host: Host, - cookies: CookieJar, - header_params: models::TestEnumParametersHeaderParams, - query_params: models::TestEnumParametersQueryParams, - ) -> Result; - - /// test inline additionalProperties. - /// - /// TestInlineAdditionalProperties - POST /v2/fake/inline-additionalProperties - async fn test_inline_additional_properties( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: std::collections::HashMap, - ) -> Result; - - /// test json serialization of form data. - /// - /// TestJsonFormData - GET /v2/fake/jsonFormData - async fn test_json_form_data( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// To test class name in snake case. - /// - /// TestClassname - PATCH /v2/fake_classname_test - async fn test_classname( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Client, - ) -> Result; - - /// Add a new pet to the store. - /// - /// AddPet - POST /v2/pet - async fn add_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Pet, - ) -> Result; - - /// Deletes a pet. - /// - /// DeletePet - DELETE /v2/pet/{petId} - async fn delete_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - header_params: models::DeletePetHeaderParams, - path_params: models::DeletePetPathParams, - ) -> Result; - - /// Finds Pets by status. - /// - /// FindPetsByStatus - GET /v2/pet/findByStatus - async fn find_pets_by_status( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::FindPetsByStatusQueryParams, - ) -> Result; - - /// Finds Pets by tags. - /// - /// FindPetsByTags - GET /v2/pet/findByTags - async fn find_pets_by_tags( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::FindPetsByTagsQueryParams, - ) -> Result; - - /// Find pet by ID. - /// - /// GetPetById - GET /v2/pet/{petId} - async fn get_pet_by_id( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetPetByIdPathParams, - ) -> Result; - - /// Update an existing pet. - /// - /// UpdatePet - PUT /v2/pet - async fn update_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Pet, - ) -> Result; - - /// Updates a pet in the store with form data. - /// - /// UpdatePetWithForm - POST /v2/pet/{petId} - async fn update_pet_with_form( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UpdatePetWithFormPathParams, - ) -> Result; - - /// uploads an image. - /// - /// UploadFile - POST /v2/pet/{petId}/uploadImage - async fn upload_file( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UploadFilePathParams, - body: Multipart, - ) -> Result; - - /// Delete purchase order by ID. - /// - /// DeleteOrder - DELETE /v2/store/order/{order_id} - async fn delete_order( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::DeleteOrderPathParams, - ) -> Result; - - /// Returns pet inventories by status. - /// - /// GetInventory - GET /v2/store/inventory - async fn get_inventory( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Find purchase order by ID. - /// - /// GetOrderById - GET /v2/store/order/{order_id} - async fn get_order_by_id( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetOrderByIdPathParams, - ) -> Result; - - /// Place an order for a pet. - /// - /// PlaceOrder - POST /v2/store/order - async fn place_order( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Order, - ) -> Result; - - /// Create user. - /// - /// CreateUser - POST /v2/user - async fn create_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::User, - ) -> Result; - - /// Creates list of users with given input array. - /// - /// CreateUsersWithArrayInput - POST /v2/user/createWithArray - async fn create_users_with_array_input( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Vec, - ) -> Result; - - /// Creates list of users with given input array. - /// - /// CreateUsersWithListInput - POST /v2/user/createWithList - async fn create_users_with_list_input( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Vec, - ) -> Result; - - /// Delete user. - /// - /// DeleteUser - DELETE /v2/user/{username} - async fn delete_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::DeleteUserPathParams, - ) -> Result; - - /// Get user by user name. - /// - /// GetUserByName - GET /v2/user/{username} - async fn get_user_by_name( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetUserByNamePathParams, - ) -> Result; - - /// Logs user into the system. - /// - /// LoginUser - GET /v2/user/login - async fn login_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::LoginUserQueryParams, - ) -> Result; - - /// Logs out current logged in user session. - /// - /// LogoutUser - GET /v2/user/logout - async fn logout_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Updated user. - /// - /// UpdateUser - PUT /v2/user/{username} - async fn update_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UpdateUserPathParams, - body: models::User, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index ccd8f72ef78..591189ae1f1 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -5521,6 +5521,936 @@ impl std::convert::TryFrom for header::IntoHeaderValue { } } +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct TestEndpointParametersRequest { + /// None + #[serde(rename = "integer")] + #[validate(range(min = 10, max = 100))] + #[serde(skip_serializing_if = "Option::is_none")] + pub integer: Option, + + /// None + #[serde(rename = "int32")] + #[validate(range(min = 20, max = 200))] + #[serde(skip_serializing_if = "Option::is_none")] + pub int32: Option, + + /// None + #[serde(rename = "int64")] + #[serde(skip_serializing_if = "Option::is_none")] + pub int64: Option, + + /// None + #[serde(rename = "number")] + #[validate(range(min = 32.1, max = 543.2))] + pub number: f64, + + /// None + #[serde(rename = "float")] + #[validate(range(max = 987.6))] + #[serde(skip_serializing_if = "Option::is_none")] + pub float: Option, + + /// None + #[serde(rename = "double")] + #[validate(range(min = 67.8, max = 123.4))] + pub double: f64, + + /// None + #[serde(rename = "string")] + #[validate( + regex(path = *RE_TESTENDPOINTPARAMETERSREQUEST_STRING), + )] + #[serde(skip_serializing_if = "Option::is_none")] + pub string: Option, + + /// None + #[serde(rename = "pattern_without_delimiter")] + #[validate( + regex(path = *RE_TESTENDPOINTPARAMETERSREQUEST_PATTERN_WITHOUT_DELIMITER), + )] + pub pattern_without_delimiter: String, + + /// None + #[serde(rename = "byte")] + pub byte: ByteArray, + + /// None + #[serde(rename = "binary")] + #[serde(skip_serializing_if = "Option::is_none")] + pub binary: Option, + + /// None + #[serde(rename = "date")] + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + + /// None + #[serde(rename = "dateTime")] + #[serde(skip_serializing_if = "Option::is_none")] + pub date_time: Option>, + + /// None + #[serde(rename = "password")] + #[validate(length(min = 10, max = 64))] + #[serde(skip_serializing_if = "Option::is_none")] + pub password: Option, + + /// None + #[serde(rename = "callback")] + #[serde(skip_serializing_if = "Option::is_none")] + pub callback: Option, +} + +lazy_static::lazy_static! { + static ref RE_TESTENDPOINTPARAMETERSREQUEST_STRING: regex::Regex = regex::Regex::new(r"/[a-z]/i").unwrap(); +} +lazy_static::lazy_static! { + static ref RE_TESTENDPOINTPARAMETERSREQUEST_PATTERN_WITHOUT_DELIMITER: regex::Regex = regex::Regex::new(r"^[A-Z].*").unwrap(); +} + +impl TestEndpointParametersRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new( + number: f64, + double: f64, + pattern_without_delimiter: String, + byte: ByteArray, + ) -> TestEndpointParametersRequest { + TestEndpointParametersRequest { + integer: None, + int32: None, + int64: None, + number, + float: None, + double, + string: None, + pattern_without_delimiter, + byte, + binary: None, + date: None, + date_time: None, + password: None, + callback: None, + } + } +} + +/// Converts the TestEndpointParametersRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for TestEndpointParametersRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + self.integer + .as_ref() + .map(|integer| ["integer".to_string(), integer.to_string()].join(",")), + self.int32 + .as_ref() + .map(|int32| ["int32".to_string(), int32.to_string()].join(",")), + self.int64 + .as_ref() + .map(|int64| ["int64".to_string(), int64.to_string()].join(",")), + Some("number".to_string()), + Some(self.number.to_string()), + self.float + .as_ref() + .map(|float| ["float".to_string(), float.to_string()].join(",")), + Some("double".to_string()), + Some(self.double.to_string()), + self.string + .as_ref() + .map(|string| ["string".to_string(), string.to_string()].join(",")), + Some("pattern_without_delimiter".to_string()), + Some(self.pattern_without_delimiter.to_string()), + // Skipping byte in query parameter serialization + // Skipping byte in query parameter serialization + + // Skipping binary in query parameter serialization + // Skipping binary in query parameter serialization + + // Skipping date in query parameter serialization + + // Skipping dateTime in query parameter serialization + self.password + .as_ref() + .map(|password| ["password".to_string(), password.to_string()].join(",")), + self.callback + .as_ref() + .map(|callback| ["callback".to_string(), callback.to_string()].join(",")), + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a TestEndpointParametersRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for TestEndpointParametersRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub integer: Vec, + pub int32: Vec, + pub int64: Vec, + pub number: Vec, + pub float: Vec, + pub double: Vec, + pub string: Vec, + pub pattern_without_delimiter: Vec, + pub byte: Vec, + pub binary: Vec, + pub date: Vec, + pub date_time: Vec>, + pub password: Vec, + pub callback: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing TestEndpointParametersRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "integer" => intermediate_rep.integer.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "int32" => intermediate_rep.int32.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "int64" => intermediate_rep.int64.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "number" => intermediate_rep.number.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "float" => intermediate_rep.float.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "double" => intermediate_rep.double.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "string" => intermediate_rep.string.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "pattern_without_delimiter" => intermediate_rep.pattern_without_delimiter.push(::from_str(val).map_err(|x| x.to_string())?), + "byte" => return std::result::Result::Err("Parsing binary data in this style is not supported in TestEndpointParametersRequest".to_string()), + "binary" => return std::result::Result::Err("Parsing binary data in this style is not supported in TestEndpointParametersRequest".to_string()), + #[allow(clippy::redundant_clone)] + "date" => intermediate_rep.date.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "dateTime" => intermediate_rep.date_time.push( as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "callback" => intermediate_rep.callback.push(::from_str(val).map_err(|x| x.to_string())?), + _ => return std::result::Result::Err("Unexpected key while parsing TestEndpointParametersRequest".to_string()) + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(TestEndpointParametersRequest { + integer: intermediate_rep.integer.into_iter().next(), + int32: intermediate_rep.int32.into_iter().next(), + int64: intermediate_rep.int64.into_iter().next(), + number: intermediate_rep + .number + .into_iter() + .next() + .ok_or_else(|| "number missing in TestEndpointParametersRequest".to_string())?, + float: intermediate_rep.float.into_iter().next(), + double: intermediate_rep + .double + .into_iter() + .next() + .ok_or_else(|| "double missing in TestEndpointParametersRequest".to_string())?, + string: intermediate_rep.string.into_iter().next(), + pattern_without_delimiter: intermediate_rep + .pattern_without_delimiter + .into_iter() + .next() + .ok_or_else(|| { + "pattern_without_delimiter missing in TestEndpointParametersRequest".to_string() + })?, + byte: intermediate_rep + .byte + .into_iter() + .next() + .ok_or_else(|| "byte missing in TestEndpointParametersRequest".to_string())?, + binary: intermediate_rep.binary.into_iter().next(), + date: intermediate_rep.date.into_iter().next(), + date_time: intermediate_rep.date_time.into_iter().next(), + password: intermediate_rep.password.into_iter().next(), + callback: intermediate_rep.callback.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for TestEndpointParametersRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into TestEndpointParametersRequest - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct TestEnumParametersRequest { + /// Form parameter enum test (string) + /// Note: inline enums are not fully supported by openapi-generator + #[serde(rename = "enum_form_string")] + #[serde(skip_serializing_if = "Option::is_none")] + pub enum_form_string: Option, +} + +impl TestEnumParametersRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new() -> TestEnumParametersRequest { + TestEnumParametersRequest { + enum_form_string: Some("-efg".to_string()), + } + } +} + +/// Converts the TestEnumParametersRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for TestEnumParametersRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = + vec![self.enum_form_string.as_ref().map(|enum_form_string| { + ["enum_form_string".to_string(), enum_form_string.to_string()].join(",") + })]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a TestEnumParametersRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for TestEnumParametersRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub enum_form_string: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing TestEnumParametersRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "enum_form_string" => intermediate_rep.enum_form_string.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing TestEnumParametersRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(TestEnumParametersRequest { + enum_form_string: intermediate_rep.enum_form_string.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for TestEnumParametersRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into TestEnumParametersRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct TestJsonFormDataRequest { + /// field1 + #[serde(rename = "param")] + pub param: String, + + /// field2 + #[serde(rename = "param2")] + pub param2: String, +} + +impl TestJsonFormDataRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new(param: String, param2: String) -> TestJsonFormDataRequest { + TestJsonFormDataRequest { param, param2 } + } +} + +/// Converts the TestJsonFormDataRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for TestJsonFormDataRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + Some("param".to_string()), + Some(self.param.to_string()), + Some("param2".to_string()), + Some(self.param2.to_string()), + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a TestJsonFormDataRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for TestJsonFormDataRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub param: Vec, + pub param2: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing TestJsonFormDataRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "param" => intermediate_rep.param.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + #[allow(clippy::redundant_clone)] + "param2" => intermediate_rep.param2.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing TestJsonFormDataRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(TestJsonFormDataRequest { + param: intermediate_rep + .param + .into_iter() + .next() + .ok_or_else(|| "param missing in TestJsonFormDataRequest".to_string())?, + param2: intermediate_rep + .param2 + .into_iter() + .next() + .ok_or_else(|| "param2 missing in TestJsonFormDataRequest".to_string())?, + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for TestJsonFormDataRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into TestJsonFormDataRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct UpdatePetWithFormRequest { + /// Updated name of the pet + #[serde(rename = "name")] + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + + /// Updated status of the pet + #[serde(rename = "status")] + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl UpdatePetWithFormRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new() -> UpdatePetWithFormRequest { + UpdatePetWithFormRequest { + name: None, + status: None, + } + } +} + +/// Converts the UpdatePetWithFormRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for UpdatePetWithFormRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + self.name + .as_ref() + .map(|name| ["name".to_string(), name.to_string()].join(",")), + self.status + .as_ref() + .map(|status| ["status".to_string(), status.to_string()].join(",")), + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a UpdatePetWithFormRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for UpdatePetWithFormRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub name: Vec, + pub status: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing UpdatePetWithFormRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "name" => intermediate_rep.name.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + #[allow(clippy::redundant_clone)] + "status" => intermediate_rep.status.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing UpdatePetWithFormRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(UpdatePetWithFormRequest { + name: intermediate_rep.name.into_iter().next(), + status: intermediate_rep.status.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for UpdatePetWithFormRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into UpdatePetWithFormRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct UploadFileRequest { + /// Additional data to pass to server + #[serde(rename = "additionalMetadata")] + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_metadata: Option, + + /// file to upload + #[serde(rename = "file")] + #[serde(skip_serializing_if = "Option::is_none")] + pub file: Option, +} + +impl UploadFileRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new() -> UploadFileRequest { + UploadFileRequest { + additional_metadata: None, + file: None, + } + } +} + +/// Converts the UploadFileRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for UploadFileRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + self.additional_metadata + .as_ref() + .map(|additional_metadata| { + [ + "additionalMetadata".to_string(), + additional_metadata.to_string(), + ] + .join(",") + }), + // Skipping file in query parameter serialization + // Skipping file in query parameter serialization + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a UploadFileRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for UploadFileRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub additional_metadata: Vec, + pub file: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing UploadFileRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "additionalMetadata" => intermediate_rep.additional_metadata.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + "file" => return std::result::Result::Err( + "Parsing binary data in this style is not supported in UploadFileRequest" + .to_string(), + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing UploadFileRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(UploadFileRequest { + additional_metadata: intermediate_rep.additional_metadata.into_iter().next(), + file: intermediate_rep.file.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for UploadFileRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into UploadFileRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct User { diff --git a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index cf0fe31c813..281996e15e3 100644 --- a/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -10,27 +10,19 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - AddPetResponse, Api, Call123exampleResponse, CreateUserResponse, - CreateUsersWithArrayInputResponse, CreateUsersWithListInputResponse, DeleteOrderResponse, - DeletePetResponse, DeleteUserResponse, FakeOuterBooleanSerializeResponse, - FakeOuterCompositeSerializeResponse, FakeOuterNumberSerializeResponse, - FakeOuterStringSerializeResponse, FakeResponseWithNumericalDescriptionResponse, - FindPetsByStatusResponse, FindPetsByTagsResponse, GetInventoryResponse, GetOrderByIdResponse, - GetPetByIdResponse, GetUserByNameResponse, HyphenParamResponse, LoginUserResponse, - LogoutUserResponse, PlaceOrderResponse, TestBodyWithQueryParamsResponse, TestClassnameResponse, - TestClientModelResponse, TestEndpointParametersResponse, TestEnumParametersResponse, - TestInlineAdditionalPropertiesResponse, TestJsonFormDataResponse, TestSpecialTagsResponse, - UpdatePetResponse, UpdatePetWithFormResponse, UpdateUserResponse, UploadFileResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::another_fake::AnotherFake + + apis::fake::Fake + + apis::fake_classname_tags123::FakeClassnameTags123 + + apis::pet::Pet + + apis::store::Store + + apis::user::User + + 'static, { // build our application with a route Router::new() @@ -142,7 +134,7 @@ async fn test_special_tags( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::another_fake::AnotherFake, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || test_special_tags_validation(body)) @@ -165,7 +157,7 @@ where let resp = match result { Ok(rsp) => match rsp { - TestSpecialTagsResponse::Status200_SuccessfulOperation(body) => { + apis::another_fake::TestSpecialTagsResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -216,7 +208,7 @@ async fn call123example( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || call123example_validation()) @@ -239,7 +231,7 @@ where let resp = match result { Ok(rsp) => match rsp { - Call123exampleResponse::Status200_Success => { + apis::fake::Call123exampleResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -286,7 +278,7 @@ async fn fake_outer_boolean_serialize( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -310,7 +302,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FakeOuterBooleanSerializeResponse::Status200_OutputBoolean(body) => { + apis::fake::FakeOuterBooleanSerializeResponse::Status200_OutputBoolean(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -376,7 +368,7 @@ async fn fake_outer_composite_serialize( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -400,7 +392,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FakeOuterCompositeSerializeResponse::Status200_OutputComposite(body) => { + apis::fake::FakeOuterCompositeSerializeResponse::Status200_OutputComposite(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -466,7 +458,7 @@ async fn fake_outer_number_serialize( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -490,7 +482,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FakeOuterNumberSerializeResponse::Status200_OutputNumber(body) => { + apis::fake::FakeOuterNumberSerializeResponse::Status200_OutputNumber(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -556,7 +548,7 @@ async fn fake_outer_string_serialize( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -580,7 +572,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FakeOuterStringSerializeResponse::Status200_OutputString(body) => { + apis::fake::FakeOuterStringSerializeResponse::Status200_OutputString(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -632,7 +624,7 @@ async fn fake_response_with_numerical_description( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -656,7 +648,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FakeResponseWithNumericalDescriptionResponse::Status200 => { + apis::fake::FakeResponseWithNumericalDescriptionResponse::Status200 => { let mut response = response.status(200); response.body(Body::empty()) } @@ -693,7 +685,7 @@ async fn hyphen_param( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || hyphen_param_validation(path_params)) @@ -716,7 +708,7 @@ where let resp = match result { Ok(rsp) => match rsp { - HyphenParamResponse::Status200_Success => { + apis::fake::HyphenParamResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -765,7 +757,7 @@ async fn test_body_with_query_params( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || { @@ -790,7 +782,7 @@ where let resp = match result { Ok(rsp) => match rsp { - TestBodyWithQueryParamsResponse::Status200_Success => { + apis::fake::TestBodyWithQueryParamsResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -835,7 +827,7 @@ async fn test_client_model( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || test_client_model_validation(body)) @@ -858,7 +850,7 @@ where let resp = match result { Ok(rsp) => match rsp { - TestClientModelResponse::Status200_SuccessfulOperation(body) => { + apis::fake::TestClientModelResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -895,9 +887,21 @@ where }) } +#[derive(validator::Validate)] +#[allow(dead_code)] +struct TestEndpointParametersBodyValidator<'a> { + #[validate(nested)] + body: &'a models::TestEndpointParametersRequest, +} + #[tracing::instrument(skip_all)] -fn test_endpoint_parameters_validation() -> std::result::Result<(), ValidationErrors> { - Ok(()) +fn test_endpoint_parameters_validation( + body: models::TestEndpointParametersRequest, +) -> std::result::Result<(models::TestEndpointParametersRequest,), ValidationErrors> { + let b = TestEndpointParametersBodyValidator { body: &body }; + b.validate()?; + + Ok((body,)) } /// TestEndpointParameters - POST /v2/fake #[tracing::instrument(skip_all)] @@ -906,17 +910,18 @@ async fn test_endpoint_parameters( host: Host, cookies: CookieJar, State(api_impl): State, + Form(body): Form, ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] - let validation = tokio::task::spawn_blocking(move || test_endpoint_parameters_validation()) + let validation = tokio::task::spawn_blocking(move || test_endpoint_parameters_validation(body)) .await .unwrap(); - let Ok(()) = validation else { + let Ok((body,)) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) @@ -925,18 +930,18 @@ where let result = api_impl .as_ref() - .test_endpoint_parameters(method, host, cookies) + .test_endpoint_parameters(method, host, cookies, body) .await; let mut response = Response::builder(); let resp = match result { Ok(rsp) => match rsp { - TestEndpointParametersResponse::Status400_InvalidUsernameSupplied => { + apis::fake::TestEndpointParametersResponse::Status400_InvalidUsernameSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - TestEndpointParametersResponse::Status404_UserNotFound => { + apis::fake::TestEndpointParametersResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -954,21 +959,34 @@ where }) } +#[derive(validator::Validate)] +#[allow(dead_code)] +struct TestEnumParametersBodyValidator<'a> { + #[validate(nested)] + body: &'a models::TestEnumParametersRequest, +} + #[tracing::instrument(skip_all)] fn test_enum_parameters_validation( header_params: models::TestEnumParametersHeaderParams, query_params: models::TestEnumParametersQueryParams, + body: Option, ) -> std::result::Result< ( models::TestEnumParametersHeaderParams, models::TestEnumParametersQueryParams, + Option, ), ValidationErrors, > { header_params.validate()?; query_params.validate()?; + if let Some(body) = &body { + let b = TestEnumParametersBodyValidator { body }; + b.validate()?; + } - Ok((header_params, query_params)) + Ok((header_params, query_params, body)) } /// TestEnumParameters - GET /v2/fake #[tracing::instrument(skip_all)] @@ -979,10 +997,11 @@ async fn test_enum_parameters( headers: HeaderMap, Query(query_params): Query, State(api_impl): State, + Form(body): Form>, ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { // Header parameters let header_params = { @@ -1036,12 +1055,12 @@ where #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || { - test_enum_parameters_validation(header_params, query_params) + test_enum_parameters_validation(header_params, query_params, body) }) .await .unwrap(); - let Ok((header_params, query_params)) = validation else { + let Ok((header_params, query_params, body)) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) @@ -1050,18 +1069,18 @@ where let result = api_impl .as_ref() - .test_enum_parameters(method, host, cookies, header_params, query_params) + .test_enum_parameters(method, host, cookies, header_params, query_params, body) .await; let mut response = Response::builder(); let resp = match result { Ok(rsp) => match rsp { - TestEnumParametersResponse::Status400_InvalidRequest => { + apis::fake::TestEnumParametersResponse::Status400_InvalidRequest => { let mut response = response.status(400); response.body(Body::empty()) } - TestEnumParametersResponse::Status404_NotFound => { + apis::fake::TestEnumParametersResponse::Status404_NotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -1105,7 +1124,7 @@ async fn test_inline_additional_properties( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] let validation = @@ -1129,7 +1148,7 @@ where let resp = match result { Ok(rsp) => match rsp { - TestInlineAdditionalPropertiesResponse::Status200_SuccessfulOperation => { + apis::fake::TestInlineAdditionalPropertiesResponse::Status200_SuccessfulOperation => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1147,9 +1166,21 @@ where }) } +#[derive(validator::Validate)] +#[allow(dead_code)] +struct TestJsonFormDataBodyValidator<'a> { + #[validate(nested)] + body: &'a models::TestJsonFormDataRequest, +} + #[tracing::instrument(skip_all)] -fn test_json_form_data_validation() -> std::result::Result<(), ValidationErrors> { - Ok(()) +fn test_json_form_data_validation( + body: models::TestJsonFormDataRequest, +) -> std::result::Result<(models::TestJsonFormDataRequest,), ValidationErrors> { + let b = TestJsonFormDataBodyValidator { body: &body }; + b.validate()?; + + Ok((body,)) } /// TestJsonFormData - GET /v2/fake/jsonFormData #[tracing::instrument(skip_all)] @@ -1158,17 +1189,18 @@ async fn test_json_form_data( host: Host, cookies: CookieJar, State(api_impl): State, + Form(body): Form, ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake::Fake, { #[allow(clippy::redundant_closure)] - let validation = tokio::task::spawn_blocking(move || test_json_form_data_validation()) + let validation = tokio::task::spawn_blocking(move || test_json_form_data_validation(body)) .await .unwrap(); - let Ok(()) = validation else { + let Ok((body,)) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) @@ -1177,14 +1209,14 @@ where let result = api_impl .as_ref() - .test_json_form_data(method, host, cookies) + .test_json_form_data(method, host, cookies, body) .await; let mut response = Response::builder(); let resp = match result { Ok(rsp) => match rsp { - TestJsonFormDataResponse::Status200_SuccessfulOperation => { + apis::fake::TestJsonFormDataResponse::Status200_SuccessfulOperation => { let mut response = response.status(200); response.body(Body::empty()) } @@ -1229,7 +1261,7 @@ async fn test_classname( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::fake_classname_tags123::FakeClassnameTags123, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || test_classname_validation(body)) @@ -1252,7 +1284,9 @@ where let resp = match result { Ok(rsp) => match rsp { - TestClassnameResponse::Status200_SuccessfulOperation(body) => { + apis::fake_classname_tags123::TestClassnameResponse::Status200_SuccessfulOperation( + body, + ) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1314,7 +1348,7 @@ async fn add_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || add_pet_validation(body)) @@ -1334,7 +1368,7 @@ where let resp = match result { Ok(rsp) => match rsp { - AddPetResponse::Status405_InvalidInput => { + apis::pet::AddPetResponse::Status405_InvalidInput => { let mut response = response.status(405); response.body(Body::empty()) } @@ -1377,7 +1411,7 @@ async fn delete_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { // Header parameters let header_params = { @@ -1426,7 +1460,7 @@ where let resp = match result { Ok(rsp) => match rsp { - DeletePetResponse::Status400_InvalidPetValue => { + apis::pet::DeletePetResponse::Status400_InvalidPetValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1463,7 +1497,7 @@ async fn find_pets_by_status( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = @@ -1487,7 +1521,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => { + apis::pet::FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1503,7 +1537,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - FindPetsByStatusResponse::Status400_InvalidStatusValue => { + apis::pet::FindPetsByStatusResponse::Status400_InvalidStatusValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1540,7 +1574,7 @@ async fn find_pets_by_tags( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = @@ -1564,7 +1598,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => { + apis::pet::FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1580,7 +1614,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - FindPetsByTagsResponse::Status400_InvalidTagValue => { + apis::pet::FindPetsByTagsResponse::Status400_InvalidTagValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1617,7 +1651,7 @@ async fn get_pet_by_id( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_pet_by_id_validation(path_params)) @@ -1640,7 +1674,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetPetByIdResponse::Status200_SuccessfulOperation(body) => { + apis::pet::GetPetByIdResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1656,11 +1690,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetPetByIdResponse::Status400_InvalidIDSupplied => { + apis::pet::GetPetByIdResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetPetByIdResponse::Status404_PetNotFound => { + apis::pet::GetPetByIdResponse::Status404_PetNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -1705,7 +1739,7 @@ async fn update_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || update_pet_validation(body)) @@ -1728,15 +1762,15 @@ where let resp = match result { Ok(rsp) => match rsp { - UpdatePetResponse::Status400_InvalidIDSupplied => { + apis::pet::UpdatePetResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - UpdatePetResponse::Status404_PetNotFound => { + apis::pet::UpdatePetResponse::Status404_PetNotFound => { let mut response = response.status(404); response.body(Body::empty()) } - UpdatePetResponse::Status405_ValidationException => { + apis::pet::UpdatePetResponse::Status405_ValidationException => { let mut response = response.status(405); response.body(Body::empty()) } @@ -1754,13 +1788,31 @@ where }) } +#[derive(validator::Validate)] +#[allow(dead_code)] +struct UpdatePetWithFormBodyValidator<'a> { + #[validate(nested)] + body: &'a models::UpdatePetWithFormRequest, +} + #[tracing::instrument(skip_all)] fn update_pet_with_form_validation( path_params: models::UpdatePetWithFormPathParams, -) -> std::result::Result<(models::UpdatePetWithFormPathParams,), ValidationErrors> { + body: Option, +) -> std::result::Result< + ( + models::UpdatePetWithFormPathParams, + Option, + ), + ValidationErrors, +> { path_params.validate()?; + if let Some(body) = &body { + let b = UpdatePetWithFormBodyValidator { body }; + b.validate()?; + } - Ok((path_params,)) + Ok((path_params, body)) } /// UpdatePetWithForm - POST /v2/pet/{petId} #[tracing::instrument(skip_all)] @@ -1770,18 +1822,19 @@ async fn update_pet_with_form( cookies: CookieJar, Path(path_params): Path, State(api_impl): State, + Form(body): Form>, ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = - tokio::task::spawn_blocking(move || update_pet_with_form_validation(path_params)) + tokio::task::spawn_blocking(move || update_pet_with_form_validation(path_params, body)) .await .unwrap(); - let Ok((path_params,)) = validation else { + let Ok((path_params, body)) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) @@ -1790,14 +1843,14 @@ where let result = api_impl .as_ref() - .update_pet_with_form(method, host, cookies, path_params) + .update_pet_with_form(method, host, cookies, path_params, body) .await; let mut response = Response::builder(); let resp = match result { Ok(rsp) => match rsp { - UpdatePetWithFormResponse::Status405_InvalidInput => { + apis::pet::UpdatePetWithFormResponse::Status405_InvalidInput => { let mut response = response.status(405); response.body(Body::empty()) } @@ -1835,7 +1888,7 @@ async fn upload_file( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || upload_file_validation(path_params)) @@ -1858,7 +1911,7 @@ where let resp = match result { Ok(rsp) => match rsp { - UploadFileResponse::Status200_SuccessfulOperation(body) => { + apis::pet::UploadFileResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1914,7 +1967,7 @@ async fn delete_order( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || delete_order_validation(path_params)) @@ -1937,11 +1990,11 @@ where let resp = match result { Ok(rsp) => match rsp { - DeleteOrderResponse::Status400_InvalidIDSupplied => { + apis::store::DeleteOrderResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - DeleteOrderResponse::Status404_OrderNotFound => { + apis::store::DeleteOrderResponse::Status404_OrderNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -1973,7 +2026,7 @@ async fn get_inventory( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_inventory_validation()) @@ -1993,7 +2046,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetInventoryResponse::Status200_SuccessfulOperation(body) => { + apis::store::GetInventoryResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -2049,7 +2102,7 @@ async fn get_order_by_id( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_order_by_id_validation(path_params)) @@ -2072,7 +2125,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetOrderByIdResponse::Status200_SuccessfulOperation(body) => { + apis::store::GetOrderByIdResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -2088,11 +2141,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetOrderByIdResponse::Status400_InvalidIDSupplied => { + apis::store::GetOrderByIdResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetOrderByIdResponse::Status404_OrderNotFound => { + apis::store::GetOrderByIdResponse::Status404_OrderNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -2137,7 +2190,7 @@ async fn place_order( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || place_order_validation(body)) @@ -2160,7 +2213,7 @@ where let resp = match result { Ok(rsp) => match rsp { - PlaceOrderResponse::Status200_SuccessfulOperation(body) => { + apis::store::PlaceOrderResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -2176,7 +2229,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - PlaceOrderResponse::Status400_InvalidOrder => { + apis::store::PlaceOrderResponse::Status400_InvalidOrder => { let mut response = response.status(400); response.body(Body::empty()) } @@ -2221,7 +2274,7 @@ async fn create_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || create_user_validation(body)) @@ -2244,7 +2297,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUserResponse::Status0_SuccessfulOperation => { + apis::user::CreateUserResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -2289,7 +2342,7 @@ async fn create_users_with_array_input( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = @@ -2313,7 +2366,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => { + apis::user::CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -2358,7 +2411,7 @@ async fn create_users_with_list_input( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = @@ -2382,7 +2435,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUsersWithListInputResponse::Status0_SuccessfulOperation => { + apis::user::CreateUsersWithListInputResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -2419,7 +2472,7 @@ async fn delete_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || delete_user_validation(path_params)) @@ -2442,11 +2495,11 @@ where let resp = match result { Ok(rsp) => match rsp { - DeleteUserResponse::Status400_InvalidUsernameSupplied => { + apis::user::DeleteUserResponse::Status400_InvalidUsernameSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - DeleteUserResponse::Status404_UserNotFound => { + apis::user::DeleteUserResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -2483,7 +2536,7 @@ async fn get_user_by_name( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_user_by_name_validation(path_params)) @@ -2506,7 +2559,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetUserByNameResponse::Status200_SuccessfulOperation(body) => { + apis::user::GetUserByNameResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -2522,11 +2575,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetUserByNameResponse::Status400_InvalidUsernameSupplied => { + apis::user::GetUserByNameResponse::Status400_InvalidUsernameSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetUserByNameResponse::Status404_UserNotFound => { + apis::user::GetUserByNameResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -2563,7 +2616,7 @@ async fn login_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || login_user_validation(query_params)) @@ -2586,7 +2639,7 @@ where let resp = match result { Ok(rsp) => match rsp { - LoginUserResponse::Status200_SuccessfulOperation { + apis::user::LoginUserResponse::Status200_SuccessfulOperation { body, x_rate_limit, x_expires_after, @@ -2638,7 +2691,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - LoginUserResponse::Status400_InvalidUsername => { + apis::user::LoginUserResponse::Status400_InvalidUsername => { let mut response = response.status(400); response.body(Body::empty()) } @@ -2670,7 +2723,7 @@ async fn logout_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || logout_user_validation()) @@ -2690,7 +2743,7 @@ where let resp = match result { Ok(rsp) => match rsp { - LogoutUserResponse::Status0_SuccessfulOperation => { + apis::user::LogoutUserResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -2738,7 +2791,7 @@ async fn update_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || update_user_validation(path_params, body)) @@ -2761,11 +2814,11 @@ where let resp = match result { Ok(rsp) => match rsp { - UpdateUserResponse::Status400_InvalidUserSupplied => { + apis::user::UpdateUserResponse::Status400_InvalidUserSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - UpdateUserResponse::Status404_UserNotFound => { + apis::user::UpdateUserResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES index ea1c5b8c5be..2520d7516ec 100644 --- a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/FILES @@ -1,6 +1,10 @@ .gitignore Cargo.toml README.md +src/apis/mod.rs +src/apis/pet.rs +src/apis/store.rs +src/apis/user.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore/README.md b/samples/server/petstore/rust-axum/output/petstore/README.md index 795a6f427e3..a6f7c5cb19a 100644 --- a/samples/server/petstore/rust-axum/output/petstore/README.md +++ b/samples/server/petstore/rust-axum/output/petstore/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0.0 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs new file mode 100644 index 00000000000..cdc670909a4 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/mod.rs @@ -0,0 +1,3 @@ +pub mod pet; +pub mod store; +pub mod user; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs new file mode 100644 index 00000000000..057eafbec18 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/pet.rs @@ -0,0 +1,184 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum AddPetResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid input + Status405_InvalidInput, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeletePetResponse { + /// Invalid pet value + Status400_InvalidPetValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FindPetsByStatusResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid status value + Status400_InvalidStatusValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FindPetsByTagsResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid tag value + Status400_InvalidTagValue, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetPetByIdResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Pet not found + Status404_PetNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdatePetResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Pet not found + Status404_PetNotFound, + /// Validation exception + Status405_ValidationException, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdatePetWithFormResponse { + /// Invalid input + Status405_InvalidInput, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UploadFileResponse { + /// successful operation + Status200_SuccessfulOperation(models::ApiResponse), +} + +/// Pet +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Pet { + /// Add a new pet to the store. + /// + /// AddPet - POST /v2/pet + async fn add_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Pet, + ) -> Result; + + /// Deletes a pet. + /// + /// DeletePet - DELETE /v2/pet/{petId} + async fn delete_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + header_params: models::DeletePetHeaderParams, + path_params: models::DeletePetPathParams, + ) -> Result; + + /// Finds Pets by status. + /// + /// FindPetsByStatus - GET /v2/pet/findByStatus + async fn find_pets_by_status( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::FindPetsByStatusQueryParams, + ) -> Result; + + /// Finds Pets by tags. + /// + /// FindPetsByTags - GET /v2/pet/findByTags + async fn find_pets_by_tags( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::FindPetsByTagsQueryParams, + ) -> Result; + + /// Find pet by ID. + /// + /// GetPetById - GET /v2/pet/{petId} + async fn get_pet_by_id( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetPetByIdPathParams, + ) -> Result; + + /// Update an existing pet. + /// + /// UpdatePet - PUT /v2/pet + async fn update_pet( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Pet, + ) -> Result; + + /// Updates a pet in the store with form data. + /// + /// UpdatePetWithForm - POST /v2/pet/{petId} + async fn update_pet_with_form( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UpdatePetWithFormPathParams, + body: Option, + ) -> Result; + + /// uploads an image. + /// + /// UploadFile - POST /v2/pet/{petId}/uploadImage + async fn upload_file( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UploadFilePathParams, + body: Multipart, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs new file mode 100644 index 00000000000..d584d653580 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/store.rs @@ -0,0 +1,96 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeleteOrderResponse { + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Order not found + Status404_OrderNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetInventoryResponse { + /// successful operation + Status200_SuccessfulOperation(std::collections::HashMap), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetOrderByIdResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid ID supplied + Status400_InvalidIDSupplied, + /// Order not found + Status404_OrderNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum PlaceOrderResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid Order + Status400_InvalidOrder, +} + +/// Store +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Store { + /// Delete purchase order by ID. + /// + /// DeleteOrder - DELETE /v2/store/order/{orderId} + async fn delete_order( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::DeleteOrderPathParams, + ) -> Result; + + /// Returns pet inventories by status. + /// + /// GetInventory - GET /v2/store/inventory + async fn get_inventory( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Find purchase order by ID. + /// + /// GetOrderById - GET /v2/store/order/{orderId} + async fn get_order_by_id( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetOrderByIdPathParams, + ) -> Result; + + /// Place an order for a pet. + /// + /// PlaceOrder - POST /v2/store/order + async fn place_order( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Order, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs new file mode 100644 index 00000000000..e786750bc83 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/petstore/src/apis/user.rs @@ -0,0 +1,180 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUserResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUsersWithArrayInputResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum CreateUsersWithListInputResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DeleteUserResponse { + /// Invalid username supplied + Status400_InvalidUsernameSupplied, + /// User not found + Status404_UserNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetUserByNameResponse { + /// successful operation + Status200_SuccessfulOperation(String), + /// Invalid username supplied + Status400_InvalidUsernameSupplied, + /// User not found + Status404_UserNotFound, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum LoginUserResponse { + /// successful operation + Status200_SuccessfulOperation { + body: String, + set_cookie: Option, + x_rate_limit: Option, + x_expires_after: Option>, + }, + /// Invalid username/password supplied + Status400_InvalidUsername, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum LogoutUserResponse { + /// successful operation + Status0_SuccessfulOperation, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UpdateUserResponse { + /// Invalid user supplied + Status400_InvalidUserSupplied, + /// User not found + Status404_UserNotFound, +} + +/// User +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait User { + /// Create user. + /// + /// CreateUser - POST /v2/user + async fn create_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::User, + ) -> Result; + + /// Creates list of users with given input array. + /// + /// CreateUsersWithArrayInput - POST /v2/user/createWithArray + async fn create_users_with_array_input( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Vec, + ) -> Result; + + /// Creates list of users with given input array. + /// + /// CreateUsersWithListInput - POST /v2/user/createWithList + async fn create_users_with_list_input( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: Vec, + ) -> Result; + + /// Delete user. + /// + /// DeleteUser - DELETE /v2/user/{username} + async fn delete_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::DeleteUserPathParams, + ) -> Result; + + /// Get user by user name. + /// + /// GetUserByName - GET /v2/user/{username} + async fn get_user_by_name( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::GetUserByNamePathParams, + ) -> Result; + + /// Logs user into the system. + /// + /// LoginUser - GET /v2/user/login + async fn login_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + query_params: models::LoginUserQueryParams, + ) -> Result; + + /// Logs out current logged in user session. + /// + /// LogoutUser - GET /v2/user/logout + async fn logout_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Updated user. + /// + /// UpdateUser - PUT /v2/user/{username} + async fn update_user( + &self, + method: Method, + host: Host, + cookies: CookieJar, + path_params: models::UpdateUserPathParams, + body: models::User, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs index 50d589234ee..91d8f87a36a 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/lib.rs @@ -8,448 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = "/v2"; pub const API_VERSION: &str = "1.0.0"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum AddPetResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid input - Status405_InvalidInput, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeletePetResponse { - /// Invalid pet value - Status400_InvalidPetValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FindPetsByStatusResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid status value - Status400_InvalidStatusValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FindPetsByTagsResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid tag value - Status400_InvalidTagValue, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetPetByIdResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Pet not found - Status404_PetNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdatePetResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Pet not found - Status404_PetNotFound, - /// Validation exception - Status405_ValidationException, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdatePetWithFormResponse { - /// Invalid input - Status405_InvalidInput, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UploadFileResponse { - /// successful operation - Status200_SuccessfulOperation(models::ApiResponse), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeleteOrderResponse { - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Order not found - Status404_OrderNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetInventoryResponse { - /// successful operation - Status200_SuccessfulOperation(std::collections::HashMap), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetOrderByIdResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid ID supplied - Status400_InvalidIDSupplied, - /// Order not found - Status404_OrderNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum PlaceOrderResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid Order - Status400_InvalidOrder, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUserResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUsersWithArrayInputResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum CreateUsersWithListInputResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DeleteUserResponse { - /// Invalid username supplied - Status400_InvalidUsernameSupplied, - /// User not found - Status404_UserNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetUserByNameResponse { - /// successful operation - Status200_SuccessfulOperation(String), - /// Invalid username supplied - Status400_InvalidUsernameSupplied, - /// User not found - Status404_UserNotFound, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum LoginUserResponse { - /// successful operation - Status200_SuccessfulOperation { - body: String, - set_cookie: Option, - x_rate_limit: Option, - x_expires_after: Option>, - }, - /// Invalid username/password supplied - Status400_InvalidUsername, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum LogoutUserResponse { - /// successful operation - Status0_SuccessfulOperation, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum UpdateUserResponse { - /// Invalid user supplied - Status400_InvalidUserSupplied, - /// User not found - Status404_UserNotFound, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// Add a new pet to the store. - /// - /// AddPet - POST /v2/pet - async fn add_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Pet, - ) -> Result; - - /// Deletes a pet. - /// - /// DeletePet - DELETE /v2/pet/{petId} - async fn delete_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - header_params: models::DeletePetHeaderParams, - path_params: models::DeletePetPathParams, - ) -> Result; - - /// Finds Pets by status. - /// - /// FindPetsByStatus - GET /v2/pet/findByStatus - async fn find_pets_by_status( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::FindPetsByStatusQueryParams, - ) -> Result; - - /// Finds Pets by tags. - /// - /// FindPetsByTags - GET /v2/pet/findByTags - async fn find_pets_by_tags( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::FindPetsByTagsQueryParams, - ) -> Result; - - /// Find pet by ID. - /// - /// GetPetById - GET /v2/pet/{petId} - async fn get_pet_by_id( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetPetByIdPathParams, - ) -> Result; - - /// Update an existing pet. - /// - /// UpdatePet - PUT /v2/pet - async fn update_pet( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Pet, - ) -> Result; - - /// Updates a pet in the store with form data. - /// - /// UpdatePetWithForm - POST /v2/pet/{petId} - async fn update_pet_with_form( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UpdatePetWithFormPathParams, - ) -> Result; - - /// uploads an image. - /// - /// UploadFile - POST /v2/pet/{petId}/uploadImage - async fn upload_file( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UploadFilePathParams, - body: Multipart, - ) -> Result; - - /// Delete purchase order by ID. - /// - /// DeleteOrder - DELETE /v2/store/order/{orderId} - async fn delete_order( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::DeleteOrderPathParams, - ) -> Result; - - /// Returns pet inventories by status. - /// - /// GetInventory - GET /v2/store/inventory - async fn get_inventory( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Find purchase order by ID. - /// - /// GetOrderById - GET /v2/store/order/{orderId} - async fn get_order_by_id( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetOrderByIdPathParams, - ) -> Result; - - /// Place an order for a pet. - /// - /// PlaceOrder - POST /v2/store/order - async fn place_order( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::Order, - ) -> Result; - - /// Create user. - /// - /// CreateUser - POST /v2/user - async fn create_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::User, - ) -> Result; - - /// Creates list of users with given input array. - /// - /// CreateUsersWithArrayInput - POST /v2/user/createWithArray - async fn create_users_with_array_input( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Vec, - ) -> Result; - - /// Creates list of users with given input array. - /// - /// CreateUsersWithListInput - POST /v2/user/createWithList - async fn create_users_with_list_input( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: Vec, - ) -> Result; - - /// Delete user. - /// - /// DeleteUser - DELETE /v2/user/{username} - async fn delete_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::DeleteUserPathParams, - ) -> Result; - - /// Get user by user name. - /// - /// GetUserByName - GET /v2/user/{username} - async fn get_user_by_name( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::GetUserByNamePathParams, - ) -> Result; - - /// Logs user into the system. - /// - /// LoginUser - GET /v2/user/login - async fn login_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - query_params: models::LoginUserQueryParams, - ) -> Result; - - /// Logs out current logged in user session. - /// - /// LogoutUser - GET /v2/user/logout - async fn logout_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Updated user. - /// - /// UpdateUser - PUT /v2/user/{username} - async fn update_user( - &self, - method: Method, - host: Host, - cookies: CookieJar, - path_params: models::UpdateUserPathParams, - body: models::User, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/petstore/src/models.rs b/samples/server/petstore/rust-axum/output/petstore/src/models.rs index 3bc961a8430..b3e7b9da0cb 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/models.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/models.rs @@ -1008,6 +1008,317 @@ impl std::convert::TryFrom for header::IntoHeaderValue { } } +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct UpdatePetWithFormRequest { + /// Updated name of the pet + #[serde(rename = "name")] + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + + /// Updated status of the pet + #[serde(rename = "status")] + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +impl UpdatePetWithFormRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new() -> UpdatePetWithFormRequest { + UpdatePetWithFormRequest { + name: None, + status: None, + } + } +} + +/// Converts the UpdatePetWithFormRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for UpdatePetWithFormRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + self.name + .as_ref() + .map(|name| ["name".to_string(), name.to_string()].join(",")), + self.status + .as_ref() + .map(|status| ["status".to_string(), status.to_string()].join(",")), + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a UpdatePetWithFormRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for UpdatePetWithFormRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub name: Vec, + pub status: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing UpdatePetWithFormRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "name" => intermediate_rep.name.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + #[allow(clippy::redundant_clone)] + "status" => intermediate_rep.status.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing UpdatePetWithFormRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(UpdatePetWithFormRequest { + name: intermediate_rep.name.into_iter().next(), + status: intermediate_rep.status.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for UpdatePetWithFormRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into UpdatePetWithFormRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct UploadFileRequest { + /// Additional data to pass to server + #[serde(rename = "additionalMetadata")] + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_metadata: Option, + + /// file to upload + #[serde(rename = "file")] + #[serde(skip_serializing_if = "Option::is_none")] + pub file: Option, +} + +impl UploadFileRequest { + #[allow(clippy::new_without_default, clippy::too_many_arguments)] + pub fn new() -> UploadFileRequest { + UploadFileRequest { + additional_metadata: None, + file: None, + } + } +} + +/// Converts the UploadFileRequest value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::fmt::Display for UploadFileRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let params: Vec> = vec![ + self.additional_metadata + .as_ref() + .map(|additional_metadata| { + [ + "additionalMetadata".to_string(), + additional_metadata.to_string(), + ] + .join(",") + }), + // Skipping file in query parameter serialization + // Skipping file in query parameter serialization + ]; + + write!( + f, + "{}", + params.into_iter().flatten().collect::>().join(",") + ) + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a UploadFileRequest value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for UploadFileRequest { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + /// An intermediate representation of the struct to use for parsing. + #[derive(Default)] + #[allow(dead_code)] + struct IntermediateRep { + pub additional_metadata: Vec, + pub file: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(','); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => { + return std::result::Result::Err( + "Missing value while parsing UploadFileRequest".to_string(), + ) + } + }; + + if let Some(key) = key_result { + #[allow(clippy::match_single_binding)] + match key { + #[allow(clippy::redundant_clone)] + "additionalMetadata" => intermediate_rep.additional_metadata.push( + ::from_str(val).map_err(|x| x.to_string())?, + ), + "file" => return std::result::Result::Err( + "Parsing binary data in this style is not supported in UploadFileRequest" + .to_string(), + ), + _ => { + return std::result::Result::Err( + "Unexpected key while parsing UploadFileRequest".to_string(), + ) + } + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(UploadFileRequest { + additional_metadata: intermediate_rep.additional_metadata.into_iter().next(), + file: intermediate_rep.file.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and HeaderValue + +#[cfg(feature = "server")] +impl std::convert::TryFrom> for HeaderValue { + type Error = String; + + fn try_from( + hdr_value: header::IntoHeaderValue, + ) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Invalid header value for UploadFileRequest - value: {} is invalid {}", + hdr_value, e + )), + } + } +} + +#[cfg(feature = "server")] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => { + std::result::Result::Ok(header::IntoHeaderValue(value)) + } + std::result::Result::Err(err) => std::result::Result::Err(format!( + "Unable to convert header value '{}' into UploadFileRequest - {}", + value, err + )), + } + } + std::result::Result::Err(e) => std::result::Result::Err(format!( + "Unable to convert header: {:?} to string: {}", + hdr_value, e + )), + } + } +} + /// A User who is purchasing from the pet store #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] diff --git a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs index 51fb05bcfa2..097c6b1cd7c 100644 --- a/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/petstore/src/server/mod.rs @@ -10,22 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - AddPetResponse, Api, CreateUserResponse, CreateUsersWithArrayInputResponse, - CreateUsersWithListInputResponse, DeleteOrderResponse, DeletePetResponse, DeleteUserResponse, - FindPetsByStatusResponse, FindPetsByTagsResponse, GetInventoryResponse, GetOrderByIdResponse, - GetPetByIdResponse, GetUserByNameResponse, LoginUserResponse, LogoutUserResponse, - PlaceOrderResponse, UpdatePetResponse, UpdatePetWithFormResponse, UpdateUserResponse, - UploadFileResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::pet::Pet + apis::store::Store + apis::user::User + 'static, { // build our application with a route Router::new() @@ -90,7 +81,7 @@ async fn add_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || add_pet_validation(body)) @@ -110,7 +101,7 @@ where let resp = match result { Ok(rsp) => match rsp { - AddPetResponse::Status200_SuccessfulOperation(body) => { + apis::pet::AddPetResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -126,7 +117,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - AddPetResponse::Status405_InvalidInput => { + apis::pet::AddPetResponse::Status405_InvalidInput => { let mut response = response.status(405); response.body(Body::empty()) } @@ -169,7 +160,7 @@ async fn delete_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { // Header parameters let header_params = { @@ -218,7 +209,7 @@ where let resp = match result { Ok(rsp) => match rsp { - DeletePetResponse::Status400_InvalidPetValue => { + apis::pet::DeletePetResponse::Status400_InvalidPetValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -255,7 +246,7 @@ async fn find_pets_by_status( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = @@ -279,7 +270,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => { + apis::pet::FindPetsByStatusResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -295,7 +286,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - FindPetsByStatusResponse::Status400_InvalidStatusValue => { + apis::pet::FindPetsByStatusResponse::Status400_InvalidStatusValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -332,7 +323,7 @@ async fn find_pets_by_tags( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = @@ -356,7 +347,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => { + apis::pet::FindPetsByTagsResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -372,7 +363,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - FindPetsByTagsResponse::Status400_InvalidTagValue => { + apis::pet::FindPetsByTagsResponse::Status400_InvalidTagValue => { let mut response = response.status(400); response.body(Body::empty()) } @@ -409,7 +400,7 @@ async fn get_pet_by_id( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_pet_by_id_validation(path_params)) @@ -432,7 +423,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetPetByIdResponse::Status200_SuccessfulOperation(body) => { + apis::pet::GetPetByIdResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -448,11 +439,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetPetByIdResponse::Status400_InvalidIDSupplied => { + apis::pet::GetPetByIdResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetPetByIdResponse::Status404_PetNotFound => { + apis::pet::GetPetByIdResponse::Status404_PetNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -497,7 +488,7 @@ async fn update_pet( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || update_pet_validation(body)) @@ -520,7 +511,7 @@ where let resp = match result { Ok(rsp) => match rsp { - UpdatePetResponse::Status200_SuccessfulOperation(body) => { + apis::pet::UpdatePetResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -536,15 +527,15 @@ where let body_content = body; response.body(Body::from(body_content)) } - UpdatePetResponse::Status400_InvalidIDSupplied => { + apis::pet::UpdatePetResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - UpdatePetResponse::Status404_PetNotFound => { + apis::pet::UpdatePetResponse::Status404_PetNotFound => { let mut response = response.status(404); response.body(Body::empty()) } - UpdatePetResponse::Status405_ValidationException => { + apis::pet::UpdatePetResponse::Status405_ValidationException => { let mut response = response.status(405); response.body(Body::empty()) } @@ -562,13 +553,31 @@ where }) } +#[derive(validator::Validate)] +#[allow(dead_code)] +struct UpdatePetWithFormBodyValidator<'a> { + #[validate(nested)] + body: &'a models::UpdatePetWithFormRequest, +} + #[tracing::instrument(skip_all)] fn update_pet_with_form_validation( path_params: models::UpdatePetWithFormPathParams, -) -> std::result::Result<(models::UpdatePetWithFormPathParams,), ValidationErrors> { + body: Option, +) -> std::result::Result< + ( + models::UpdatePetWithFormPathParams, + Option, + ), + ValidationErrors, +> { path_params.validate()?; + if let Some(body) = &body { + let b = UpdatePetWithFormBodyValidator { body }; + b.validate()?; + } - Ok((path_params,)) + Ok((path_params, body)) } /// UpdatePetWithForm - POST /v2/pet/{petId} #[tracing::instrument(skip_all)] @@ -578,18 +587,19 @@ async fn update_pet_with_form( cookies: CookieJar, Path(path_params): Path, State(api_impl): State, + Form(body): Form>, ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = - tokio::task::spawn_blocking(move || update_pet_with_form_validation(path_params)) + tokio::task::spawn_blocking(move || update_pet_with_form_validation(path_params, body)) .await .unwrap(); - let Ok((path_params,)) = validation else { + let Ok((path_params, body)) = validation else { return Response::builder() .status(StatusCode::BAD_REQUEST) .body(Body::from(validation.unwrap_err().to_string())) @@ -598,14 +608,14 @@ where let result = api_impl .as_ref() - .update_pet_with_form(method, host, cookies, path_params) + .update_pet_with_form(method, host, cookies, path_params, body) .await; let mut response = Response::builder(); let resp = match result { Ok(rsp) => match rsp { - UpdatePetWithFormResponse::Status405_InvalidInput => { + apis::pet::UpdatePetWithFormResponse::Status405_InvalidInput => { let mut response = response.status(405); response.body(Body::empty()) } @@ -643,7 +653,7 @@ async fn upload_file( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::pet::Pet, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || upload_file_validation(path_params)) @@ -666,7 +676,7 @@ where let resp = match result { Ok(rsp) => match rsp { - UploadFileResponse::Status200_SuccessfulOperation(body) => { + apis::pet::UploadFileResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -722,7 +732,7 @@ async fn delete_order( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || delete_order_validation(path_params)) @@ -745,11 +755,11 @@ where let resp = match result { Ok(rsp) => match rsp { - DeleteOrderResponse::Status400_InvalidIDSupplied => { + apis::store::DeleteOrderResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - DeleteOrderResponse::Status404_OrderNotFound => { + apis::store::DeleteOrderResponse::Status404_OrderNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -781,7 +791,7 @@ async fn get_inventory( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_inventory_validation()) @@ -801,7 +811,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetInventoryResponse::Status200_SuccessfulOperation(body) => { + apis::store::GetInventoryResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -857,7 +867,7 @@ async fn get_order_by_id( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_order_by_id_validation(path_params)) @@ -880,7 +890,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetOrderByIdResponse::Status200_SuccessfulOperation(body) => { + apis::store::GetOrderByIdResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -896,11 +906,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetOrderByIdResponse::Status400_InvalidIDSupplied => { + apis::store::GetOrderByIdResponse::Status400_InvalidIDSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetOrderByIdResponse::Status404_OrderNotFound => { + apis::store::GetOrderByIdResponse::Status404_OrderNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -945,7 +955,7 @@ async fn place_order( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::store::Store, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || place_order_validation(body)) @@ -968,7 +978,7 @@ where let resp = match result { Ok(rsp) => match rsp { - PlaceOrderResponse::Status200_SuccessfulOperation(body) => { + apis::store::PlaceOrderResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -984,7 +994,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - PlaceOrderResponse::Status400_InvalidOrder => { + apis::store::PlaceOrderResponse::Status400_InvalidOrder => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1029,7 +1039,7 @@ async fn create_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || create_user_validation(body)) @@ -1052,7 +1062,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUserResponse::Status0_SuccessfulOperation => { + apis::user::CreateUserResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -1097,7 +1107,7 @@ async fn create_users_with_array_input( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = @@ -1121,7 +1131,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => { + apis::user::CreateUsersWithArrayInputResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -1166,7 +1176,7 @@ async fn create_users_with_list_input( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = @@ -1190,7 +1200,7 @@ where let resp = match result { Ok(rsp) => match rsp { - CreateUsersWithListInputResponse::Status0_SuccessfulOperation => { + apis::user::CreateUsersWithListInputResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -1227,7 +1237,7 @@ async fn delete_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || delete_user_validation(path_params)) @@ -1250,11 +1260,11 @@ where let resp = match result { Ok(rsp) => match rsp { - DeleteUserResponse::Status400_InvalidUsernameSupplied => { + apis::user::DeleteUserResponse::Status400_InvalidUsernameSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - DeleteUserResponse::Status404_UserNotFound => { + apis::user::DeleteUserResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -1291,7 +1301,7 @@ async fn get_user_by_name( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_user_by_name_validation(path_params)) @@ -1314,7 +1324,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetUserByNameResponse::Status200_SuccessfulOperation(body) => { + apis::user::GetUserByNameResponse::Status200_SuccessfulOperation(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -1330,11 +1340,11 @@ where let body_content = body; response.body(Body::from(body_content)) } - GetUserByNameResponse::Status400_InvalidUsernameSupplied => { + apis::user::GetUserByNameResponse::Status400_InvalidUsernameSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - GetUserByNameResponse::Status404_UserNotFound => { + apis::user::GetUserByNameResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } @@ -1371,7 +1381,7 @@ async fn login_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || login_user_validation(query_params)) @@ -1394,7 +1404,7 @@ where let resp = match result { Ok(rsp) => match rsp { - LoginUserResponse::Status200_SuccessfulOperation { + apis::user::LoginUserResponse::Status200_SuccessfulOperation { body, set_cookie, x_rate_limit, @@ -1462,7 +1472,7 @@ where let body_content = body; response.body(Body::from(body_content)) } - LoginUserResponse::Status400_InvalidUsername => { + apis::user::LoginUserResponse::Status400_InvalidUsername => { let mut response = response.status(400); response.body(Body::empty()) } @@ -1494,7 +1504,7 @@ async fn logout_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || logout_user_validation()) @@ -1514,7 +1524,7 @@ where let resp = match result { Ok(rsp) => match rsp { - LogoutUserResponse::Status0_SuccessfulOperation => { + apis::user::LogoutUserResponse::Status0_SuccessfulOperation => { let mut response = response.status(0); response.body(Body::empty()) } @@ -1562,7 +1572,7 @@ async fn update_user( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::user::User, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || update_user_validation(path_params, body)) @@ -1585,11 +1595,11 @@ where let resp = match result { Ok(rsp) => match rsp { - UpdateUserResponse::Status400_InvalidUserSupplied => { + apis::user::UpdateUserResponse::Status400_InvalidUserSupplied => { let mut response = response.status(400); response.body(Body::empty()) } - UpdateUserResponse::Status404_UserNotFound => { + apis::user::UpdateUserResponse::Status404_UserNotFound => { let mut response = response.status(404); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES index ea1c5b8c5be..683914c4c64 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore Cargo.toml README.md +src/apis/default.rs +src/apis/mod.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md b/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md index 56b88a40475..49a2490640c 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 1.0 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs new file mode 100644 index 00000000000..3608ffa6557 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/default.rs @@ -0,0 +1,29 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum PingGetResponse { + /// OK + Status201_OK, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// PingGet - GET /ping + async fn ping_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs index f09f3f93369..127b67da835 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/lib.rs @@ -8,44 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum PingGetResponse { - /// OK - Status201_OK, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// PingGet - GET /ping - async fn ping_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs index 6f0aa768504..2d1e7ca1011 100644 --- a/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/ping-bearer-auth/src/server/mod.rs @@ -10,15 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{Api, PingGetResponse}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::default::Default + 'static, { // build our application with a route Router::new() @@ -40,7 +38,7 @@ async fn ping_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || ping_get_validation()) @@ -60,7 +58,7 @@ where let resp = match result { Ok(rsp) => match rsp { - PingGetResponse::Status201_OK => { + apis::default::PingGetResponse::Status201_OK => { let mut response = response.status(201); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.gitignore b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator-ignore b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES new file mode 100644 index 00000000000..683914c4c64 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/FILES @@ -0,0 +1,10 @@ +.gitignore +Cargo.toml +README.md +src/apis/default.rs +src/apis/mod.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs +src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/VERSION new file mode 100644 index 00000000000..ecb21862b1e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml new file mode 100644 index 00000000000..48c393fd4b0 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "rust-axum-header-uui" +version = "0.1.9" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +edition = "2021" + +[features] +default = ["server"] +server = [] +conversion = [ + "frunk", + "frunk_derives", + "frunk_core", + "frunk-enum-core", + "frunk-enum-derive", +] + +[dependencies] +async-trait = "0.1" +axum = { version = "0.7" } +axum-extra = { version = "0.9", features = ["cookie", "multipart"] } +base64 = "0.22" +bytes = "1" +chrono = { version = "0.4", features = ["serde"] } +frunk = { version = "0.4", optional = true } +frunk-enum-core = { version = "0.3", optional = true } +frunk-enum-derive = { version = "0.3", optional = true } +frunk_core = { version = "0.4", optional = true } +frunk_derives = { version = "0.4", optional = true } +http = "1" +lazy_static = "1" +regex = "1" +serde = { version = "1", features = ["derive"] } +serde_json = { version = "1", features = ["raw_value"] } +serde_urlencoded = "0.7" +tokio = { version = "1", default-features = false, features = [ + "signal", + "rt-multi-thread", +] } +tracing = { version = "0.1", features = ["attributes"] } +uuid = { version = "1", features = ["serde"] } +validator = { version = "0.18", features = ["derive"] } + +[dev-dependencies] +tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/README.md b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/README.md new file mode 100644 index 00000000000..e99c9e7847f --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/README.md @@ -0,0 +1,91 @@ +# Rust API for rust-axum-header-uui + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview + +This server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. + +To see how to make this your own, look here: [README]((https://openapi-generator.tech)) + +- API version: 0.1.9 +- Generator version: 7.6.0-SNAPSHOT + + + +This autogenerated project defines an API crate `rust-axum-header-uui` which contains: +* An `Api` trait defining the API in Rust. +* Data types representing the underlying data model. +* Axum router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. + * Request validations (path, query, body params) are included. + +## Using the generated library + +The generated library has a few optional features that can be activated through Cargo. + +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on Axum. + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. + +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. + +### Example + +```rust +struct ServerImpl { + // database: sea_orm::DbConn, +} + +#[allow(unused_variables)] +#[async_trait] +impl rust-axum-header-uui::Api for ServerImpl { + // API implementation goes here +} + +pub async fn start_server(addr: &str) { + // initialize tracing + tracing_subscriber::fmt::init(); + + // Init Axum router + let app = rust-axum-header-uui::server::new(Arc::new(ServerImpl)); + + // Add layers to the router + let app = app.layer(...); + + // Run the server with graceful shutdown + let listener = TcpListener::bind(addr).await.unwrap(); + axum::serve(listener, app) + .with_graceful_shutdown(shutdown_signal()) + .await + .unwrap(); +} + +async fn shutdown_signal() { + let ctrl_c = async { + signal::ctrl_c() + .await + .expect("failed to install Ctrl+C handler"); + }; + + #[cfg(unix)] + let terminate = async { + signal::unix::signal(signal::unix::SignalKind::terminate()) + .expect("failed to install signal handler") + .recv() + .await; + }; + + #[cfg(not(unix))] + let terminate = std::future::pending::<()>(); + + tokio::select! { + _ = ctrl_c => {}, + _ = terminate => {}, + } +} +``` diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs new file mode 100644 index 00000000000..cd590f6819a --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/default.rs @@ -0,0 +1,30 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum UsersPostResponse { + /// Added row to table! + Status201_AddedRowToTable(String), +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// UsersPost - POST /users + async fn users_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + header_params: models::UsersPostHeaderParams, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/header.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/header.rs new file mode 100644 index 00000000000..656550c1324 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/header.rs @@ -0,0 +1,230 @@ +use std::{convert::TryFrom, fmt, ops::Deref, str::FromStr}; + +use chrono::{DateTime, Utc}; +use http::HeaderValue; + +/// A struct to allow homogeneous conversion into a HeaderValue. We can't +/// implement the From/Into trait on HeaderValue because we don't own +/// either of the types. +#[derive(Debug, Clone)] +pub(crate) struct IntoHeaderValue(pub T); + +// Generic implementations + +impl Deref for IntoHeaderValue { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } +} + +// Derive for each TryFrom in http::HeaderValue + +macro_rules! ihv_generate { + ($t:ident) => { + impl TryFrom for IntoHeaderValue<$t> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match hdr_value.parse::<$t>() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value)), + Err(e) => Err(format!( + "Unable to parse {} as a string: {}", + stringify!($t), + e + )), + }, + Err(e) => Err(format!( + "Unable to parse header {:?} as a string - {}", + hdr_value, e + )), + } + } + } + + impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue<$t>) -> Result { + Ok(hdr_value.0.into()) + } + } + }; +} + +ihv_generate!(u64); +ihv_generate!(i64); +ihv_generate!(i16); +ihv_generate!(u16); +ihv_generate!(u32); +ihv_generate!(usize); +ihv_generate!(isize); +ihv_generate!(i32); + +// Custom derivations + +// Vec + +impl TryFrom for IntoHeaderValue> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => Ok(IntoHeaderValue( + hdr_value + .split(',') + .filter_map(|x| match x.trim() { + "" => None, + y => Some(y.to_string()), + }) + .collect(), + )), + Err(e) => Err(format!( + "Unable to parse header: {:?} as a string - {}", + hdr_value, e + )), + } + } +} + +impl TryFrom>> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue>) -> Result { + match HeaderValue::from_str(&hdr_value.0.join(", ")) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} into a header - {}", + hdr_value, e + )), + } + } +} + +// String + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value.to_string())), + Err(e) => Err(format!("Unable to convert header {:?} to {}", hdr_value, e)), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_str(&hdr_value.0) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} from a header {}", + hdr_value, e + )), + } + } +} + +// Bool + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match hdr_value.parse() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value)), + Err(e) => Err(format!("Unable to parse bool from {} - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert {:?} from a header {}", + hdr_value, e + )), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_str(&hdr_value.0.to_string()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert: {:?} into a header: {}", + hdr_value, e + )), + } + } +} + +// DateTime + +impl TryFrom for IntoHeaderValue> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match DateTime::parse_from_rfc3339(hdr_value) { + Ok(date) => Ok(IntoHeaderValue(date.with_timezone(&Utc))), + Err(e) => Err(format!("Unable to parse: {} as date - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert header {:?} to string {}", + hdr_value, e + )), + } + } +} + +impl TryFrom>> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue>) -> Result { + match HeaderValue::from_str(hdr_value.0.to_rfc3339().as_str()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} to a header: {}", + hdr_value, e + )), + } + } +} + +// uuid::Uuid + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match uuid::Uuid::from_str(hdr_value) { + Ok(uuid) => Ok(IntoHeaderValue(uuid)), + Err(e) => Err(format!("Unable to parse: {} as uuid - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert header {:?} to string {}", + hdr_value, e + )), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_bytes(hdr_value.0.as_bytes()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} to a header: {}", + hdr_value, e + )), + } + } +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs new file mode 100644 index 00000000000..7f6af70e59f --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/lib.rs @@ -0,0 +1,28 @@ +#![allow( + missing_docs, + trivial_casts, + unused_variables, + unused_mut, + unused_extern_crates, + non_camel_case_types, + unused_imports, + unused_attributes +)] +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] + +pub const BASE_PATH: &str = ""; +pub const API_VERSION: &str = "0.1.9"; + +#[cfg(feature = "server")] +pub mod server; + +pub mod apis; +pub mod models; +pub mod types; + +#[cfg(feature = "server")] +pub(crate) mod header; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/models.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/models.rs new file mode 100644 index 00000000000..22862b9b8b3 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/models.rs @@ -0,0 +1,49 @@ +#![allow(unused_qualifications)] + +use http::HeaderValue; +use validator::Validate; + +#[cfg(feature = "server")] +use crate::header; +use crate::{models, types::*}; + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct UsersPostHeaderParams { + pub some_uid: uuid::Uuid, +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct HeaderUuid(uuid::Uuid); + +impl validator::Validate for HeaderUuid { + fn validate(&self) -> std::result::Result<(), validator::ValidationErrors> { + std::result::Result::Ok(()) + } +} + +impl std::convert::From for HeaderUuid { + fn from(x: uuid::Uuid) -> Self { + HeaderUuid(x) + } +} + +impl std::convert::From for uuid::Uuid { + fn from(x: HeaderUuid) -> Self { + x.0 + } +} + +impl std::ops::Deref for HeaderUuid { + type Target = uuid::Uuid; + fn deref(&self) -> &uuid::Uuid { + &self.0 + } +} + +impl std::ops::DerefMut for HeaderUuid { + fn deref_mut(&mut self) -> &mut uuid::Uuid { + &mut self.0 + } +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs new file mode 100644 index 00000000000..e0deda59d9c --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/server/mod.rs @@ -0,0 +1,137 @@ +use std::collections::HashMap; + +use axum::{body::Body, extract::*, response::Response, routing::*}; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode}; +use tracing::error; +use validator::{Validate, ValidationErrors}; + +use crate::{header, types::*}; + +#[allow(unused_imports)] +use crate::{apis, models}; + +/// Setup API Server. +pub fn new(api_impl: I) -> Router +where + I: AsRef + Clone + Send + Sync + 'static, + A: apis::default::Default + 'static, +{ + // build our application with a route + Router::new() + .route("/users", post(users_post::)) + .with_state(api_impl) +} + +#[tracing::instrument(skip_all)] +fn users_post_validation( + header_params: models::UsersPostHeaderParams, +) -> std::result::Result<(models::UsersPostHeaderParams,), ValidationErrors> { + header_params.validate()?; + + Ok((header_params,)) +} +/// UsersPost - POST /users +#[tracing::instrument(skip_all)] +async fn users_post( + method: Method, + host: Host, + cookies: CookieJar, + headers: HeaderMap, + State(api_impl): State, +) -> Result +where + I: AsRef + Send + Sync, + A: apis::default::Default, +{ + // Header parameters + let header_params = { + let header_some_uid = headers.get(HeaderName::from_static("some_uid")); + + let header_some_uid = match header_some_uid { + Some(v) => match header::IntoHeaderValue::::try_from((*v).clone()) { + Ok(result) => result.0, + Err(err) => { + return Response::builder() + .status(StatusCode::BAD_REQUEST) + .body(Body::from(format!("Invalid header some_uid - {}", err))) + .map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }); + } + }, + None => { + return Response::builder() + .status(StatusCode::BAD_REQUEST) + .body(Body::from("Missing required header some_uid")) + .map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }); + } + }; + + models::UsersPostHeaderParams { + some_uid: header_some_uid, + } + }; + + #[allow(clippy::redundant_closure)] + let validation = tokio::task::spawn_blocking(move || users_post_validation(header_params)) + .await + .unwrap(); + + let Ok((header_params,)) = validation else { + return Response::builder() + .status(StatusCode::BAD_REQUEST) + .body(Body::from(validation.unwrap_err().to_string())) + .map_err(|_| StatusCode::BAD_REQUEST); + }; + + let result = api_impl + .as_ref() + .users_post(method, host, cookies, header_params) + .await; + + let mut response = Response::builder(); + + let resp = match result { + Ok(rsp) => match rsp { + apis::default::UsersPostResponse::Status201_AddedRowToTable(body) => { + let mut response = response.status(201); + { + let mut response_headers = response.headers_mut().unwrap(); + response_headers.insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json").map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + })?, + ); + } + + let body_content = tokio::task::spawn_blocking(move || { + serde_json::to_vec(&body).map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }) + }) + .await + .unwrap()?; + response.body(Body::from(body_content)) + } + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.status(500).body(Body::empty()) + } + }; + + resp.map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }) +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/types.rs b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/types.rs new file mode 100644 index 00000000000..aac11a86f4d --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-header-uuid/src/types.rs @@ -0,0 +1,665 @@ +use std::{mem, str::FromStr}; + +use base64::{engine::general_purpose, Engine}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[allow(dead_code)] +pub struct Object(serde_json::Value); + +impl validator::Validate for Object { + fn validate(&self) -> Result<(), validator::ValidationErrors> { + Ok(()) + } +} + +impl FromStr for Object { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(Self(serde_json::Value::String(s.to_owned()))) + } +} + +/// Serde helper function to create a default `Option>` while +/// deserializing +pub fn default_optional_nullable() -> Option> { + None +} + +/// Serde helper function to deserialize into an `Option>` +pub fn deserialize_optional_nullable<'de, D, T>( + deserializer: D, +) -> Result>, D::Error> +where + D: Deserializer<'de>, + T: Deserialize<'de>, +{ + Option::::deserialize(deserializer).map(|val| match val { + Some(inner) => Some(Nullable::Present(inner)), + None => Some(Nullable::Null), + }) +} + +/// The Nullable type. Represents a value which may be specified as null on an API. +/// Note that this is distinct from a value that is optional and not present! +/// +/// Nullable implements many of the same methods as the Option type (map, unwrap, etc). +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] +pub enum Nullable { + /// Null value + Null, + /// Value is present + Present(T), +} + +impl Nullable { + ///////////////////////////////////////////////////////////////////////// + // Querying the contained values + ///////////////////////////////////////////////////////////////////////// + + /// Returns `true` if the Nullable is a `Present` value. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x: Nullable = Nullable::Present(2); + /// assert_eq!(x.is_present(), true); + /// + /// let x: Nullable = Nullable::Null; + /// assert_eq!(x.is_present(), false); + /// ``` + #[inline] + pub fn is_present(&self) -> bool { + match *self { + Nullable::Present(_) => true, + Nullable::Null => false, + } + } + + /// Returns `true` if the Nullable is a `Null` value. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x: Nullable = Nullable::Present(2); + /// assert_eq!(x.is_null(), false); + /// + /// let x: Nullable = Nullable::Null; + /// assert_eq!(x.is_null(), true); + /// ``` + #[inline] + pub fn is_null(&self) -> bool { + !self.is_present() + } + + ///////////////////////////////////////////////////////////////////////// + // Adapter for working with references + ///////////////////////////////////////////////////////////////////////// + + /// Converts from `Nullable` to `Nullable<&T>`. + /// + /// # Examples + /// + /// Convert an `Nullable<`[`String`]`>` into a `Nullable<`[`usize`]`>`, preserving the original. + /// The [`map`] method takes the `self` argument by value, consuming the original, + /// so this technique uses `as_ref` to first take a `Nullable` to a reference + /// to the value inside the original. + /// + /// [`map`]: enum.Nullable.html#method.map + /// [`String`]: ../../std/string/struct.String.html + /// [`usize`]: ../../std/primitive.usize.html + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let num_as_str: Nullable = Nullable::Present("10".to_string()); + /// // First, cast `Nullable` to `Nullable<&String>` with `as_ref`, + /// // then consume *that* with `map`, leaving `num_as_str` on the stack. + /// let num_as_int: Nullable = num_as_str.as_ref().map(|n| n.len()); + /// println!("still can print num_as_str: {:?}", num_as_str); + /// ``` + #[inline] + pub fn as_ref(&self) -> Nullable<&T> { + match *self { + Nullable::Present(ref x) => Nullable::Present(x), + Nullable::Null => Nullable::Null, + } + } + + /// Converts from `Nullable` to `Nullable<&mut T>`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let mut x = Nullable::Present(2); + /// match x.as_mut() { + /// Nullable::Present(v) => *v = 42, + /// Nullable::Null => {}, + /// } + /// assert_eq!(x, Nullable::Present(42)); + /// ``` + #[inline] + pub fn as_mut(&mut self) -> Nullable<&mut T> { + match *self { + Nullable::Present(ref mut x) => Nullable::Present(x), + Nullable::Null => Nullable::Null, + } + } + + ///////////////////////////////////////////////////////////////////////// + // Getting to contained values + ///////////////////////////////////////////////////////////////////////// + + /// Unwraps a Nullable, yielding the content of a `Nullable::Present`. + /// + /// # Panics + /// + /// Panics if the value is a [`Nullable::Null`] with a custom panic message provided by + /// `msg`. + /// + /// [`Nullable::Null`]: #variant.Null + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present("value"); + /// assert_eq!(x.expect("the world is ending"), "value"); + /// ``` + /// + /// ```{.should_panic} + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x: Nullable<&str> = Nullable::Null; + /// x.expect("the world is ending"); // panics with `the world is ending` + /// ``` + #[inline] + pub fn expect(self, msg: &str) -> T { + match self { + Nullable::Present(val) => val, + Nullable::Null => expect_failed(msg), + } + } + + /// Moves the value `v` out of the `Nullable` if it is `Nullable::Present(v)`. + /// + /// In general, because this function may panic, its use is discouraged. + /// Instead, prefer to use pattern matching and handle the `Nullable::Null` + /// case explicitly. + /// + /// # Panics + /// + /// Panics if the self value equals [`Nullable::Null`]. + /// + /// [`Nullable::Null`]: #variant.Null + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present("air"); + /// assert_eq!(x.unwrap(), "air"); + /// ``` + /// + /// ```{.should_panic} + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.unwrap(), "air"); // fails + /// ``` + #[inline] + pub fn unwrap(self) -> T { + match self { + Nullable::Present(val) => val, + Nullable::Null => panic!("called `Nullable::unwrap()` on a `Nullable::Null` value"), + } + } + + /// Returns the contained value or a default. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// assert_eq!(Nullable::Present("car").unwrap_or("bike"), "car"); + /// assert_eq!(Nullable::Null.unwrap_or("bike"), "bike"); + /// ``` + #[inline] + pub fn unwrap_or(self, def: T) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => def, + } + } + + /// Returns the contained value or computes it from a closure. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let k = 10; + /// assert_eq!(Nullable::Present(4).unwrap_or_else(|| 2 * k), 4); + /// assert_eq!(Nullable::Null.unwrap_or_else(|| 2 * k), 20); + /// ``` + #[inline] + pub fn unwrap_or_else T>(self, f: F) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => f(), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Transforming contained values + ///////////////////////////////////////////////////////////////////////// + + /// Maps a `Nullable` to `Nullable` by applying a function to a contained value. + /// + /// # Examples + /// + /// Convert a `Nullable<`[`String`]`>` into a `Nullable<`[`usize`]`>`, consuming the original: + /// + /// [`String`]: ../../std/string/struct.String.html + /// [`usize`]: ../../std/primitive.usize.html + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let maybe_some_string = Nullable::Present(String::from("Hello, World!")); + /// // `Nullable::map` takes self *by value*, consuming `maybe_some_string` + /// let maybe_some_len = maybe_some_string.map(|s| s.len()); + /// + /// assert_eq!(maybe_some_len, Nullable::Present(13)); + /// ``` + #[inline] + pub fn map U>(self, f: F) -> Nullable { + match self { + Nullable::Present(x) => Nullable::Present(f(x)), + Nullable::Null => Nullable::Null, + } + } + + /// Applies a function to the contained value (if any), + /// or returns a `default` (if not). + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.map_or(42, |v| v.len()), 3); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.map_or(42, |v| v.len()), 42); + /// ``` + #[inline] + pub fn map_or U>(self, default: U, f: F) -> U { + match self { + Nullable::Present(t) => f(t), + Nullable::Null => default, + } + } + + /// Applies a function to the contained value (if any), + /// or computes a `default` (if not). + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let k = 21; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42); + /// ``` + #[inline] + pub fn map_or_else U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U { + match self { + Nullable::Present(t) => f(t), + Nullable::Null => default(), + } + } + + /// Transforms the `Nullable` into a [`Result`], mapping `Nullable::Present(v)` to + /// [`Ok(v)`] and `Nullable::Null` to [`Err(err)`][Err]. + /// + /// [`Result`]: ../../std/result/enum.Result.html + /// [`Ok(v)`]: ../../std/result/enum.Result.html#variant.Ok + /// [Err]: ../../std/result/enum.Result.html#variant.Err + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.ok_or(0), Ok("foo")); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.ok_or(0), Err(0)); + /// ``` + #[inline] + pub fn ok_or(self, err: E) -> Result { + match self { + Nullable::Present(v) => Ok(v), + Nullable::Null => Err(err), + } + } + + /// Transforms the `Nullable` into a [`Result`], mapping `Nullable::Present(v)` to + /// [`Ok(v)`] and `Nullable::Null` to [`Err(err())`][Err]. + /// + /// [`Result`]: ../../std/result/enum.Result.html + /// [`Ok(v)`]: ../../std/result/enum.Result.html#variant.Ok + /// [Err]: ../../std/result/enum.Result.html#variant.Err + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.ok_or_else(|| 0), Ok("foo")); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.ok_or_else(|| 0), Err(0)); + /// ``` + #[inline] + pub fn ok_or_else E>(self, err: F) -> Result { + match self { + Nullable::Present(v) => Ok(v), + Nullable::Null => Err(err()), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Boolean operations on the values, eager and lazy + ///////////////////////////////////////////////////////////////////////// + + /// Returns `Nullable::Null` if the Nullable is `Nullable::Null`, otherwise returns `optb`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present(2); + /// let y: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.and(y), Nullable::Null); + /// + /// let x: Nullable = Nullable::Null; + /// let y = Nullable::Present("foo"); + /// assert_eq!(x.and(y), Nullable::Null); + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Present("foo"); + /// assert_eq!(x.and(y), Nullable::Present("foo")); + /// + /// let x: Nullable = Nullable::Null; + /// let y: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.and(y), Nullable::Null); + /// ``` + #[inline] + pub fn and(self, optb: Nullable) -> Nullable { + match self { + Nullable::Present(_) => optb, + Nullable::Null => Nullable::Null, + } + } + + /// Returns `Nullable::Null` if the Nullable is `Nullable::Null`, otherwise calls `f` with the + /// wrapped value and returns the result. + /// + /// Some languages call this operation flatmap. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// fn sq(x: u32) -> Nullable { Nullable::Present(x * x) } + /// fn nope(_: u32) -> Nullable { Nullable::Null } + /// + /// assert_eq!(Nullable::Present(2).and_then(sq).and_then(sq), Nullable::Present(16)); + /// assert_eq!(Nullable::Present(2).and_then(sq).and_then(nope), Nullable::Null); + /// assert_eq!(Nullable::Present(2).and_then(nope).and_then(sq), Nullable::Null); + /// assert_eq!(Nullable::Null.and_then(sq).and_then(sq), Nullable::Null); + /// ``` + #[inline] + pub fn and_then Nullable>(self, f: F) -> Nullable { + match self { + Nullable::Present(x) => f(x), + Nullable::Null => Nullable::Null, + } + } + + /// Returns the Nullable if it contains a value, otherwise returns `optb`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Null; + /// assert_eq!(x.or(y), Nullable::Present(2)); + /// + /// let x = Nullable::Null; + /// let y = Nullable::Present(100); + /// assert_eq!(x.or(y), Nullable::Present(100)); + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Present(100); + /// assert_eq!(x.or(y), Nullable::Present(2)); + /// + /// let x: Nullable = Nullable::Null; + /// let y = Nullable::Null; + /// assert_eq!(x.or(y), Nullable::Null); + /// ``` + #[inline] + pub fn or(self, optb: Nullable) -> Nullable { + match self { + Nullable::Present(_) => self, + Nullable::Null => optb, + } + } + + /// Returns the Nullable if it contains a value, otherwise calls `f` and + /// returns the result. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// fn nobody() -> Nullable<&'static str> { Nullable::Null } + /// fn vikings() -> Nullable<&'static str> { Nullable::Present("vikings") } + /// + /// assert_eq!(Nullable::Present("barbarians").or_else(vikings), + /// Nullable::Present("barbarians")); + /// assert_eq!(Nullable::Null.or_else(vikings), Nullable::Present("vikings")); + /// assert_eq!(Nullable::Null.or_else(nobody), Nullable::Null); + /// ``` + #[inline] + pub fn or_else Nullable>(self, f: F) -> Nullable { + match self { + Nullable::Present(_) => self, + Nullable::Null => f(), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Misc + ///////////////////////////////////////////////////////////////////////// + + /// Takes the value out of the Nullable, leaving a `Nullable::Null` in its place. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let mut x = Nullable::Present(2); + /// x.take(); + /// assert_eq!(x, Nullable::Null); + /// + /// let mut x: Nullable = Nullable::Null; + /// x.take(); + /// assert_eq!(x, Nullable::Null); + /// ``` + #[inline] + pub fn take(&mut self) -> Nullable { + mem::replace(self, Nullable::Null) + } +} + +impl<'a, T: Clone> Nullable<&'a T> { + /// Maps an `Nullable<&T>` to an `Nullable` by cloning the contents of the + /// Nullable. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = 12; + /// let opt_x = Nullable::Present(&x); + /// assert_eq!(opt_x, Nullable::Present(&12)); + /// let cloned = opt_x.cloned(); + /// assert_eq!(cloned, Nullable::Present(12)); + /// ``` + pub fn cloned(self) -> Nullable { + self.map(Clone::clone) + } +} + +impl Nullable { + /// Returns the contained value or a default + /// + /// Consumes the `self` argument then, if `Nullable::Present`, returns the contained + /// value, otherwise if `Nullable::Null`, returns the default value for that + /// type. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_header_uui::types::Nullable; + /// + /// let x = Nullable::Present(42); + /// assert_eq!(42, x.unwrap_or_default()); + /// + /// let y: Nullable = Nullable::Null; + /// assert_eq!(0, y.unwrap_or_default()); + /// ``` + #[inline] + pub fn unwrap_or_default(self) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => Default::default(), + } + } +} + +impl Default for Nullable { + /// Returns None. + #[inline] + fn default() -> Nullable { + Nullable::Null + } +} + +impl From for Nullable { + fn from(val: T) -> Nullable { + Nullable::Present(val) + } +} + +impl Serialize for Nullable +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Nullable::Present(ref inner) => serializer.serialize_some(&inner), + Nullable::Null => serializer.serialize_none(), + } + } +} + +impl<'de, T> Deserialize<'de> for Nullable +where + T: serde::de::DeserializeOwned, +{ + fn deserialize(deserializer: D) -> Result, D::Error> + where + D: Deserializer<'de>, + { + // In order to deserialize a required, but nullable, value, we first have to check whether + // the value is present at all. To do this, we deserialize to a serde_json::Value, which + // fails if the value is missing, or gives serde_json::Value::Null if the value is present. + // If that succeeds as null, we can easily return a Null. + // If that succeeds as some value, we deserialize that value and return a Present. + // If that errors, we return the error. + let presence: Result<::serde_json::Value, _> = + serde::Deserialize::deserialize(deserializer); + match presence { + Ok(serde_json::Value::Null) => Ok(Nullable::Null), + Ok(some_value) => serde_json::from_value(some_value) + .map(Nullable::Present) + .map_err(serde::de::Error::custom), + Err(x) => Err(x), + } + } +} + +#[inline(never)] +#[cold] +fn expect_failed(msg: &str) -> ! { + panic!("{}", msg) +} + +#[derive(Debug, Clone, PartialEq, PartialOrd)] +/// Base64-encoded byte array +pub struct ByteArray(pub Vec); + +impl Serialize for ByteArray { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&general_purpose::STANDARD.encode(&self.0)) + } +} + +impl<'de> Deserialize<'de> for ByteArray { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match general_purpose::STANDARD.decode(s) { + Ok(bin) => Ok(ByteArray(bin)), + _ => Err(serde::de::Error::custom("invalid base64")), + } + } +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES index ea1c5b8c5be..683914c4c64 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/FILES @@ -1,6 +1,8 @@ .gitignore Cargo.toml README.md +src/apis/default.rs +src/apis/mod.rs src/header.rs src/lib.rs src/models.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION index 08bfd0643b8..ecb21862b1e 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0-SNAPSHOT +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/README.md b/samples/server/petstore/rust-axum/output/rust-axum-test/README.md index d1f027f128d..615ce4f4c74 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/README.md +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/README.md @@ -12,7 +12,7 @@ server, you can easily generate a server stub. To see how to make this your own, look here: [README]((https://openapi-generator.tech)) - API version: 2.3.4 -- Generator version: 7.5.0-SNAPSHOT +- Generator version: 7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs new file mode 100644 index 00000000000..b6809341c82 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/default.rs @@ -0,0 +1,171 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum AllOfGetResponse { + /// OK + Status200_OK(models::AllOfObject), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DummyGetResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum DummyPutResponse { + /// Success + Status200_Success, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum FileResponseGetResponse { + /// Success + Status200_Success(ByteArray), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum GetStructuredYamlResponse { + /// OK + Status200_OK(String), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum HtmlPostResponse { + /// Success + Status200_Success(String), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum PostYamlResponse { + /// OK + Status204_OK, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum RawJsonGetResponse { + /// Success + Status200_Success(crate::types::Object), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum SoloObjectPostResponse { + /// OK + Status204_OK, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// AllOfGet - GET /allOf + async fn all_of_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// A dummy endpoint to make the spec valid.. + /// + /// DummyGet - GET /dummy + async fn dummy_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// DummyPut - PUT /dummy + async fn dummy_put( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::DummyPutRequest, + ) -> Result; + + /// Get a file. + /// + /// FileResponseGet - GET /file_response + async fn file_response_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// GetStructuredYaml - GET /get-structured-yaml + async fn get_structured_yaml( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Test HTML handling. + /// + /// HtmlPost - POST /html + async fn html_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: String, + ) -> Result; + + /// PostYaml - POST /post-yaml + async fn post_yaml( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: String, + ) -> Result; + + /// Get an arbitrary JSON blob.. + /// + /// RawJsonGet - GET /raw_json + async fn raw_json_get( + &self, + method: Method, + host: Host, + cookies: CookieJar, + ) -> Result; + + /// Send an arbitrary JSON blob. + /// + /// SoloObjectPost - POST /solo-object + async fn solo_object_post( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: crate::types::Object, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs index 305ff1df6d1..d9085fbe8b9 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/lib.rs @@ -8,186 +8,19 @@ unused_imports, unused_attributes )] -#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] - -use async_trait::async_trait; -use axum::extract::*; -use axum_extra::extract::{CookieJar, Multipart}; -use bytes::Bytes; -use http::Method; -use serde::{Deserialize, Serialize}; - -use types::*; +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "2.3.4"; -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum AllOfGetResponse { - /// OK - Status200_OK(models::AllOfObject), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DummyGetResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum DummyPutResponse { - /// Success - Status200_Success, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum FileResponseGetResponse { - /// Success - Status200_Success(ByteArray), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum GetStructuredYamlResponse { - /// OK - Status200_OK(String), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum HtmlPostResponse { - /// Success - Status200_Success(String), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum PostYamlResponse { - /// OK - Status204_OK, -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum RawJsonGetResponse { - /// Success - Status200_Success(crate::types::Object), -} - -#[derive(Debug, PartialEq, Serialize, Deserialize)] -#[must_use] -#[allow(clippy::large_enum_variant)] -pub enum SoloObjectPostResponse { - /// OK - Status204_OK, -} - -/// API -#[async_trait] -#[allow(clippy::ptr_arg)] -pub trait Api { - /// AllOfGet - GET /allOf - async fn all_of_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// A dummy endpoint to make the spec valid.. - /// - /// DummyGet - GET /dummy - async fn dummy_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// DummyPut - PUT /dummy - async fn dummy_put( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: models::DummyPutRequest, - ) -> Result; - - /// Get a file. - /// - /// FileResponseGet - GET /file_response - async fn file_response_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// GetStructuredYaml - GET /get-structured-yaml - async fn get_structured_yaml( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Test HTML handling. - /// - /// HtmlPost - POST /html - async fn html_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: String, - ) -> Result; - - /// PostYaml - POST /post-yaml - async fn post_yaml( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: String, - ) -> Result; - - /// Get an arbitrary JSON blob.. - /// - /// RawJsonGet - GET /raw_json - async fn raw_json_get( - &self, - method: Method, - host: Host, - cookies: CookieJar, - ) -> Result; - - /// Send an arbitrary JSON blob. - /// - /// SoloObjectPost - POST /solo-object - async fn solo_object_post( - &self, - method: Method, - host: Host, - cookies: CookieJar, - body: crate::types::Object, - ) -> Result; -} - #[cfg(feature = "server")] pub mod server; +pub mod apis; pub mod models; pub mod types; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs index da5d544f848..f16aec9b6e1 100644 --- a/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs +++ b/samples/server/petstore/rust-axum/output/rust-axum-test/src/server/mod.rs @@ -10,19 +10,13 @@ use validator::{Validate, ValidationErrors}; use crate::{header, types::*}; #[allow(unused_imports)] -use crate::models; - -use crate::{ - AllOfGetResponse, Api, DummyGetResponse, DummyPutResponse, FileResponseGetResponse, - GetStructuredYamlResponse, HtmlPostResponse, PostYamlResponse, RawJsonGetResponse, - SoloObjectPostResponse, -}; +use crate::{apis, models}; /// Setup API Server. pub fn new(api_impl: I) -> Router where I: AsRef + Clone + Send + Sync + 'static, - A: Api + 'static, + A: apis::default::Default + 'static, { // build our application with a route Router::new() @@ -51,7 +45,7 @@ async fn all_of_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || all_of_get_validation()) @@ -71,7 +65,7 @@ where let resp = match result { Ok(rsp) => match rsp { - AllOfGetResponse::Status200_OK(body) => { + apis::default::AllOfGetResponse::Status200_OK(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -122,7 +116,7 @@ async fn dummy_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || dummy_get_validation()) @@ -142,7 +136,7 @@ where let resp = match result { Ok(rsp) => match rsp { - DummyGetResponse::Status200_Success => { + apis::default::DummyGetResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -187,7 +181,7 @@ async fn dummy_put( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || dummy_put_validation(body)) @@ -210,7 +204,7 @@ where let resp = match result { Ok(rsp) => match rsp { - DummyPutResponse::Status200_Success => { + apis::default::DummyPutResponse::Status200_Success => { let mut response = response.status(200); response.body(Body::empty()) } @@ -242,7 +236,7 @@ async fn file_response_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || file_response_get_validation()) @@ -265,7 +259,7 @@ where let resp = match result { Ok(rsp) => match rsp { - FileResponseGetResponse::Status200_Success(body) => { + apis::default::FileResponseGetResponse::Status200_Success(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -316,7 +310,7 @@ async fn get_structured_yaml( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || get_structured_yaml_validation()) @@ -339,7 +333,7 @@ where let resp = match result { Ok(rsp) => match rsp { - GetStructuredYamlResponse::Status200_OK(body) => { + apis::default::GetStructuredYamlResponse::Status200_OK(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -390,7 +384,7 @@ async fn html_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || html_post_validation(body)) @@ -413,7 +407,7 @@ where let resp = match result { Ok(rsp) => match rsp { - HtmlPostResponse::Status200_Success(body) => { + apis::default::HtmlPostResponse::Status200_Success(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -464,7 +458,7 @@ async fn post_yaml( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || post_yaml_validation(body)) @@ -487,7 +481,7 @@ where let resp = match result { Ok(rsp) => match rsp { - PostYamlResponse::Status204_OK => { + apis::default::PostYamlResponse::Status204_OK => { let mut response = response.status(204); response.body(Body::empty()) } @@ -519,7 +513,7 @@ async fn raw_json_get( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || raw_json_get_validation()) @@ -539,7 +533,7 @@ where let resp = match result { Ok(rsp) => match rsp { - RawJsonGetResponse::Status200_Success(body) => { + apis::default::RawJsonGetResponse::Status200_Success(body) => { let mut response = response.status(200); { let mut response_headers = response.headers_mut().unwrap(); @@ -602,7 +596,7 @@ async fn solo_object_post( ) -> Result where I: AsRef + Send + Sync, - A: Api, + A: apis::default::Default, { #[allow(clippy::redundant_closure)] let validation = tokio::task::spawn_blocking(move || solo_object_post_validation(body)) @@ -625,7 +619,7 @@ where let resp = match result { Ok(rsp) => match rsp { - SoloObjectPostResponse::Status204_OK => { + apis::default::SoloObjectPostResponse::Status204_OK => { let mut response = response.status(204); response.body(Body::empty()) } diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.gitignore b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator-ignore b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES new file mode 100644 index 00000000000..683914c4c64 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/FILES @@ -0,0 +1,10 @@ +.gitignore +Cargo.toml +README.md +src/apis/default.rs +src/apis/mod.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs +src/types.rs diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/VERSION b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/VERSION new file mode 100644 index 00000000000..ecb21862b1e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml new file mode 100644 index 00000000000..a98003aa117 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "rust-axum-validation-test" +version = "0.0.1" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +edition = "2021" + +[features] +default = ["server"] +server = [] +conversion = [ + "frunk", + "frunk_derives", + "frunk_core", + "frunk-enum-core", + "frunk-enum-derive", +] + +[dependencies] +async-trait = "0.1" +axum = { version = "0.7" } +axum-extra = { version = "0.9", features = ["cookie", "multipart"] } +base64 = "0.22" +bytes = "1" +chrono = { version = "0.4", features = ["serde"] } +frunk = { version = "0.4", optional = true } +frunk-enum-core = { version = "0.3", optional = true } +frunk-enum-derive = { version = "0.3", optional = true } +frunk_core = { version = "0.4", optional = true } +frunk_derives = { version = "0.4", optional = true } +http = "1" +lazy_static = "1" +regex = "1" +serde = { version = "1", features = ["derive"] } +serde_json = { version = "1", features = ["raw_value"] } +serde_urlencoded = "0.7" +tokio = { version = "1", default-features = false, features = [ + "signal", + "rt-multi-thread", +] } +tracing = { version = "0.1", features = ["attributes"] } +uuid = { version = "1", features = ["serde"] } +validator = { version = "0.18", features = ["derive"] } + +[dev-dependencies] +tracing-subscriber = "0.3" diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/README.md b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/README.md new file mode 100644 index 00000000000..a017ed146e0 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/README.md @@ -0,0 +1,91 @@ +# Rust API for rust-axum-validation-test + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview + +This server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. By using the +[OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote +server, you can easily generate a server stub. + +To see how to make this your own, look here: [README]((https://openapi-generator.tech)) + +- API version: 0.0.1 +- Generator version: 7.6.0-SNAPSHOT + + + +This autogenerated project defines an API crate `rust-axum-validation-test` which contains: +* An `Api` trait defining the API in Rust. +* Data types representing the underlying data model. +* Axum router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. + * Request validations (path, query, body params) are included. + +## Using the generated library + +The generated library has a few optional features that can be activated through Cargo. + +* `server` + * This defaults to enabled and creates the basic skeleton of a server implementation based on Axum. + * To create the server stack you'll need to provide an implementation of the API trait to provide the server function. +* `conversions` + * This defaults to disabled and creates extra derives on models to allow "transmogrification" between objects of structurally similar types. + +See https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section for how to use features in your `Cargo.toml`. + +### Example + +```rust +struct ServerImpl { + // database: sea_orm::DbConn, +} + +#[allow(unused_variables)] +#[async_trait] +impl rust-axum-validation-test::Api for ServerImpl { + // API implementation goes here +} + +pub async fn start_server(addr: &str) { + // initialize tracing + tracing_subscriber::fmt::init(); + + // Init Axum router + let app = rust-axum-validation-test::server::new(Arc::new(ServerImpl)); + + // Add layers to the router + let app = app.layer(...); + + // Run the server with graceful shutdown + let listener = TcpListener::bind(addr).await.unwrap(); + axum::serve(listener, app) + .with_graceful_shutdown(shutdown_signal()) + .await + .unwrap(); +} + +async fn shutdown_signal() { + let ctrl_c = async { + signal::ctrl_c() + .await + .expect("failed to install Ctrl+C handler"); + }; + + #[cfg(unix)] + let terminate = async { + signal::unix::signal(signal::unix::SignalKind::terminate()) + .expect("failed to install signal handler") + .recv() + .await; + }; + + #[cfg(not(unix))] + let terminate = std::future::pending::<()>(); + + tokio::select! { + _ = ctrl_c => {}, + _ = terminate => {}, + } +} +``` diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs new file mode 100644 index 00000000000..a5b9394198a --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/default.rs @@ -0,0 +1,30 @@ +use async_trait::async_trait; +use axum::extract::*; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::Method; +use serde::{Deserialize, Serialize}; + +use crate::{models, types::*}; + +#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[must_use] +#[allow(clippy::large_enum_variant)] +pub enum MailPutResponse { + /// OK. + Status204_OK, +} + +/// Default +#[async_trait] +#[allow(clippy::ptr_arg)] +pub trait Default { + /// MailPut - PUT /mail + async fn mail_put( + &self, + method: Method, + host: Host, + cookies: CookieJar, + body: models::Email, + ) -> Result; +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs new file mode 100644 index 00000000000..1be8d340b8e --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/apis/mod.rs @@ -0,0 +1 @@ +pub mod default; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/header.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/header.rs new file mode 100644 index 00000000000..7c530892fbf --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/header.rs @@ -0,0 +1,197 @@ +use std::{convert::TryFrom, fmt, ops::Deref}; + +use chrono::{DateTime, Utc}; +use http::HeaderValue; + +/// A struct to allow homogeneous conversion into a HeaderValue. We can't +/// implement the From/Into trait on HeaderValue because we don't own +/// either of the types. +#[derive(Debug, Clone)] +pub(crate) struct IntoHeaderValue(pub T); + +// Generic implementations + +impl Deref for IntoHeaderValue { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } +} + +// Derive for each TryFrom in http::HeaderValue + +macro_rules! ihv_generate { + ($t:ident) => { + impl TryFrom for IntoHeaderValue<$t> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match hdr_value.parse::<$t>() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value)), + Err(e) => Err(format!( + "Unable to parse {} as a string: {}", + stringify!($t), + e + )), + }, + Err(e) => Err(format!( + "Unable to parse header {:?} as a string - {}", + hdr_value, e + )), + } + } + } + + impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue<$t>) -> Result { + Ok(hdr_value.0.into()) + } + } + }; +} + +ihv_generate!(u64); +ihv_generate!(i64); +ihv_generate!(i16); +ihv_generate!(u16); +ihv_generate!(u32); +ihv_generate!(usize); +ihv_generate!(isize); +ihv_generate!(i32); + +// Custom derivations + +// Vec + +impl TryFrom for IntoHeaderValue> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => Ok(IntoHeaderValue( + hdr_value + .split(',') + .filter_map(|x| match x.trim() { + "" => None, + y => Some(y.to_string()), + }) + .collect(), + )), + Err(e) => Err(format!( + "Unable to parse header: {:?} as a string - {}", + hdr_value, e + )), + } + } +} + +impl TryFrom>> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue>) -> Result { + match HeaderValue::from_str(&hdr_value.0.join(", ")) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} into a header - {}", + hdr_value, e + )), + } + } +} + +// String + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value.to_string())), + Err(e) => Err(format!("Unable to convert header {:?} to {}", hdr_value, e)), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_str(&hdr_value.0) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} from a header {}", + hdr_value, e + )), + } + } +} + +// Bool + +impl TryFrom for IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match hdr_value.parse() { + Ok(hdr_value) => Ok(IntoHeaderValue(hdr_value)), + Err(e) => Err(format!("Unable to parse bool from {} - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert {:?} from a header {}", + hdr_value, e + )), + } + } +} + +impl TryFrom> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue) -> Result { + match HeaderValue::from_str(&hdr_value.0.to_string()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert: {:?} into a header: {}", + hdr_value, e + )), + } + } +} + +// DateTime + +impl TryFrom for IntoHeaderValue> { + type Error = String; + + fn try_from(hdr_value: HeaderValue) -> Result { + match hdr_value.to_str() { + Ok(hdr_value) => match DateTime::parse_from_rfc3339(hdr_value) { + Ok(date) => Ok(IntoHeaderValue(date.with_timezone(&Utc))), + Err(e) => Err(format!("Unable to parse: {} as date - {}", hdr_value, e)), + }, + Err(e) => Err(format!( + "Unable to convert header {:?} to string {}", + hdr_value, e + )), + } + } +} + +impl TryFrom>> for HeaderValue { + type Error = String; + + fn try_from(hdr_value: IntoHeaderValue>) -> Result { + match HeaderValue::from_str(hdr_value.0.to_rfc3339().as_str()) { + Ok(hdr_value) => Ok(hdr_value), + Err(e) => Err(format!( + "Unable to convert {:?} to a header: {}", + hdr_value, e + )), + } + } +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs new file mode 100644 index 00000000000..bfdd7c89923 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/lib.rs @@ -0,0 +1,28 @@ +#![allow( + missing_docs, + trivial_casts, + unused_variables, + unused_mut, + unused_extern_crates, + non_camel_case_types, + unused_imports, + unused_attributes +)] +#![allow( + clippy::derive_partial_eq_without_eq, + clippy::disallowed_names, + clippy::too_many_arguments +)] + +pub const BASE_PATH: &str = ""; +pub const API_VERSION: &str = "0.0.1"; + +#[cfg(feature = "server")] +pub mod server; + +pub mod apis; +pub mod models; +pub mod types; + +#[cfg(feature = "server")] +pub(crate) mod header; diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/models.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/models.rs new file mode 100644 index 00000000000..5f38b9e1c5d --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/models.rs @@ -0,0 +1,56 @@ +#![allow(unused_qualifications)] + +use http::HeaderValue; +use validator::Validate; + +#[cfg(feature = "server")] +use crate::header; +use crate::{models, types::*}; + +#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct Email(String); + +impl validator::Validate for Email { + fn validate(&self) -> std::result::Result<(), validator::ValidationErrors> { + std::result::Result::Ok(()) + } +} + +impl std::convert::From for Email { + fn from(x: String) -> Self { + Email(x) + } +} + +impl std::fmt::Display for Email { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } +} + +impl std::str::FromStr for Email { + type Err = std::string::ParseError; + fn from_str(x: &str) -> std::result::Result { + std::result::Result::Ok(Email(x.to_string())) + } +} + +impl std::convert::From for String { + fn from(x: Email) -> Self { + x.0 + } +} + +impl std::ops::Deref for Email { + type Target = String; + fn deref(&self) -> &String { + &self.0 + } +} + +impl std::ops::DerefMut for Email { + fn deref_mut(&mut self) -> &mut String { + &mut self.0 + } +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs new file mode 100644 index 00000000000..822b74a61f6 --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/server/mod.rs @@ -0,0 +1,65 @@ +use std::collections::HashMap; + +use axum::{body::Body, extract::*, response::Response, routing::*}; +use axum_extra::extract::{CookieJar, Multipart}; +use bytes::Bytes; +use http::{header::CONTENT_TYPE, HeaderMap, HeaderName, HeaderValue, Method, StatusCode}; +use tracing::error; +use validator::{Validate, ValidationErrors}; + +use crate::{header, types::*}; + +#[allow(unused_imports)] +use crate::{apis, models}; + +/// Setup API Server. +pub fn new(api_impl: I) -> Router +where + I: AsRef + Clone + Send + Sync + 'static, + A: apis::default::Default + 'static, +{ + // build our application with a route + Router::new() + .route("/mail", put(mail_put::)) + .with_state(api_impl) +} + +/// MailPut - PUT /mail +#[tracing::instrument(skip_all)] +async fn mail_put( + method: Method, + host: Host, + cookies: CookieJar, + State(api_impl): State, + Json(body): Json, +) -> Result +where + I: AsRef + Send + Sync, + A: apis::default::Default, +{ + let result = api_impl + .as_ref() + .mail_put(method, host, cookies, body) + .await; + + let mut response = Response::builder(); + + let resp = match result { + Ok(rsp) => match rsp { + apis::default::MailPutResponse::Status204_OK => { + let mut response = response.status(204); + response.body(Body::empty()) + } + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.status(500).body(Body::empty()) + } + }; + + resp.map_err(|e| { + error!(error = ?e); + StatusCode::INTERNAL_SERVER_ERROR + }) +} diff --git a/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/types.rs b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/types.rs new file mode 100644 index 00000000000..7f2bc396ccf --- /dev/null +++ b/samples/server/petstore/rust-axum/output/rust-axum-validation-test/src/types.rs @@ -0,0 +1,665 @@ +use std::{mem, str::FromStr}; + +use base64::{engine::general_purpose, Engine}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[allow(dead_code)] +pub struct Object(serde_json::Value); + +impl validator::Validate for Object { + fn validate(&self) -> Result<(), validator::ValidationErrors> { + Ok(()) + } +} + +impl FromStr for Object { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(Self(serde_json::Value::String(s.to_owned()))) + } +} + +/// Serde helper function to create a default `Option>` while +/// deserializing +pub fn default_optional_nullable() -> Option> { + None +} + +/// Serde helper function to deserialize into an `Option>` +pub fn deserialize_optional_nullable<'de, D, T>( + deserializer: D, +) -> Result>, D::Error> +where + D: Deserializer<'de>, + T: Deserialize<'de>, +{ + Option::::deserialize(deserializer).map(|val| match val { + Some(inner) => Some(Nullable::Present(inner)), + None => Some(Nullable::Null), + }) +} + +/// The Nullable type. Represents a value which may be specified as null on an API. +/// Note that this is distinct from a value that is optional and not present! +/// +/// Nullable implements many of the same methods as the Option type (map, unwrap, etc). +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] +pub enum Nullable { + /// Null value + Null, + /// Value is present + Present(T), +} + +impl Nullable { + ///////////////////////////////////////////////////////////////////////// + // Querying the contained values + ///////////////////////////////////////////////////////////////////////// + + /// Returns `true` if the Nullable is a `Present` value. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x: Nullable = Nullable::Present(2); + /// assert_eq!(x.is_present(), true); + /// + /// let x: Nullable = Nullable::Null; + /// assert_eq!(x.is_present(), false); + /// ``` + #[inline] + pub fn is_present(&self) -> bool { + match *self { + Nullable::Present(_) => true, + Nullable::Null => false, + } + } + + /// Returns `true` if the Nullable is a `Null` value. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x: Nullable = Nullable::Present(2); + /// assert_eq!(x.is_null(), false); + /// + /// let x: Nullable = Nullable::Null; + /// assert_eq!(x.is_null(), true); + /// ``` + #[inline] + pub fn is_null(&self) -> bool { + !self.is_present() + } + + ///////////////////////////////////////////////////////////////////////// + // Adapter for working with references + ///////////////////////////////////////////////////////////////////////// + + /// Converts from `Nullable` to `Nullable<&T>`. + /// + /// # Examples + /// + /// Convert an `Nullable<`[`String`]`>` into a `Nullable<`[`usize`]`>`, preserving the original. + /// The [`map`] method takes the `self` argument by value, consuming the original, + /// so this technique uses `as_ref` to first take a `Nullable` to a reference + /// to the value inside the original. + /// + /// [`map`]: enum.Nullable.html#method.map + /// [`String`]: ../../std/string/struct.String.html + /// [`usize`]: ../../std/primitive.usize.html + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let num_as_str: Nullable = Nullable::Present("10".to_string()); + /// // First, cast `Nullable` to `Nullable<&String>` with `as_ref`, + /// // then consume *that* with `map`, leaving `num_as_str` on the stack. + /// let num_as_int: Nullable = num_as_str.as_ref().map(|n| n.len()); + /// println!("still can print num_as_str: {:?}", num_as_str); + /// ``` + #[inline] + pub fn as_ref(&self) -> Nullable<&T> { + match *self { + Nullable::Present(ref x) => Nullable::Present(x), + Nullable::Null => Nullable::Null, + } + } + + /// Converts from `Nullable` to `Nullable<&mut T>`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let mut x = Nullable::Present(2); + /// match x.as_mut() { + /// Nullable::Present(v) => *v = 42, + /// Nullable::Null => {}, + /// } + /// assert_eq!(x, Nullable::Present(42)); + /// ``` + #[inline] + pub fn as_mut(&mut self) -> Nullable<&mut T> { + match *self { + Nullable::Present(ref mut x) => Nullable::Present(x), + Nullable::Null => Nullable::Null, + } + } + + ///////////////////////////////////////////////////////////////////////// + // Getting to contained values + ///////////////////////////////////////////////////////////////////////// + + /// Unwraps a Nullable, yielding the content of a `Nullable::Present`. + /// + /// # Panics + /// + /// Panics if the value is a [`Nullable::Null`] with a custom panic message provided by + /// `msg`. + /// + /// [`Nullable::Null`]: #variant.Null + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present("value"); + /// assert_eq!(x.expect("the world is ending"), "value"); + /// ``` + /// + /// ```{.should_panic} + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x: Nullable<&str> = Nullable::Null; + /// x.expect("the world is ending"); // panics with `the world is ending` + /// ``` + #[inline] + pub fn expect(self, msg: &str) -> T { + match self { + Nullable::Present(val) => val, + Nullable::Null => expect_failed(msg), + } + } + + /// Moves the value `v` out of the `Nullable` if it is `Nullable::Present(v)`. + /// + /// In general, because this function may panic, its use is discouraged. + /// Instead, prefer to use pattern matching and handle the `Nullable::Null` + /// case explicitly. + /// + /// # Panics + /// + /// Panics if the self value equals [`Nullable::Null`]. + /// + /// [`Nullable::Null`]: #variant.Null + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present("air"); + /// assert_eq!(x.unwrap(), "air"); + /// ``` + /// + /// ```{.should_panic} + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.unwrap(), "air"); // fails + /// ``` + #[inline] + pub fn unwrap(self) -> T { + match self { + Nullable::Present(val) => val, + Nullable::Null => panic!("called `Nullable::unwrap()` on a `Nullable::Null` value"), + } + } + + /// Returns the contained value or a default. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// assert_eq!(Nullable::Present("car").unwrap_or("bike"), "car"); + /// assert_eq!(Nullable::Null.unwrap_or("bike"), "bike"); + /// ``` + #[inline] + pub fn unwrap_or(self, def: T) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => def, + } + } + + /// Returns the contained value or computes it from a closure. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let k = 10; + /// assert_eq!(Nullable::Present(4).unwrap_or_else(|| 2 * k), 4); + /// assert_eq!(Nullable::Null.unwrap_or_else(|| 2 * k), 20); + /// ``` + #[inline] + pub fn unwrap_or_else T>(self, f: F) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => f(), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Transforming contained values + ///////////////////////////////////////////////////////////////////////// + + /// Maps a `Nullable` to `Nullable` by applying a function to a contained value. + /// + /// # Examples + /// + /// Convert a `Nullable<`[`String`]`>` into a `Nullable<`[`usize`]`>`, consuming the original: + /// + /// [`String`]: ../../std/string/struct.String.html + /// [`usize`]: ../../std/primitive.usize.html + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let maybe_some_string = Nullable::Present(String::from("Hello, World!")); + /// // `Nullable::map` takes self *by value*, consuming `maybe_some_string` + /// let maybe_some_len = maybe_some_string.map(|s| s.len()); + /// + /// assert_eq!(maybe_some_len, Nullable::Present(13)); + /// ``` + #[inline] + pub fn map U>(self, f: F) -> Nullable { + match self { + Nullable::Present(x) => Nullable::Present(f(x)), + Nullable::Null => Nullable::Null, + } + } + + /// Applies a function to the contained value (if any), + /// or returns a `default` (if not). + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.map_or(42, |v| v.len()), 3); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.map_or(42, |v| v.len()), 42); + /// ``` + #[inline] + pub fn map_or U>(self, default: U, f: F) -> U { + match self { + Nullable::Present(t) => f(t), + Nullable::Null => default, + } + } + + /// Applies a function to the contained value (if any), + /// or computes a `default` (if not). + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let k = 21; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42); + /// ``` + #[inline] + pub fn map_or_else U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U { + match self { + Nullable::Present(t) => f(t), + Nullable::Null => default(), + } + } + + /// Transforms the `Nullable` into a [`Result`], mapping `Nullable::Present(v)` to + /// [`Ok(v)`] and `Nullable::Null` to [`Err(err)`][Err]. + /// + /// [`Result`]: ../../std/result/enum.Result.html + /// [`Ok(v)`]: ../../std/result/enum.Result.html#variant.Ok + /// [Err]: ../../std/result/enum.Result.html#variant.Err + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.ok_or(0), Ok("foo")); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.ok_or(0), Err(0)); + /// ``` + #[inline] + pub fn ok_or(self, err: E) -> Result { + match self { + Nullable::Present(v) => Ok(v), + Nullable::Null => Err(err), + } + } + + /// Transforms the `Nullable` into a [`Result`], mapping `Nullable::Present(v)` to + /// [`Ok(v)`] and `Nullable::Null` to [`Err(err())`][Err]. + /// + /// [`Result`]: ../../std/result/enum.Result.html + /// [`Ok(v)`]: ../../std/result/enum.Result.html#variant.Ok + /// [Err]: ../../std/result/enum.Result.html#variant.Err + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present("foo"); + /// assert_eq!(x.ok_or_else(|| 0), Ok("foo")); + /// + /// let x: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.ok_or_else(|| 0), Err(0)); + /// ``` + #[inline] + pub fn ok_or_else E>(self, err: F) -> Result { + match self { + Nullable::Present(v) => Ok(v), + Nullable::Null => Err(err()), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Boolean operations on the values, eager and lazy + ///////////////////////////////////////////////////////////////////////// + + /// Returns `Nullable::Null` if the Nullable is `Nullable::Null`, otherwise returns `optb`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present(2); + /// let y: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.and(y), Nullable::Null); + /// + /// let x: Nullable = Nullable::Null; + /// let y = Nullable::Present("foo"); + /// assert_eq!(x.and(y), Nullable::Null); + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Present("foo"); + /// assert_eq!(x.and(y), Nullable::Present("foo")); + /// + /// let x: Nullable = Nullable::Null; + /// let y: Nullable<&str> = Nullable::Null; + /// assert_eq!(x.and(y), Nullable::Null); + /// ``` + #[inline] + pub fn and(self, optb: Nullable) -> Nullable { + match self { + Nullable::Present(_) => optb, + Nullable::Null => Nullable::Null, + } + } + + /// Returns `Nullable::Null` if the Nullable is `Nullable::Null`, otherwise calls `f` with the + /// wrapped value and returns the result. + /// + /// Some languages call this operation flatmap. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// fn sq(x: u32) -> Nullable { Nullable::Present(x * x) } + /// fn nope(_: u32) -> Nullable { Nullable::Null } + /// + /// assert_eq!(Nullable::Present(2).and_then(sq).and_then(sq), Nullable::Present(16)); + /// assert_eq!(Nullable::Present(2).and_then(sq).and_then(nope), Nullable::Null); + /// assert_eq!(Nullable::Present(2).and_then(nope).and_then(sq), Nullable::Null); + /// assert_eq!(Nullable::Null.and_then(sq).and_then(sq), Nullable::Null); + /// ``` + #[inline] + pub fn and_then Nullable>(self, f: F) -> Nullable { + match self { + Nullable::Present(x) => f(x), + Nullable::Null => Nullable::Null, + } + } + + /// Returns the Nullable if it contains a value, otherwise returns `optb`. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Null; + /// assert_eq!(x.or(y), Nullable::Present(2)); + /// + /// let x = Nullable::Null; + /// let y = Nullable::Present(100); + /// assert_eq!(x.or(y), Nullable::Present(100)); + /// + /// let x = Nullable::Present(2); + /// let y = Nullable::Present(100); + /// assert_eq!(x.or(y), Nullable::Present(2)); + /// + /// let x: Nullable = Nullable::Null; + /// let y = Nullable::Null; + /// assert_eq!(x.or(y), Nullable::Null); + /// ``` + #[inline] + pub fn or(self, optb: Nullable) -> Nullable { + match self { + Nullable::Present(_) => self, + Nullable::Null => optb, + } + } + + /// Returns the Nullable if it contains a value, otherwise calls `f` and + /// returns the result. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// fn nobody() -> Nullable<&'static str> { Nullable::Null } + /// fn vikings() -> Nullable<&'static str> { Nullable::Present("vikings") } + /// + /// assert_eq!(Nullable::Present("barbarians").or_else(vikings), + /// Nullable::Present("barbarians")); + /// assert_eq!(Nullable::Null.or_else(vikings), Nullable::Present("vikings")); + /// assert_eq!(Nullable::Null.or_else(nobody), Nullable::Null); + /// ``` + #[inline] + pub fn or_else Nullable>(self, f: F) -> Nullable { + match self { + Nullable::Present(_) => self, + Nullable::Null => f(), + } + } + + ///////////////////////////////////////////////////////////////////////// + // Misc + ///////////////////////////////////////////////////////////////////////// + + /// Takes the value out of the Nullable, leaving a `Nullable::Null` in its place. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let mut x = Nullable::Present(2); + /// x.take(); + /// assert_eq!(x, Nullable::Null); + /// + /// let mut x: Nullable = Nullable::Null; + /// x.take(); + /// assert_eq!(x, Nullable::Null); + /// ``` + #[inline] + pub fn take(&mut self) -> Nullable { + mem::replace(self, Nullable::Null) + } +} + +impl<'a, T: Clone> Nullable<&'a T> { + /// Maps an `Nullable<&T>` to an `Nullable` by cloning the contents of the + /// Nullable. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = 12; + /// let opt_x = Nullable::Present(&x); + /// assert_eq!(opt_x, Nullable::Present(&12)); + /// let cloned = opt_x.cloned(); + /// assert_eq!(cloned, Nullable::Present(12)); + /// ``` + pub fn cloned(self) -> Nullable { + self.map(Clone::clone) + } +} + +impl Nullable { + /// Returns the contained value or a default + /// + /// Consumes the `self` argument then, if `Nullable::Present`, returns the contained + /// value, otherwise if `Nullable::Null`, returns the default value for that + /// type. + /// + /// # Examples + /// + /// ``` + /// # use rust_axum_validation_test::types::Nullable; + /// + /// let x = Nullable::Present(42); + /// assert_eq!(42, x.unwrap_or_default()); + /// + /// let y: Nullable = Nullable::Null; + /// assert_eq!(0, y.unwrap_or_default()); + /// ``` + #[inline] + pub fn unwrap_or_default(self) -> T { + match self { + Nullable::Present(x) => x, + Nullable::Null => Default::default(), + } + } +} + +impl Default for Nullable { + /// Returns None. + #[inline] + fn default() -> Nullable { + Nullable::Null + } +} + +impl From for Nullable { + fn from(val: T) -> Nullable { + Nullable::Present(val) + } +} + +impl Serialize for Nullable +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Nullable::Present(ref inner) => serializer.serialize_some(&inner), + Nullable::Null => serializer.serialize_none(), + } + } +} + +impl<'de, T> Deserialize<'de> for Nullable +where + T: serde::de::DeserializeOwned, +{ + fn deserialize(deserializer: D) -> Result, D::Error> + where + D: Deserializer<'de>, + { + // In order to deserialize a required, but nullable, value, we first have to check whether + // the value is present at all. To do this, we deserialize to a serde_json::Value, which + // fails if the value is missing, or gives serde_json::Value::Null if the value is present. + // If that succeeds as null, we can easily return a Null. + // If that succeeds as some value, we deserialize that value and return a Present. + // If that errors, we return the error. + let presence: Result<::serde_json::Value, _> = + serde::Deserialize::deserialize(deserializer); + match presence { + Ok(serde_json::Value::Null) => Ok(Nullable::Null), + Ok(some_value) => serde_json::from_value(some_value) + .map(Nullable::Present) + .map_err(serde::de::Error::custom), + Err(x) => Err(x), + } + } +} + +#[inline(never)] +#[cold] +fn expect_failed(msg: &str) -> ! { + panic!("{}", msg) +} + +#[derive(Debug, Clone, PartialEq, PartialOrd)] +/// Base64-encoded byte array +pub struct ByteArray(pub Vec); + +impl Serialize for ByteArray { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&general_purpose::STANDARD.encode(&self.0)) + } +} + +impl<'de> Deserialize<'de> for ByteArray { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match general_purpose::STANDARD.decode(s) { + Ok(bin) => Ok(ByteArray(bin)), + _ => Err(serde::de::Error::custom("invalid base64")), + } + } +} diff --git a/samples/server/petstore/rust-server/Cargo.toml b/samples/server/petstore/rust-server/Cargo.toml index 68d06c54103..c086d1f0138 100644 --- a/samples/server/petstore/rust-server/Cargo.toml +++ b/samples/server/petstore/rust-server/Cargo.toml @@ -1,2 +1,3 @@ [workspace] members = ["output/*"] +resolver = "2" diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES index f72a89817bf..c4ea8aa3665 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES @@ -8,14 +8,18 @@ docs/MultipartRequestObjectField.md docs/MultipleIdenticalMimeTypesPostRequest.md docs/default_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml index de78c375dc0..2dec3ee847f 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml @@ -69,6 +69,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/client/client_auth.rs new file mode 100644 index 00000000000..ed71c3056f8 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use multipart_v3::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/client/main.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/client/main.rs index 2723cbfc98d..104343c50f4 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/client/main.rs @@ -4,13 +4,16 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use multipart_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use multipart_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, MultipartRelatedRequestPostResponse, MultipartRequestPostResponse, MultipleIdenticalMimeTypesPostResponse, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -20,6 +23,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -29,9 +36,9 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "MultipartRelatedRequestPost", - "MultipartRequestPost", - "MultipleIdenticalMimeTypesPost", + "MultipartRelatedRequestPost", + "MultipartRequestPost", + "MultipleIdenticalMimeTypesPost", ]) .required(true) .index(1)) @@ -50,14 +57,40 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server/main.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/main.rs index 834961ce82e..a0b4755e80c 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for multipart_v3 implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server.rs index a33ffe55388..8eecc09eb2f 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use multipart_v3::{ Api, MultipartRelatedRequestPostResponse, @@ -113,7 +123,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("multipart_related_request_post({:?}, {:?}, {:?}) - X-Span-ID: {:?}", required_binary_field, object_field, optional_binary_field, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn multipart_request_post( @@ -125,7 +135,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("multipart_request_post(\"{}\", {:?}, {:?}, {:?}) - X-Span-ID: {:?}", string_field, binary_field, optional_string_field, object_field, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn multiple_identical_mime_types_post( @@ -135,7 +145,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("multiple_identical_mime_types_post({:?}, {:?}) - X-Span-ID: {:?}", binary1, binary2, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server_auth.rs new file mode 100644 index 00000000000..e12846a950b --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server/server_auth.rs @@ -0,0 +1,127 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use multipart_v3::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/auth.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/context.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/context.rs index fadd880b965..ee8e118587b 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/context.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs index 6d043d4a086..b10ec08a279 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0.7"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum MultipartRelatedRequestPostResponse { /// OK diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs index c3ab4bd0e64..d8e45aac711 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs @@ -19,8 +19,7 @@ use multipart::server::Multipart; use multipart::server::save::SaveResult; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -32,6 +31,8 @@ use crate::{Api, MultipleIdenticalMimeTypesPostResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -48,6 +49,7 @@ mod paths { pub(crate) static ID_MULTIPLE_IDENTICAL_MIME_TYPES: usize = 2; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -68,6 +70,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -81,7 +84,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES index 1bb2bdbcce9..c41dce9b6f0 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES @@ -6,14 +6,18 @@ api/openapi.yaml docs/OpGetRequest.md docs/default_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml b/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml index 95fe3c653d2..3b708112b2f 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/no-example-v3/Cargo.toml @@ -59,6 +59,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/client/client_auth.rs new file mode 100644 index 00000000000..415b7b82998 --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use no_example_v3::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/client/main.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/client/main.rs index ce34c07c8d5..0d53eba568b 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/client/main.rs @@ -4,11 +4,14 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use no_example_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use no_example_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, OpGetResponse, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -18,6 +21,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -45,14 +52,40 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/main.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/main.rs index d1a25ec9b63..ae01015501e 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for no_example_v3 implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs index 9ca6a4e5e41..64eb831abca 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use no_example_v3::{ Api, OpGetResponse, @@ -109,7 +119,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op_get({:?}) - X-Span-ID: {:?}", op_get_request, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server_auth.rs new file mode 100644 index 00000000000..d08ae850a01 --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/examples/server/server_auth.rs @@ -0,0 +1,127 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use no_example_v3::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/auth.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/context.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/context.rs index fadd880b965..ee8e118587b 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/context.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs index 35dd1cad90d..9e60692bed3 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "0.0.1"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum OpGetResponse { /// OK diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs index 1e951f6e0e7..d00a957c053 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -25,6 +24,8 @@ use crate::{Api, OpGetResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -37,6 +38,7 @@ mod paths { pub(crate) static ID_OP: usize = 0; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -57,6 +59,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -70,7 +73,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES index 995168af5ff..7d5a6131394 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES @@ -37,12 +37,15 @@ docs/XmlObject.md docs/default_api.md docs/repo_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/client/server.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/callbacks.rs src/client/mod.rs src/context.rs @@ -51,3 +54,4 @@ src/lib.rs src/models.rs src/server/callbacks.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml index f43c739c778..3dd0ee4d5f9 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml @@ -65,6 +65,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/client_auth.rs new file mode 100644 index 00000000000..db0c36da52f --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use openapi_v3::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs index 04b4e28dfde..af8b2f38293 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs @@ -5,7 +5,7 @@ mod server; #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use openapi_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use openapi_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, AnyOfGetResponse, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, @@ -35,6 +35,9 @@ use openapi_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -44,6 +47,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -53,31 +60,31 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "AnyOfGet", - "CallbackWithHeaderPost", - "ComplexQueryParamGet", - "JsonComplexQueryParamGet", - "MandatoryRequestHeaderGet", - "MergePatchJsonGet", - "MultigetGet", - "MultipleAuthSchemeGet", - "OneOfGet", - "OverrideServerGet", - "ParamgetGet", - "ReadonlyAuthSchemeGet", - "RegisterCallbackPost", - "RequiredOctetStreamPut", - "ResponsesWithHeadersGet", - "Rfc7807Get", - "UntypedPropertyGet", - "UuidGet", - "XmlExtraPost", - "XmlOtherPost", - "XmlOtherPut", - "XmlPost", - "XmlPut", - "CreateRepo", - "GetRepoInfo", + "AnyOfGet", + "CallbackWithHeaderPost", + "ComplexQueryParamGet", + "JsonComplexQueryParamGet", + "MandatoryRequestHeaderGet", + "MergePatchJsonGet", + "MultigetGet", + "MultipleAuthSchemeGet", + "OneOfGet", + "OverrideServerGet", + "ParamgetGet", + "ReadonlyAuthSchemeGet", + "RegisterCallbackPost", + "RequiredOctetStreamPut", + "ResponsesWithHeadersGet", + "Rfc7807Get", + "UntypedPropertyGet", + "UuidGet", + "XmlExtraPost", + "XmlOtherPost", + "XmlOtherPut", + "XmlPost", + "XmlPut", + "CreateRepo", + "GetRepoInfo", ]) .required(true) .index(1)) @@ -96,14 +103,42 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + "test.read", + "test.write", + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/server.rs index a7c806ff1c5..96694d1ad85 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -108,7 +112,7 @@ impl CallbackApi for Server where C: Has + Send + Sync context: &C) -> Result { info!("callback_callback_with_header_post({:?}) - X-Span-ID: {:?}", information, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn callback_callback_post( @@ -117,7 +121,7 @@ impl CallbackApi for Server where C: Has + Send + Sync context: &C) -> Result { info!("callback_callback_post() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/main.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/main.rs index 448771feb06..08af24903e5 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for openapi_v3 implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs index d51a51417ed..63706763819 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use openapi_v3::{ Api, AnyOfGetResponse, @@ -134,7 +144,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("any_of_get({:?}) - X-Span-ID: {:?}", any_of, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn callback_with_header_post( @@ -143,7 +153,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("callback_with_header_post(\"{}\") - X-Span-ID: {:?}", url, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn complex_query_param_get( @@ -152,7 +162,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("complex_query_param_get({:?}) - X-Span-ID: {:?}", list_of_strings, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn enum_in_path_path_param_get( @@ -161,7 +171,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("enum_in_path_path_param_get({:?}) - X-Span-ID: {:?}", path_param, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn json_complex_query_param_get( @@ -170,7 +180,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("json_complex_query_param_get({:?}) - X-Span-ID: {:?}", list_of_strings, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn mandatory_request_header_get( @@ -179,7 +189,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("mandatory_request_header_get(\"{}\") - X-Span-ID: {:?}", x_header, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn merge_patch_json_get( @@ -187,7 +197,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("merge_patch_json_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Get some stuff. @@ -196,7 +206,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("multiget_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn multiple_auth_scheme_get( @@ -204,7 +214,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("multiple_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn one_of_get( @@ -212,7 +222,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("one_of_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn override_server_get( @@ -220,7 +230,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("override_server_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Get some stuff with parameters. @@ -232,7 +242,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("paramget_get({:?}, {:?}, {:?}) - X-Span-ID: {:?}", uuid, some_object, some_list, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn readonly_auth_scheme_get( @@ -240,7 +250,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("readonly_auth_scheme_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn register_callback_post( @@ -249,7 +259,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("register_callback_post(\"{}\") - X-Span-ID: {:?}", url, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn required_octet_stream_put( @@ -258,7 +268,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("required_octet_stream_put({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn responses_with_headers_get( @@ -266,7 +276,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("responses_with_headers_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn rfc7807_get( @@ -274,7 +284,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("rfc7807_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn untyped_property_get( @@ -283,7 +293,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("untyped_property_get({:?}) - X-Span-ID: {:?}", object_untyped_props, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn uuid_get( @@ -291,7 +301,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("uuid_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn xml_extra_post( @@ -300,7 +310,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("xml_extra_post({:?}) - X-Span-ID: {:?}", duplicate_xml_object, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn xml_other_post( @@ -309,7 +319,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("xml_other_post({:?}) - X-Span-ID: {:?}", another_xml_object, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn xml_other_put( @@ -318,7 +328,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("xml_other_put({:?}) - X-Span-ID: {:?}", another_xml_array, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Post an array @@ -328,7 +338,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("xml_post({:?}) - X-Span-ID: {:?}", xml_array, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn xml_put( @@ -337,7 +347,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("xml_put({:?}) - X-Span-ID: {:?}", xml_object, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn create_repo( @@ -346,7 +356,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("create_repo({:?}) - X-Span-ID: {:?}", object_param, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn get_repo_info( @@ -355,7 +365,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_repo_info(\"{}\") - X-Span-ID: {:?}", repo_id, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server_auth.rs new file mode 100644 index 00000000000..7f486733588 --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server_auth.rs @@ -0,0 +1,129 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use openapi_v3::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + "test.read", + "test.write", + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/auth.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/callbacks.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/callbacks.rs index 3f3d2b0cf82..172d284a43c 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/callbacks.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/callbacks.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -52,6 +51,7 @@ mod paths { } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -72,6 +72,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -85,7 +86,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/context.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/context.rs index ac1c07864b8..e01187ca3c8 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/context.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; @@ -108,9 +109,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.bearer_authorization(&bearer); let auth_data = AuthData::Bearer(bearer); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index d57ac04aef2..0830f40a6fa 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0.7"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] #[must_use] pub enum AnyOfGetResponse { diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 3808a67d757..0c25b4b8887 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -50,6 +49,8 @@ use crate::{Api, GetRepoInfoResponse }; +mod server_auth; + pub mod callbacks; mod paths { @@ -122,6 +123,7 @@ mod paths { pub(crate) static ID_XML_OTHER: usize = 23; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -142,6 +144,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -155,7 +158,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES index e86946909bd..f67b7ce47ca 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES @@ -5,14 +5,18 @@ README.md api/openapi.yaml docs/default_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml index 27a63250cf4..10c46d9c2cd 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -59,6 +59,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/client/client_auth.rs new file mode 100644 index 00000000000..3d5200a26be --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use ops_v3::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/client/main.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/client/main.rs index 4b79043b5cc..570a14467c9 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/client/main.rs @@ -4,7 +4,7 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use ops_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use ops_v3::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, Op10GetResponse, Op11GetResponse, Op12GetResponse, @@ -45,6 +45,9 @@ use ops_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -54,6 +57,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -63,43 +70,43 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "Op10Get", - "Op11Get", - "Op12Get", - "Op13Get", - "Op14Get", - "Op15Get", - "Op16Get", - "Op17Get", - "Op18Get", - "Op19Get", - "Op1Get", - "Op20Get", - "Op21Get", - "Op22Get", - "Op23Get", - "Op24Get", - "Op25Get", - "Op26Get", - "Op27Get", - "Op28Get", - "Op29Get", - "Op2Get", - "Op30Get", - "Op31Get", - "Op32Get", - "Op33Get", - "Op34Get", - "Op35Get", - "Op36Get", - "Op37Get", - "Op3Get", - "Op4Get", - "Op5Get", - "Op6Get", - "Op7Get", - "Op8Get", - "Op9Get", + "Op10Get", + "Op11Get", + "Op12Get", + "Op13Get", + "Op14Get", + "Op15Get", + "Op16Get", + "Op17Get", + "Op18Get", + "Op19Get", + "Op1Get", + "Op20Get", + "Op21Get", + "Op22Get", + "Op23Get", + "Op24Get", + "Op25Get", + "Op26Get", + "Op27Get", + "Op28Get", + "Op29Get", + "Op2Get", + "Op30Get", + "Op31Get", + "Op32Get", + "Op33Get", + "Op34Get", + "Op35Get", + "Op36Get", + "Op37Get", + "Op3Get", + "Op4Get", + "Op5Get", + "Op6Get", + "Op7Get", + "Op8Get", + "Op9Get", ]) .required(true) .index(1)) @@ -118,14 +125,40 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server/main.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server/main.rs index 2e7d3031162..227fe7e7315 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for ops_v3 implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server/server.rs index cab1bfadc6b..9f97fa0f3b4 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use ops_v3::{ Api, Op10GetResponse, @@ -144,7 +154,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op10_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op11_get( @@ -152,7 +162,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op11_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op12_get( @@ -160,7 +170,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op12_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op13_get( @@ -168,7 +178,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op13_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op14_get( @@ -176,7 +186,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op14_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op15_get( @@ -184,7 +194,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op15_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op16_get( @@ -192,7 +202,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op16_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op17_get( @@ -200,7 +210,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op17_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op18_get( @@ -208,7 +218,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op18_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op19_get( @@ -216,7 +226,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op19_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op1_get( @@ -224,7 +234,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op1_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op20_get( @@ -232,7 +242,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op20_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op21_get( @@ -240,7 +250,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op21_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op22_get( @@ -248,7 +258,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op22_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op23_get( @@ -256,7 +266,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op23_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op24_get( @@ -264,7 +274,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op24_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op25_get( @@ -272,7 +282,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op25_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op26_get( @@ -280,7 +290,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op26_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op27_get( @@ -288,7 +298,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op27_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op28_get( @@ -296,7 +306,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op28_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op29_get( @@ -304,7 +314,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op29_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op2_get( @@ -312,7 +322,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op2_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op30_get( @@ -320,7 +330,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op30_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op31_get( @@ -328,7 +338,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op31_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op32_get( @@ -336,7 +346,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op32_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op33_get( @@ -344,7 +354,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op33_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op34_get( @@ -352,7 +362,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op34_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op35_get( @@ -360,7 +370,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op35_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op36_get( @@ -368,7 +378,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op36_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op37_get( @@ -376,7 +386,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op37_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op3_get( @@ -384,7 +394,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op3_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op4_get( @@ -392,7 +402,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op4_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op5_get( @@ -400,7 +410,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op5_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op6_get( @@ -408,7 +418,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op6_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op7_get( @@ -416,7 +426,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op7_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op8_get( @@ -424,7 +434,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op8_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn op9_get( @@ -432,7 +442,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("op9_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server/server_auth.rs new file mode 100644 index 00000000000..07851419c3e --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server/server_auth.rs @@ -0,0 +1,127 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use ops_v3::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/auth.rs b/samples/server/petstore/rust-server/output/ops-v3/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/context.rs b/samples/server/petstore/rust-server/output/ops-v3/src/context.rs index fadd880b965..ee8e118587b 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/context.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs index bb16cef8ed5..56cf8cabe73 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "0.0.1"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Op10GetResponse { /// OK diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs index e27cc1ed58c..80e24343691 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -61,6 +60,8 @@ use crate::{Api, Op9GetResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -145,6 +146,7 @@ mod paths { pub(crate) static ID_OP9: usize = 36; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -165,6 +167,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -178,7 +181,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES index c5167aa7470..d72d04fabfa 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES @@ -48,14 +48,18 @@ docs/pet_api.md docs/store_api.md docs/user_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index abfbb677510..f26d4ca2528 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -71,6 +71,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/client_auth.rs new file mode 100644 index 00000000000..7fc915f98b1 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use petstore_with_fake_endpoints_models_for_testing::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/main.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/main.rs index 27bf15f0c0a..b3cd7d27e03 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/main.rs @@ -4,7 +4,7 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use petstore_with_fake_endpoints_models_for_testing::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use petstore_with_fake_endpoints_models_for_testing::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, TestSpecialTagsResponse, Call123exampleResponse, FakeOuterBooleanSerializeResponse, @@ -43,6 +43,9 @@ use petstore_with_fake_endpoints_models_for_testing::{Api, ApiNoContext, Client, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -52,6 +55,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -61,31 +68,31 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "Call123example", - "FakeOuterBooleanSerialize", - "FakeOuterCompositeSerialize", - "FakeOuterNumberSerialize", - "FakeOuterStringSerialize", - "FakeResponseWithNumericalDescription", - "HyphenParam", - "TestEndpointParameters", - "TestEnumParameters", - "TestJsonFormData", - "DeletePet", - "FindPetsByStatus", - "FindPetsByTags", - "GetPetById", - "UpdatePetWithForm", - "UploadFile", - "DeleteOrder", - "GetInventory", - "GetOrderById", - "CreateUsersWithArrayInput", - "CreateUsersWithListInput", - "DeleteUser", - "GetUserByName", - "LoginUser", - "LogoutUser", + "Call123example", + "FakeOuterBooleanSerialize", + "FakeOuterCompositeSerialize", + "FakeOuterNumberSerialize", + "FakeOuterStringSerialize", + "FakeResponseWithNumericalDescription", + "HyphenParam", + "TestEndpointParameters", + "TestEnumParameters", + "TestJsonFormData", + "DeletePet", + "FindPetsByStatus", + "FindPetsByTags", + "GetPetById", + "UpdatePetWithForm", + "UploadFile", + "DeleteOrder", + "GetInventory", + "GetOrderById", + "CreateUsersWithArrayInput", + "CreateUsersWithListInput", + "DeleteUser", + "GetUserByName", + "LoginUser", + "LogoutUser", ]) .required(true) .index(1)) @@ -104,14 +111,42 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + "write:pets", + "read:pets", + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/main.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/main.rs index 89c605578a1..63e175c3dc9 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for petstore_with_fake_endpoints_models_for_testing implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server.rs index 5a89df7a6b6..38904f6f568 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use petstore_with_fake_endpoints_models_for_testing::{ Api, TestSpecialTagsResponse, @@ -144,7 +154,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_special_tags({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn call123example( @@ -152,7 +162,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("call123example() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn fake_outer_boolean_serialize( @@ -161,7 +171,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("fake_outer_boolean_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn fake_outer_composite_serialize( @@ -170,7 +180,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("fake_outer_composite_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn fake_outer_number_serialize( @@ -179,7 +189,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("fake_outer_number_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn fake_outer_string_serialize( @@ -188,7 +198,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("fake_outer_string_serialize({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn fake_response_with_numerical_description( @@ -196,7 +206,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("fake_response_with_numerical_description() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn hyphen_param( @@ -205,7 +215,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("hyphen_param(\"{}\") - X-Span-ID: {:?}", hyphen_param, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn test_body_with_query_params( @@ -215,7 +225,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_body_with_query_params(\"{}\", {:?}) - X-Span-ID: {:?}", query, body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// To test \"client\" model @@ -225,7 +235,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_client_model({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -248,7 +258,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// To test enum parameters @@ -264,7 +274,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_enum_parameters({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", enum_header_string_array, enum_header_string, enum_query_string_array, enum_query_string, enum_query_integer, enum_query_double, enum_form_string, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// test inline additionalProperties @@ -274,7 +284,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_inline_additional_properties({:?}) - X-Span-ID: {:?}", param, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// test json serialization of form data @@ -285,7 +295,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_json_form_data(\"{}\", \"{}\") - X-Span-ID: {:?}", param, param2, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// To test class name in snake case @@ -295,7 +305,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("test_classname({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Add a new pet to the store @@ -305,7 +315,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("add_pet({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Deletes a pet @@ -316,7 +326,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("delete_pet({}, {:?}) - X-Span-ID: {:?}", pet_id, api_key, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Finds Pets by status @@ -326,7 +336,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("find_pets_by_status({:?}) - X-Span-ID: {:?}", status, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Finds Pets by tags @@ -336,7 +346,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("find_pets_by_tags({:?}) - X-Span-ID: {:?}", tags, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Find pet by ID @@ -346,7 +356,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_pet_by_id({}) - X-Span-ID: {:?}", pet_id, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Update an existing pet @@ -356,7 +366,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("update_pet({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Updates a pet in the store with form data @@ -368,7 +378,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("update_pet_with_form({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, name, status, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// uploads an image @@ -380,7 +390,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("upload_file({}, {:?}, {:?}) - X-Span-ID: {:?}", pet_id, additional_metadata, file, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Delete purchase order by ID @@ -390,7 +400,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("delete_order(\"{}\") - X-Span-ID: {:?}", order_id, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Returns pet inventories by status @@ -399,7 +409,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_inventory() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Find purchase order by ID @@ -409,7 +419,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_order_by_id({}) - X-Span-ID: {:?}", order_id, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Place an order for a pet @@ -419,7 +429,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("place_order({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Create user @@ -429,7 +439,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("create_user({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Creates list of users with given input array @@ -439,7 +449,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("create_users_with_array_input({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Creates list of users with given input array @@ -449,7 +459,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("create_users_with_list_input({:?}) - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Delete user @@ -459,7 +469,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("delete_user(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Get user by user name @@ -469,7 +479,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_user_by_name(\"{}\") - X-Span-ID: {:?}", username, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Logs user into the system @@ -480,7 +490,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("login_user(\"{}\", \"{}\") - X-Span-ID: {:?}", username, password, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Logs out current logged in user session @@ -489,7 +499,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("logout_user() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Updated user @@ -500,7 +510,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("update_user(\"{}\", {:?}) - X-Span-ID: {:?}", username, body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server_auth.rs new file mode 100644 index 00000000000..f5133036d31 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/server/server_auth.rs @@ -0,0 +1,129 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use petstore_with_fake_endpoints_models_for_testing::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + "write:pets", + "read:pets", + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/auth.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/context.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/context.rs index b901da55ffc..d821895b62a 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/context.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; @@ -108,9 +109,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.bearer_authorization(&bearer); let auth_data = AuthData::Bearer(bearer); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -119,9 +128,17 @@ impl Service> for AddContext); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -132,9 +149,17 @@ impl Service> for AddContext); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } @@ -143,9 +168,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.basic_authorization(&basic); let auth_data = AuthData::Basic(basic); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 17501af77f4..db00984dad3 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = "/v2"; pub const API_VERSION: &str = "1.0.0"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum TestSpecialTagsResponse { /// successful operation diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index ea3e74c470f..887af3ab9bf 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -16,8 +16,7 @@ use multipart::server::Multipart; use multipart::server::save::SaveResult; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -61,6 +60,8 @@ use crate::{Api, UpdateUserResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -155,6 +156,7 @@ mod paths { } } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -175,6 +177,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -188,7 +191,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES index e86946909bd..f67b7ce47ca 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/FILES @@ -5,14 +5,18 @@ README.md api/openapi.yaml docs/default_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml b/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml index 4a9f77118d2..3a6860128b4 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/Cargo.toml @@ -59,6 +59,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/client_auth.rs new file mode 100644 index 00000000000..75571b40f0a --- /dev/null +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use ping_bearer_auth::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/main.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/main.rs index 9fbfcd4259f..3ef61d5f2a4 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/client/main.rs @@ -4,11 +4,14 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use ping_bearer_auth::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use ping_bearer_auth::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, PingGetResponse, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -18,6 +21,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -27,7 +34,7 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "PingGet", + "PingGet", ]) .required(true) .index(1)) @@ -46,14 +53,40 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/main.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/main.rs index 17cee7267f7..6b54873a7e9 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for ping_bearer_auth implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server.rs index 4869efef56a..ffbd60200e8 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use ping_bearer_auth::{ Api, PingGetResponse, @@ -108,7 +118,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("ping_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server_auth.rs new file mode 100644 index 00000000000..e7d21b06931 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/examples/server/server_auth.rs @@ -0,0 +1,127 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use ping_bearer_auth::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/auth.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/context.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/context.rs index ac1c07864b8..e01187ca3c8 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/context.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; @@ -108,9 +109,17 @@ impl Service> for AddContext(headers) { + let authorization = self.inner.bearer_authorization(&bearer); let auth_data = AuthData::Bearer(bearer); + let context = context.push(Some(auth_data)); - let context = context.push(None::); + let context = match authorization { + Ok(auth) => context.push(Some(auth)), + Err(err) => { + error!("Error during Authorization: {err:?}"); + context.push(None::) + } + }; return self.inner.call((request, context)) } diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs index aa43ad0d597..f7961bcc0d7 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "1.0"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum PingGetResponse { /// OK diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/mod.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/mod.rs index 0657f06dd60..7807c3de2be 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/mod.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -25,6 +24,8 @@ use crate::{Api, PingGetResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -37,6 +38,7 @@ mod paths { pub(crate) static ID_PING: usize = 0; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -57,6 +59,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Has> + Send + Sync + 'static @@ -70,7 +73,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES index ebf62ae2756..2a4b5711f84 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES @@ -13,14 +13,18 @@ docs/ObjectOfObjects.md docs/ObjectOfObjectsInner.md docs/default_api.md examples/ca.pem +examples/client/client_auth.rs examples/client/main.rs examples/server-chain.pem examples/server-key.pem examples/server/main.rs examples/server/server.rs +examples/server/server_auth.rs +src/auth.rs src/client/mod.rs src/context.rs src/header.rs src/lib.rs src/models.rs src/server/mod.rs +src/server/server_auth.rs diff --git a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml index fc7a9533931..ef05cb141e3 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -59,6 +59,9 @@ frunk_core = { version = "0.3.0", optional = true } frunk-enum-derive = { version = "0.2.0", optional = true } frunk-enum-core = { version = "0.2.0", optional = true } +# Bearer authentication +jsonwebtoken = { version = "9.3.0", optional = false } + [dev-dependencies] clap = "2.25" env_logger = "0.7" diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/client/client_auth.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/client/client_auth.rs new file mode 100644 index 00000000000..be852020274 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/client/client_auth.rs @@ -0,0 +1,17 @@ +use rust_server_test::Claims; +use jsonwebtoken::{encode, errors::Error as JwtError, Algorithm, EncodingKey, Header}; +use log::debug; + +/// build an encrypted token with the provided claims. +pub fn build_token(my_claims: Claims, key: &[u8]) -> Result { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = + Header { kid: Some("signing_key".to_owned()), alg: Algorithm::HS512, ..Default::default() }; + + let token = encode(&header, &my_claims, &EncodingKey::from_secret(key))?; + debug!("Derived token: {:?}", token); + + Ok(token) +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/client/main.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/client/main.rs index e615b83c4f0..d1ae748d59b 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/client/main.rs @@ -4,7 +4,7 @@ #[allow(unused_imports)] use futures::{future, Stream, stream}; #[allow(unused_imports)] -use rust_server_test::{Api, ApiNoContext, Client, ContextWrapperExt, models, +use rust_server_test::{Api, ApiNoContext, Claims, Client, ContextWrapperExt, models, AllOfGetResponse, DummyGetResponse, DummyPutResponse, @@ -17,6 +17,9 @@ use rust_server_test::{Api, ApiNoContext, Client, ContextWrapperExt, models, }; use clap::{App, Arg}; +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + #[allow(unused_imports)] use log::info; @@ -26,6 +29,10 @@ use swagger::{AuthData, ContextBuilder, EmptyContext, Has, Push, XSpanIdString}; type ClientContext = swagger::make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString); +mod client_auth; +use client_auth::build_token; + + // rt may be unused if there are no examples #[allow(unused_mut)] fn main() { @@ -35,13 +42,13 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ - "AllOfGet", - "DummyGet", - "FileResponseGet", - "GetStructuredYaml", - "HtmlPost", - "PostYaml", - "RawJsonGet", + "AllOfGet", + "DummyGet", + "FileResponseGet", + "GetStructuredYaml", + "HtmlPost", + "PostYaml", + "RawJsonGet", ]) .required(true) .index(1)) @@ -60,14 +67,40 @@ fn main() { .help("Port to contact")) .get_matches(); + // Create Bearer-token with a fixed key (secret) for test purposes. + // In a real (production) system this Bearer token should be obtained via an external Identity/Authentication-server + // Ensure that you set the correct algorithm and encodingkey that matches what is used on the server side. + // See https://github.com/Keats/jsonwebtoken for more information + + let auth_token = build_token( + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "my_identity_provider".to_owned(), + // added a very long expiry time + aud: "org.acme.Resource_Server".to_string(), + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + }, + b"secret").unwrap(); + + let auth_data = if !auth_token.is_empty() { + Some(AuthData::Bearer(swagger::auth::Bearer { token: auth_token})) + } else { + // No Bearer-token available, so return None + None + }; + let is_https = matches.is_present("https"); let base_url = format!("{}://{}:{}", - if is_https { "https" } else { "http" }, - matches.value_of("host").unwrap(), - matches.value_of("port").unwrap()); + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); let context: ClientContext = - swagger::make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString::default()); + swagger::make_context!(ContextBuilder, EmptyContext, auth_data, XSpanIdString::default()); let mut client : Box> = if matches.is_present("https") { // Using Simple HTTPS diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/main.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/main.rs index 1a3f8022c38..7492252060e 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/main.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/main.rs @@ -1,10 +1,13 @@ //! Main binary entry point for rust_server_test implementation. +// This is the amended version that adds Authorization via Inversion of Control. #![allow(missing_docs)] + use clap::{App, Arg}; mod server; +mod server_auth; /// Create custom server, wire it to the autogenerated router, diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs index f9dcaa3fe26..56fc2f63c4d 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server.rs @@ -30,7 +30,9 @@ pub async fn create(addr: &str, https: bool) { let service = MakeService::new(server); - let service = MakeAllowAllAuthenticator::new(service, "cosmo"); + // This pushes a fourth layer of the middleware-stack even though Swagger assumes only three levels. + // This fourth layer creates an accept-all policy, hower the example-code already acchieves the same via a Bearer-token with full permissions, so next line is not needed (anymore). + // let service = MakeAllowAllAuthenticator::new(service, "cosmo"); #[allow(unused_mut)] let mut service = @@ -56,6 +58,7 @@ pub async fn create(addr: &str, https: bool) { let tls_acceptor = ssl.build(); let tcp_listener = TcpListener::bind(&addr).await.unwrap(); + info!("Starting a server (with https)"); loop { if let Ok((tcp, _)) = tcp_listener.accept().await { let ssl = Ssl::new(tls_acceptor.context()).unwrap(); @@ -75,6 +78,7 @@ pub async fn create(addr: &str, https: bool) { } } } else { + info!("Starting a server (over http, so no TLS)"); // Using HTTP hyper::server::Server::bind(&addr).serve(service).await.unwrap() } @@ -92,6 +96,12 @@ impl Server { } +use jsonwebtoken::{decode, encode, errors::Error as JwtError, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation}; +use serde::{Deserialize, Serialize}; +use swagger::auth::Authorization; +use crate::server_auth; + + use rust_server_test::{ Api, AllOfGetResponse, @@ -116,7 +126,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("all_of_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// A dummy endpoint to make the spec valid. @@ -125,7 +135,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("dummy_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn dummy_put( @@ -134,7 +144,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("dummy_put({:?}) - X-Span-ID: {:?}", nested_response, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Get a file @@ -143,7 +153,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("file_response_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn get_structured_yaml( @@ -151,7 +161,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("get_structured_yaml() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Test HTML handling @@ -161,7 +171,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("html_post(\"{}\") - X-Span-ID: {:?}", body, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } async fn post_yaml( @@ -170,7 +180,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("post_yaml(\"{}\") - X-Span-ID: {:?}", value, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Get an arbitrary JSON blob. @@ -179,7 +189,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("raw_json_get() - X-Span-ID: {:?}", context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } /// Send an arbitrary JSON blob @@ -189,7 +199,7 @@ impl Api for Server where C: Has + Send + Sync context: &C) -> Result { info!("solo_object_post({:?}) - X-Span-ID: {:?}", value, context.get().0.clone()); - Err(ApiError("Generic failure".into())) + Err(ApiError("Api-Error: Operation is NOT implemented".into())) } } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server_auth.rs b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server_auth.rs new file mode 100644 index 00000000000..3525e452ac1 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/examples/server/server_auth.rs @@ -0,0 +1,127 @@ +use swagger::{ + ApiError, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; +use rust_server_test::{AuthenticationApi, Claims}; +use crate::server::Server; +use jsonwebtoken::{decode, errors as JwtError, decode_header, DecodingKey, TokenData, Validation}; +use swagger::auth::Authorization; +use log::{error, debug}; + +// NOTE: Set environment variable RUST_LOG to the name of the executable (or "cargo run") to activate console logging for all loglevels. +// See https://docs.rs/env_logger/latest/env_logger/ for more details + + +/// Get a dummy claim with full permissions (all scopes) for testing purposes +fn full_permission_claim() -> Claims { + Claims { + sub: "tester@acme.com".to_owned(), + company: "ACME".to_owned(), + iss: "mini-bank-IDP".to_owned(), + aud: "org.acme.Resource_Server".to_string(), + // added a very long expiry time + exp: 10000000000, + // In this example code all available Scopes are added, so the current Bearer Token gets fully authorization. + scopes: [ + ].join(", ") + } +} + + + +/// Extract the data from a Bearer token using the provided Key (secret) and using the HS512-algorithm in this example. +fn extract_token_data(token: &str, key: &[u8]) -> Result, JwtError::Error> { + + // Ensure that you set the correct algorithm and correct key. + // See https://github.com/Keats/jsonwebtoken for more information. + let header = decode_header(token)?; + let validation = { + let mut validation = Validation::new(header.alg); + validation.set_audience(&["org.acme.Resource_Server"]); + validation.validate_exp = true; + validation + }; + + let token_data = decode::( + &token, + &DecodingKey::from_secret(key), + &validation, + )?; + + Ok(token_data) +} + +/// Build a swagger-Authorization based on the claims (Assuming claims have been extracted from a validated token) +fn build_authorization(claims: Claims) -> Authorization { + let mut scopes = std::collections::BTreeSet::::new(); + claims + .scopes + .split(",") + .map(|s| s.trim()) + .for_each(|s| {let _ = scopes.insert(s.to_string()); }); + let scopes = swagger::auth::Scopes::Some(scopes); + + Authorization{ + subject: claims.sub, + scopes, + issuer: Some(claims.iss)} +} + +fn get_jwt_error_string(error: JwtError::Error) -> String { + match error.kind() { + JwtError::ErrorKind::InvalidSignature => "Incorrect token signature".to_owned(), + JwtError::ErrorKind::InvalidAlgorithm => "The Algorithm is not correct".to_owned(), + JwtError::ErrorKind::ExpiredSignature => "The token has expired".to_owned(), + JwtError::ErrorKind::Base64(e) => format!("Base64 decode failed: {e}"), + JwtError::ErrorKind::Json(e) => format!("JSON decoding: {e}"), + JwtError::ErrorKind::Utf8(e) => format!("Invalid UTF-8: {e}"), + _ => error.to_string() + } +} + + +impl AuthenticationApi for Server where C: Has + Send + Sync { + + /// Implementation of the method to map a Bearer-token to an Authorization + fn bearer_authorization(&self, bearer: &Bearer) -> Result { + debug!("\tAuthorizationApi: Received Bearer-token, {bearer:#?}"); + + match extract_token_data(&bearer.token, b"secret") { + Ok(auth_data) => { + debug!("\tUnpack auth_data as: {auth_data:#?}"); + let authorization = build_authorization(auth_data.claims); + Ok(authorization) + }, + Err(err) => { + let msg = get_jwt_error_string(err); + error!("Failed to unpack Bearer-token: {msg}"); + Err(ApiError(msg)) + } + } + } + + /// Implementation of the method to map an api-key to an Authorization + fn apikey_authorization(&self, api_key: &str) -> Result { + debug!("\tAuthorizationApi: Received api-key, {api_key:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + + /// Implementation of the method to map a basic authentication (username and password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result { + debug!("\tAuthorizationApi: Received Basic-token, {basic:#?}"); + + // TODO: insert the logic to map received apikey to the set of claims + let claims = full_permission_claim(); + + // and build an authorization out of it + Ok(build_authorization(claims)) + } + +} + diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/auth.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/auth.rs new file mode 100644 index 00000000000..cbaba3dca7c --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/auth.rs @@ -0,0 +1,62 @@ +use std::collections::BTreeSet; +use crate::server::Authorization; +use serde::{Deserialize, Serialize}; +use swagger::{ApiError, auth::{Basic, Bearer}}; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Claims { + pub sub: String, + pub iss: String, + pub aud: String, + pub company: String, + pub exp: u64, + pub scopes: String, +} + + +pub trait AuthenticationApi { + + /// Method should be implemented (see example-code) to map Bearer-token to an Authorization + fn bearer_authorization(&self, token: &Bearer) -> Result; + + /// Method should be implemented (see example-code) to map ApiKey to an Authorization + fn apikey_authorization(&self, token: &str) -> Result; + + /// Method should be implemented (see example-code) to map Basic (Username:password) to an Authorization + fn basic_authorization(&self, basic: &Basic) -> Result; +} + +// Implement it for AllowAllAuthenticator (dummy is needed, but should not used as we have Bearer authorization) +use swagger::auth::{AllowAllAuthenticator, RcBound, Scopes}; + +fn dummy_authorization() -> Authorization { + // Is called when MakeAllowAllAuthenticator is added to the stack. This is not needed as we have Bearer-authorization in the example-code. + // However, if you want to use it anyway this can not be unimplemented, so dummy implementation added. + // unimplemented!() + Authorization{ + subject: "Dummmy".to_owned(), + scopes: Scopes::Some(BTreeSet::new()), // create an empty scope, as this should not be used + issuer: None + } +} + +impl AuthenticationApi for AllowAllAuthenticator +where + RC: RcBound, + RC::Result: Send + 'static { + + /// Get method to map Bearer-token to an Authorization + fn bearer_authorization(&self, _token: &Bearer) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map api-key to an Authorization + fn apikey_authorization(&self, _apikey: &str) -> Result { + Ok(dummy_authorization()) + } + + /// Get method to map basic token to an Authorization + fn basic_authorization(&self, _basic: &Basic) -> Result { + Ok(dummy_authorization()) + } +} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/context.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/context.rs index fadd880b965..ee8e118587b 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/context.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/context.rs @@ -8,7 +8,8 @@ use std::marker::PhantomData; use std::task::{Poll, Context}; use swagger::auth::{AuthData, Authorization, Bearer, Scopes}; use swagger::{EmptyContext, Has, Pop, Push, XSpanIdString}; -use crate::Api; +use crate::{Api, AuthenticationApi}; +use log::error; pub struct MakeAddContext { inner: T, @@ -89,7 +90,7 @@ impl Service> for AddContext, Result=C>, C: Push, Result=D>, D: Send + 'static, - T: Service<(Request, D)> + T: Service<(Request, D)> + AuthenticationApi { type Error = T::Error; type Future = T::Future; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index 01365afbb0f..5b86a01acea 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -5,15 +5,22 @@ use async_trait::async_trait; use futures::Stream; use std::error::Error; +use std::collections::BTreeSet; use std::task::{Poll, Context}; use swagger::{ApiError, ContextWrapper}; use serde::{Serialize, Deserialize}; +use crate::server::Authorization; + type ServiceError = Box; pub const BASE_PATH: &str = ""; pub const API_VERSION: &str = "2.3.4"; +mod auth; +pub use auth::{AuthenticationApi, Claims}; + + #[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum AllOfGetResponse { /// OK diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index 3152eb63a36..69527ec5cf8 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -14,8 +14,7 @@ use swagger::auth::Scopes; use url::form_urlencoded; #[allow(unused_imports)] -use crate::models; -use crate::header; +use crate::{models, header, AuthenticationApi}; pub use crate::context; @@ -33,6 +32,8 @@ use crate::{Api, SoloObjectPostResponse }; +mod server_auth; + mod paths { use lazy_static::lazy_static; @@ -59,6 +60,7 @@ mod paths { pub(crate) static ID_SOLO_OBJECT: usize = 7; } + pub struct MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -79,6 +81,7 @@ impl MakeService where } } + impl hyper::service::Service for MakeService where T: Api + Clone + Send + 'static, C: Has + Send + Sync + 'static @@ -92,7 +95,7 @@ impl hyper::service::Service for MakeService where } fn call(&mut self, target: Target) -> Self::Future { - futures::future::ok(Service::new( + future::ok(Service::new( self.api_impl.clone(), )) } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/server_auth.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/server_auth.rs new file mode 100644 index 00000000000..ba78eb2f3f5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/server_auth.rs @@ -0,0 +1,28 @@ +use super::Service; +use crate::{Api, AuthenticationApi}; +use swagger::{ + ApiError, + Authorization, + auth::{Basic, Bearer}, + Has, + XSpanIdString}; + +impl AuthenticationApi for Service where +T: Api + Clone + Send + 'static + AuthenticationApi, +C: Has + Has> + Send + Sync + 'static { + + /// Passthrough of the task to the api-implementation + fn bearer_authorization(&self, token: &Bearer) -> Result { + self.api_impl.bearer_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn apikey_authorization(&self, token: &str) -> Result { + self.api_impl.apikey_authorization(token) + } + + /// Passthrough of the task to the api-implementation + fn basic_authorization(&self, basic: &Basic) -> Result { + self.api_impl.basic_authorization(basic) + } +} diff --git a/samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml b/samples/server/petstore/scala-cask/.github/workflows/buildAndPublish.yml similarity index 90% rename from samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml rename to samples/server/petstore/scala-cask/.github/workflows/buildAndPublish.yml index fef794246b0..5a9d859e8ff 100644 --- a/samples/server/petstore/scala-cask/.github/workflows/bulidAndPublish.yml +++ b/samples/server/petstore/scala-cask/.github/workflows/buildAndPublish.yml @@ -30,10 +30,7 @@ jobs: ${{ runner.os }}-sbt- - name: Build with sbt - run: sbt clean compile - - - name: Test with sbt - run: sbt test + run: sbt clean compile test - name: Publish to GitHub Packages run: sbt publish diff --git a/samples/server/petstore/scala-cask/.openapi-generator/FILES b/samples/server/petstore/scala-cask/.openapi-generator/FILES index e65ebab478f..e3a6308f3d2 100644 --- a/samples/server/petstore/scala-cask/.openapi-generator/FILES +++ b/samples/server/petstore/scala-cask/.openapi-generator/FILES @@ -1,4 +1,4 @@ -.github/workflows/bulidAndPublish.yml +.github/workflows/buildAndPublish.yml .gitignore .scalafmt.conf README.md @@ -7,33 +7,33 @@ build.sbt build.sc example/Dockerfile example/Server.scala +jvm/src/main/scala/sample/cask/AppRoutes.scala +jvm/src/main/scala/sample/cask/BaseApp.scala +jvm/src/main/scala/sample/cask/ExampleApp.scala +jvm/src/main/scala/sample/cask/api/OpenApiRoutes.scala +jvm/src/main/scala/sample/cask/api/PetRoutes.scala +jvm/src/main/scala/sample/cask/api/PetRoutes.scala +jvm/src/main/scala/sample/cask/api/StoreRoutes.scala +jvm/src/main/scala/sample/cask/api/StoreRoutes.scala +jvm/src/main/scala/sample/cask/api/UserRoutes.scala +jvm/src/main/scala/sample/cask/api/UserRoutes.scala +jvm/src/main/scala/sample/cask/api/package.scala +jvm/src/main/scala/sample/cask/package.scala project/build.properties project/plugins.sbt -src/main/scala/sample/cask/AppRoutes.scala -src/main/scala/sample/cask/BaseApp.scala -src/main/scala/sample/cask/ExampleApp.scala -src/main/scala/sample/cask/api/OpenApiRoutes.scala -src/main/scala/sample/cask/api/PetRoutes.scala -src/main/scala/sample/cask/api/PetRoutes.scala -src/main/scala/sample/cask/api/PetService.scala -src/main/scala/sample/cask/api/StoreRoutes.scala -src/main/scala/sample/cask/api/StoreRoutes.scala -src/main/scala/sample/cask/api/StoreService.scala -src/main/scala/sample/cask/api/UserRoutes.scala -src/main/scala/sample/cask/api/UserRoutes.scala -src/main/scala/sample/cask/api/UserService.scala -src/main/scala/sample/cask/api/package.scala -src/main/scala/sample/cask/model/ApiResponse.scala -src/main/scala/sample/cask/model/ApiResponseData.scala -src/main/scala/sample/cask/model/Category.scala -src/main/scala/sample/cask/model/CategoryData.scala -src/main/scala/sample/cask/model/Order.scala -src/main/scala/sample/cask/model/OrderData.scala -src/main/scala/sample/cask/model/Pet.scala -src/main/scala/sample/cask/model/PetData.scala -src/main/scala/sample/cask/model/Tag.scala -src/main/scala/sample/cask/model/TagData.scala -src/main/scala/sample/cask/model/User.scala -src/main/scala/sample/cask/model/UserData.scala -src/main/scala/sample/cask/model/package.scala -src/main/scala/sample/cask/package.scala +shared/src/main/scala/sample/cask/api/PetService.scala +shared/src/main/scala/sample/cask/api/StoreService.scala +shared/src/main/scala/sample/cask/api/UserService.scala +shared/src/main/scala/sample/cask/model/ApiResponse.scala +shared/src/main/scala/sample/cask/model/ApiResponseData.scala +shared/src/main/scala/sample/cask/model/Category.scala +shared/src/main/scala/sample/cask/model/CategoryData.scala +shared/src/main/scala/sample/cask/model/Order.scala +shared/src/main/scala/sample/cask/model/OrderData.scala +shared/src/main/scala/sample/cask/model/Pet.scala +shared/src/main/scala/sample/cask/model/PetData.scala +shared/src/main/scala/sample/cask/model/Tag.scala +shared/src/main/scala/sample/cask/model/TagData.scala +shared/src/main/scala/sample/cask/model/User.scala +shared/src/main/scala/sample/cask/model/UserData.scala +shared/src/main/scala/sample/cask/model/package.scala diff --git a/samples/server/petstore/scala-cask/build.sbt b/samples/server/petstore/scala-cask/build.sbt index 4062a2fa45a..e0f93fa57bb 100644 --- a/samples/server/petstore/scala-cask/build.sbt +++ b/samples/server/petstore/scala-cask/build.sbt @@ -1,23 +1,47 @@ -name := "scala-cask-petstore" -organization:="cask.groupId" -version := "0.0.1-SNAPSHOT" -scalaVersion := "3.3.1" -scalafmtOnCompile := true -libraryDependencies ++= Seq( - "com.lihaoyi" %% "cask" % "0.9.2" , - "com.lihaoyi" %% "upickle" % "3.2.0", - "org.scalatest" %% "scalatest" % "3.2.18" % Test +ThisBuild / name := "scala-cask-petstore" +ThisBuild / organization := "cask.groupId" +ThisBuild / version := "0.0.1" +ThisBuild / scalaVersion := "3.4.1" +ThisBuild / scalafmtOnCompile := true +ThisBuild / versionScheme := Some("early-semver") + +// Common settings +lazy val commonSettings = Seq( + libraryDependencies ++= Seq( + "com.lihaoyi" %%% "upickle" % "3.2.0", + "org.scalatest" %%% "scalatest" % "3.2.18" % Test + ), + name := "scala-cask-petstore" ) -publishMavenStyle := true + +lazy val app = crossProject(JSPlatform, JVMPlatform).in(file(".")). + settings(commonSettings). + jvmSettings( + libraryDependencies += "com.lihaoyi" %% "cask" % "0.9.2" + ). + jsSettings( + scalaJSUseMainModuleInitializer := true + ) + + +lazy val root = project.in(file(".")). + aggregate(app.js, app.jvm). + settings( + publish := {}, + publishLocal := {}, + ) + + +ThisBuild / publishMavenStyle := true val githubUser = "GIT_USER_ID" val githubRepo = "GIT_REPO_ID" -publishTo := Some("GitHub Package Registry" at s"https://maven.pkg.github.com/$githubUser/$githubRepo") +ThisBuild / publishTo := Some("GitHub Package Registry" at s"https://maven.pkg.github.com/$githubUser/$githubRepo") sys.env.get("GITHUB_TOKEN") match { case Some(token) if !token.isEmpty => - credentials += Credentials( + ThisBuild / credentials += Credentials( "GitHub Package Registry", "maven.pkg.github.com", githubUser, diff --git a/samples/server/petstore/scala-cask/build.sc b/samples/server/petstore/scala-cask/build.sc index b2ca2988987..c305a30d90c 100644 --- a/samples/server/petstore/scala-cask/build.sc +++ b/samples/server/petstore/scala-cask/build.sc @@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._ // mill _.publishLocal // mill _.test.test object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishModule { - def scalaVersion = "3.3.1" + def scalaVersion = "3.4.1" def pomSettings = PomSettings( description = "scala-cask-petstore", @@ -21,15 +21,15 @@ object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishMod ) ) - def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") + def publishVersion: mill.T[String] = T("0.0.1") def ivyDeps = Agg( ivy"com.lihaoyi::cask:0.9.2" , ivy"com.lihaoyi::upickle:3.2.0" ) - override def sources = T.sources(millSourcePath / os.up / "src" / "main" / "scala") - override def resources = T.sources(millSourcePath / os.up / "src" / "main" / "resources") + override def sources = T.sources(millSourcePath / os.up / "shared" / "src" / "main" / "scala") + override def resources = T.sources(millSourcePath / os.up / "shared" / "src" / "main" / "resources") object test extends SbtModuleTests { def ivyDeps = Agg( diff --git a/samples/server/petstore/scala-cask/example/Server.scala b/samples/server/petstore/scala-cask/example/Server.scala index 77e65913712..cd6650b83a4 100644 --- a/samples/server/petstore/scala-cask/example/Server.scala +++ b/samples/server/petstore/scala-cask/example/Server.scala @@ -1,5 +1,5 @@ -//> using scala "3.3.1" -//> using lib "cask.groupId::scala-cask-petstore:0.0.1-SNAPSHOT" +//> using scala "3.4.1" +//> using lib "cask.groupId::scala-cask-petstore:0.0.1" //> using repositories https://maven.pkg.github.com/GIT_USER_ID/GIT_REPO_ID diff --git a/samples/server/petstore/scala-cask/src/main/resources/openapi.json b/samples/server/petstore/scala-cask/jvm/src/main/resources/openapi.json similarity index 100% rename from samples/server/petstore/scala-cask/src/main/resources/openapi.json rename to samples/server/petstore/scala-cask/jvm/src/main/resources/openapi.json diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/AppRoutes.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/AppRoutes.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/AppRoutes.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/BaseApp.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/BaseApp.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/BaseApp.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/ExampleApp.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/ExampleApp.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/ExampleApp.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/OpenApiRoutes.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/OpenApiRoutes.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/OpenApiRoutes.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/PetRoutes.scala similarity index 85% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/PetRoutes.scala index 4224e229493..75d4799d6e3 100644 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetRoutes.scala +++ b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/PetRoutes.scala @@ -67,7 +67,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Deletes a pet @@ -87,7 +88,7 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Finds Pets by status @@ -105,7 +106,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : List[Pet]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Finds Pets by tags @@ -123,7 +125,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : List[Pet]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Find pet by ID @@ -142,7 +145,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Update an existing pet @@ -162,7 +166,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Pet) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Updates a pet in the store with form data @@ -183,7 +188,7 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** uploads an image @@ -204,7 +209,8 @@ class PetRoutes(service : PetService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : ApiResponse) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/StoreRoutes.scala similarity index 82% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/StoreRoutes.scala index 1452575b38c..ede98a18d8b 100644 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreRoutes.scala +++ b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/StoreRoutes.scala @@ -43,7 +43,7 @@ class StoreRoutes(service : StoreService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Returns pet inventories by status @@ -61,7 +61,8 @@ class StoreRoutes(service : StoreService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Map[String, Int]) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Find purchase order by ID @@ -79,7 +80,8 @@ class StoreRoutes(service : StoreService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Order) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Place an order for a pet @@ -98,7 +100,8 @@ class StoreRoutes(service : StoreService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : Order) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/UserRoutes.scala similarity index 89% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/UserRoutes.scala index 7987883da6b..3bd483d6b80 100644 --- a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserRoutes.scala +++ b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/UserRoutes.scala @@ -56,7 +56,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Creates list of users with given input array @@ -75,7 +75,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Creates list of users with given input array @@ -94,7 +94,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Delete user @@ -113,7 +113,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Get user by user name @@ -131,7 +131,8 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : User) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Logs user into the system @@ -148,7 +149,8 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(value : String) => cask.Response(data = write(value), 200, headers = Seq("Content-Type" -> "application/json")) + case Right(other) => cask.Response(s"$other", 200) } } /** Logs out current logged in user session @@ -166,7 +168,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } /** Updated user @@ -187,7 +189,7 @@ class UserRoutes(service : UserService) extends cask.Routes { result match { case Left(error) => cask.Response(error, 500) - case Right(_) => cask.Response("", 200) + case Right(other) => cask.Response(s"$other", 200) } } diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/package.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/package.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/api/package.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala b/samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/package.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/package.scala rename to samples/server/petstore/scala-cask/jvm/src/main/scala/sample/cask/package.scala diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/ApiResponseTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/ApiResponseTest.scala index 18906d1f384..2cb45b8584c 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/ApiResponseTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/ApiResponseTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/CategoryTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/CategoryTest.scala index a2d9d6c6251..b040f70cd91 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/CategoryTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/CategoryTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/OrderTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/OrderTest.scala index 3f536010113..14071dc374a 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/OrderTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/OrderTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/PetTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/PetTest.scala index 1ab24f2e926..7ec3bb037b3 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/PetTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/PetTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/TagTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/TagTest.scala index 664e43e63c9..74a5dcf458e 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/TagTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/TagTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/UserTest.scala similarity index 87% rename from samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala rename to samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/UserTest.scala index 622fad87b0d..d01f0adf20e 100644 --- a/samples/server/petstore/scala-cask/src/test/scala/sample/cask/model/UserTest.scala +++ b/samples/server/petstore/scala-cask/jvm/src/test/scala/sample/cask/model/UserTest.scala @@ -3,10 +3,12 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 + * * Contact: team@openapitools.org * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git + * NOTE: This class is auto generated by OpenAPI Generator. + * + * https://openapi-generator.tech */ // this model was generated using modelTest.mustache diff --git a/samples/server/petstore/scala-cask/project/plugins.sbt b/samples/server/petstore/scala-cask/project/plugins.sbt index 4f3f02c2de4..ece317dfad9 100644 --- a/samples/server/petstore/scala-cask/project/plugins.sbt +++ b/samples/server/petstore/scala-cask/project/plugins.sbt @@ -1,3 +1,4 @@ -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") - -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") \ No newline at end of file +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") \ No newline at end of file diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/PetService.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/PetService.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/PetService.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/StoreService.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/StoreService.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/StoreService.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/UserService.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/api/UserService.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/api/UserService.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/ApiResponse.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponse.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/ApiResponse.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/ApiResponseData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/ApiResponseData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/ApiResponseData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Category.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Category.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Category.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/CategoryData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/CategoryData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/CategoryData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Order.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Order.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Order.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/OrderData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/OrderData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/OrderData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Pet.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Pet.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Pet.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/PetData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/PetData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/PetData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Tag.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/Tag.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/Tag.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/TagData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/TagData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/TagData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/User.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/User.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/User.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/UserData.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/UserData.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/UserData.scala diff --git a/samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala b/samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/package.scala similarity index 100% rename from samples/server/petstore/scala-cask/src/main/scala/sample/cask/model/package.scala rename to samples/server/petstore/scala-cask/shared/src/main/scala/sample/cask/model/package.scala diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ParentWithNullable.java index 9a053f2851a..bdcca7675d1 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -41,7 +41,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java index 8f8a94a815b..da5e9fbf991 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -38,7 +38,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..f7031df0cc7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..f7031df0cc7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 73f67164fed..0f8f98021d7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -28,6 +28,17 @@ public class AdditionalPropertiesAnyType { private String name; + public AdditionalPropertiesAnyType() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesAnyType(String name) { + this.name = name; + } + public AdditionalPropertiesAnyType name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index b5418d0d318..15ce23f6fc7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -29,6 +29,17 @@ public class AdditionalPropertiesArray { private String name; + public AdditionalPropertiesArray() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesArray(String name) { + this.name = name; + } + public AdditionalPropertiesArray name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e49060ecb7..f361faf2f08 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -28,6 +28,17 @@ public class AdditionalPropertiesBoolean { private String name; + public AdditionalPropertiesBoolean() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesBoolean(String name) { + this.name = name; + } + public AdditionalPropertiesBoolean name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2371a7daf4a..86d18ee0b05 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -59,6 +59,27 @@ public class AdditionalPropertiesClass { private Object anytype3; + public AdditionalPropertiesClass() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesClass(Map mapString, Map mapNumber, Map mapInteger, Map mapBoolean, Map> mapArrayInteger, Map> mapArrayAnytype, Map> mapMapString, Map> mapMapAnytype, Object anytype1, Object anytype2, Object anytype3) { + this.mapString = mapString; + this.mapNumber = mapNumber; + this.mapInteger = mapInteger; + this.mapBoolean = mapBoolean; + this.mapArrayInteger = mapArrayInteger; + this.mapArrayAnytype = mapArrayAnytype; + this.mapMapString = mapMapString; + this.mapMapAnytype = mapMapAnytype; + this.anytype1 = anytype1; + this.anytype2 = JsonNullable.of(anytype2); + this.anytype3 = anytype3; + } + public AdditionalPropertiesClass mapString(Map mapString) { this.mapString = mapString; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index d1635eccf53..92cefc1e226 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -28,6 +28,17 @@ public class AdditionalPropertiesInteger { private String name; + public AdditionalPropertiesInteger() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesInteger(String name) { + this.name = name; + } + public AdditionalPropertiesInteger name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 5e429cd1951..8ef7223e68b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -29,6 +29,17 @@ public class AdditionalPropertiesNumber { private String name; + public AdditionalPropertiesNumber() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesNumber(String name) { + this.name = name; + } + public AdditionalPropertiesNumber name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index b382e91f4bd..e1ba8ddecc5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -29,6 +29,17 @@ public class AdditionalPropertiesObject { private String name; + public AdditionalPropertiesObject() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesObject(String name) { + this.name = name; + } + public AdditionalPropertiesObject name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index c75a652e442..8db9d64cc45 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -28,6 +28,17 @@ public class AdditionalPropertiesString { private String name; + public AdditionalPropertiesString() { + super(); + } + + /** + * Constructor with all args parameters + */ + public AdditionalPropertiesString(String name) { + this.name = name; + } + public AdditionalPropertiesString name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index a527775c759..05f372ee386 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java @@ -51,6 +51,14 @@ public class Animal { this.className = className; } + /** + * Constructor with all args parameters + */ + public Animal(String className, String color) { + this.className = className; + this.color = color; + } + public Animal className(String className) { this.className = className; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..48f6def46d1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,17 @@ public class ArrayOfArrayOfNumberOnly { @Valid private List> arrayArrayNumber = new ArrayList<>(); + public ArrayOfArrayOfNumberOnly() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..beccfd0f352 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,6 +29,17 @@ public class ArrayOfNumberOnly { @Valid private List arrayNumber = new ArrayList<>(); + public ArrayOfNumberOnly() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ArrayOfNumberOnly(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..aee8607f9ce 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -35,6 +35,19 @@ public class ArrayTest { @Valid private List> arrayArrayOfModel = new ArrayList<>(); + public ArrayTest() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ArrayTest(List arrayOfString, List> arrayArrayOfInteger, List> arrayArrayOfModel) { + this.arrayOfString = arrayOfString; + this.arrayArrayOfInteger = arrayArrayOfInteger; + this.arrayArrayOfModel = arrayArrayOfModel; + } + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index 054c9e211e0..476874427f9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -80,6 +80,14 @@ public class BigCat extends Cat { super(className); } + /** + * Constructor with all args parameters + */ + public BigCat(KindEnum kind, Boolean declawed, String className, String color) { + super(declawed, className, color); + this.kind = kind; + } + public BigCat kind(KindEnum kind) { this.kind = kind; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index dabf3b4b310..322ff2ae7ad 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java @@ -34,6 +34,22 @@ public class Capitalization { private String ATT_NAME; + public Capitalization() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Capitalization(String smallCamel, String capitalCamel, String smallSnake, String capitalSnake, String scAETHFlowPoints, String ATT_NAME) { + this.smallCamel = smallCamel; + this.capitalCamel = capitalCamel; + this.smallSnake = smallSnake; + this.capitalSnake = capitalSnake; + this.scAETHFlowPoints = scAETHFlowPoints; + this.ATT_NAME = ATT_NAME; + } + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index 3913f60d81a..597f32514ba 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -48,6 +48,14 @@ public class Cat extends Animal { super(className); } + /** + * Constructor with all args parameters + */ + public Cat(Boolean declawed, String className, String color) { + super(className, color); + this.declawed = declawed; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index a3e6efb9154..e0f63c4a46e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java @@ -37,6 +37,14 @@ public class Category { this.name = name; } + /** + * Constructor with all args parameters + */ + public Category(Long id, String name) { + this.id = id; + this.name = name; + } + public Category id(Long id) { this.id = id; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java index d7990c3e420..3d02295a7e3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -32,6 +32,18 @@ public class ChildWithNullable extends ParentWithNullable { private String otherProperty; + public ChildWithNullable() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ChildWithNullable(String otherProperty, TypeEnum type, String nullableProperty) { + super(type, nullableProperty); + this.otherProperty = otherProperty; + } + public ChildWithNullable otherProperty(String otherProperty) { this.otherProperty = otherProperty; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index adbd74d3d8d..88b46634e8b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java @@ -25,6 +25,17 @@ public class ClassModel { private String propertyClass; + public ClassModel() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ClassModel(String propertyClass) { + this.propertyClass = propertyClass; + } + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index 23928e99bab..0edc810aed2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java @@ -24,6 +24,17 @@ public class Client { private String client; + public Client() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Client(String client) { + this.client = client; + } + public Client client(String client) { this.client = client; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..050f9f38193 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -51,6 +51,16 @@ public class ContainerDefaultValue { this.requiredArray = requiredArray; } + /** + * Constructor with all args parameters + */ + public ContainerDefaultValue(List nullableArray, List nullableRequiredArray, List requiredArray, List nullableArrayWithDefault) { + this.nullableArray = JsonNullable.of(nullableArray); + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + } + public ContainerDefaultValue nullableArray(List nullableArray) { this.nullableArray = JsonNullable.of(nullableArray); return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 0deac7c4211..1ef5c388c1b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -40,6 +40,14 @@ public class Dog extends Animal { super(className); } + /** + * Constructor with all args parameters + */ + public Dog(String breed, String className, String color) { + super(className, color); + this.breed = breed; + } + public Dog breed(String breed) { this.breed = breed; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index 06d6dc4c6af..8c48286f0dd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -101,6 +101,18 @@ public class EnumArrays { @Valid private List arrayEnum = new ArrayList<>(); + public EnumArrays() { + super(); + } + + /** + * Constructor with all args parameters + */ + public EnumArrays(JustSymbolEnum justSymbol, List arrayEnum) { + this.justSymbol = justSymbol; + this.arrayEnum = arrayEnum; + } + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index 30f4a859c38..57997d3349a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -191,6 +191,17 @@ public class EnumTest { this.enumStringRequired = enumStringRequired; } + /** + * Constructor with all args parameters + */ + public EnumTest(EnumStringEnum enumString, EnumStringRequiredEnum enumStringRequired, EnumIntegerEnum enumInteger, EnumNumberEnum enumNumber, OuterEnum outerEnum) { + this.enumString = enumString; + this.enumStringRequired = enumStringRequired; + this.enumInteger = enumInteger; + this.enumNumber = enumNumber; + this.outerEnum = outerEnum; + } + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index fbcd8f7f2c4..d7fbd67e873 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java @@ -25,6 +25,17 @@ public class File { private String sourceURI; + public File() { + super(); + } + + /** + * Constructor with all args parameters + */ + public File(String sourceURI) { + this.sourceURI = sourceURI; + } + public File sourceURI(String sourceURI) { this.sourceURI = sourceURI; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 29222a865e1..0d6749e1b86 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -31,6 +31,18 @@ public class FileSchemaTestClass { @Valid private List<@Valid File> files = new ArrayList<>(); + public FileSchemaTestClass() { + super(); + } + + /** + * Constructor with all args parameters + */ + public FileSchemaTestClass(File file, List<@Valid File> files) { + this.file = file; + this.files = files; + } + public FileSchemaTestClass file(File file) { this.file = file; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index f73894f713f..f4d5cb78403 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -74,6 +74,26 @@ public class FormatTest { this.password = password; } + /** + * Constructor with all args parameters + */ + public FormatTest(Integer integer, Integer int32, Long int64, BigDecimal number, Float _float, Double _double, String string, byte[] _byte, org.springframework.core.io.Resource binary, LocalDate date, OffsetDateTime dateTime, UUID uuid, String password, BigDecimal bigDecimal) { + this.integer = integer; + this.int32 = int32; + this.int64 = int64; + this.number = number; + this._float = _float; + this._double = _double; + this.string = string; + this._byte = _byte; + this.binary = binary; + this.date = date; + this.dateTime = dateTime; + this.uuid = uuid; + this.password = password; + this.bigDecimal = bigDecimal; + } + public FormatTest integer(Integer integer) { this.integer = integer; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 80402f05afe..1d0814c42ef 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -28,6 +28,18 @@ public class HasOnlyReadOnly { private String foo; + public HasOnlyReadOnly() { + super(); + } + + /** + * Constructor with all args parameters + */ + public HasOnlyReadOnly(String bar, String foo) { + this.bar = bar; + this.foo = foo; + } + public HasOnlyReadOnly bar(String bar) { this.bar = bar; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..e254672bf42 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -72,6 +72,20 @@ public class MapTest { @Valid private Map indirectMap = new HashMap<>(); + public MapTest() { + super(); + } + + /** + * Constructor with all args parameters + */ + public MapTest(Map> mapMapOfString, Map mapOfEnumString, Map directMap, Map indirectMap) { + this.mapMapOfString = mapMapOfString; + this.mapOfEnumString = mapOfEnumString; + this.directMap = directMap; + this.indirectMap = indirectMap; + } + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index a83c6ed1887..9b2f205b700 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,6 +36,19 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Valid private Map map = new HashMap<>(); + public MixedPropertiesAndAdditionalPropertiesClass() { + super(); + } + + /** + * Constructor with all args parameters + */ + public MixedPropertiesAndAdditionalPropertiesClass(UUID uuid, OffsetDateTime dateTime, Map map) { + this.uuid = uuid; + this.dateTime = dateTime; + this.map = map; + } + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 1bce307505c..5410978075e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java @@ -29,6 +29,18 @@ public class Model200Response { private String propertyClass; + public Model200Response() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Model200Response(Integer name, String propertyClass) { + this.name = name; + this.propertyClass = propertyClass; + } + public Model200Response name(Integer name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index 850ccafc51c..919ef135526 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -30,6 +30,19 @@ public class ModelApiResponse { private String message; + public ModelApiResponse() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ModelApiResponse(Integer code, String type, String message) { + this.code = code; + this.type = type; + this.message = message; + } + public ModelApiResponse code(Integer code) { this.code = code; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index 55695ab86fe..efa5b68cde5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java @@ -26,6 +26,17 @@ public class ModelList { private String _123list; + public ModelList() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ModelList(String _123list) { + this._123list = _123list; + } + public ModelList _123list(String _123list) { this._123list = _123list; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index d361b14ef9c..46e81203930 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java @@ -27,6 +27,17 @@ public class ModelReturn { private Integer _return; + public ModelReturn() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ModelReturn(Integer _return) { + this._return = _return; + } + public ModelReturn _return(Integer _return) { this._return = _return; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 5fbd5fabddf..7ce745843db 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java @@ -42,6 +42,16 @@ public class Name { this.name = name; } + /** + * Constructor with all args parameters + */ + public Name(Integer name, Integer snakeCase, String property, Integer _123number) { + this.name = name; + this.snakeCase = snakeCase; + this.property = property; + this._123number = _123number; + } + public Name name(Integer name) { this.name = name; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..dff2ca40507 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -30,6 +30,17 @@ public class NullableMapProperty { @Valid private JsonNullable> languageValues = JsonNullable.>undefined(); + public NullableMapProperty() { + super(); + } + + /** + * Constructor with all args parameters + */ + public NullableMapProperty(Map languageValues) { + this.languageValues = JsonNullable.of(languageValues); + } + public NullableMapProperty languageValues(Map languageValues) { this.languageValues = JsonNullable.of(languageValues); return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index a447d7dce2c..4b3634ed221 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -25,6 +25,17 @@ public class NumberOnly { private BigDecimal justNumber; + public NumberOnly() { + super(); + } + + /** + * Constructor with all args parameters + */ + public NumberOnly(BigDecimal justNumber) { + this.justNumber = justNumber; + } + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 0d25690bf78..e4da1256a68 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java @@ -75,6 +75,22 @@ public class Order { private Boolean complete = false; + public Order() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Order(Long id, Long petId, Integer quantity, OffsetDateTime shipDate, StatusEnum status, Boolean complete) { + this.id = id; + this.petId = petId; + this.quantity = quantity; + this.shipDate = shipDate; + this.status = status; + this.complete = complete; + } + public Order id(Long id) { this.id = id; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index 2a1e67e8932..a8577450430 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -29,6 +29,19 @@ public class OuterComposite { private Boolean myBoolean; + public OuterComposite() { + super(); + } + + /** + * Constructor with all args parameters + */ + public OuterComposite(BigDecimal myNumber, String myString, Boolean myBoolean) { + this.myNumber = myNumber; + this.myString = myString; + this.myBoolean = myBoolean; + } + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..d7e0f1b886b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -75,6 +75,18 @@ public class ParentWithNullable { private JsonNullable nullableProperty = JsonNullable.undefined(); + public ParentWithNullable() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ParentWithNullable(TypeEnum type, String nullableProperty) { + this.type = type; + this.nullableProperty = JsonNullable.of(nullableProperty); + } + public ParentWithNullable type(TypeEnum type) { this.type = type; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 870cd6e0d2b..de82d64e065 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -95,6 +95,18 @@ public class Pet { this.photoUrls = photoUrls; } + /** + * Constructor with all args parameters + */ + public Pet(Long id, Category category, String name, Set photoUrls, List<@Valid Tag> tags, StatusEnum status) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + public Pet id(Long id) { this.id = id; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 50dccc70e50..c811e03a587 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,6 +26,18 @@ public class ReadOnlyFirst { private String baz; + public ReadOnlyFirst() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ReadOnlyFirst(String bar, String baz) { + this.bar = bar; + this.baz = baz; + } + public ReadOnlyFirst bar(String bar) { this.bar = bar; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index dbe8a7586be..ae7a0e62866 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -30,6 +30,20 @@ public class ResponseObjectWithDifferentFieldNames { private String propertyNameWithSpaces; + public ResponseObjectWithDifferentFieldNames() { + super(); + } + + /** + * Constructor with all args parameters + */ + public ResponseObjectWithDifferentFieldNames(String normalPropertyName, String UPPER_CASE_PROPERTY_SNAKE, String lowerCasePropertyDashes, String propertyNameWithSpaces) { + this.normalPropertyName = normalPropertyName; + this.UPPER_CASE_PROPERTY_SNAKE = UPPER_CASE_PROPERTY_SNAKE; + this.lowerCasePropertyDashes = lowerCasePropertyDashes; + this.propertyNameWithSpaces = propertyNameWithSpaces; + } + public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPropertyName) { this.normalPropertyName = normalPropertyName; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index e815b1e099e..ef4ad59351c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -26,6 +26,17 @@ public class SpecialModelName { private Long $specialPropertyName; + public SpecialModelName() { + super(); + } + + /** + * Constructor with all args parameters + */ + public SpecialModelName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index 74018ef7a64..5c8ba983cb6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java @@ -26,6 +26,18 @@ public class Tag { private String name; + public Tag() { + super(); + } + + /** + * Constructor with all args parameters + */ + public Tag(Long id, String name) { + this.id = id; + this.name = name; + } + public Tag id(Long id) { this.id = id; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..7fcbbe68e96 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -42,7 +42,7 @@ public class TypeHolderDefault { } /** - * Constructor with only required parameters + * Constructor with only required parameters and all parameters */ public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..5d76d3e858a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -44,7 +44,7 @@ public class TypeHolderExample { } /** - * Constructor with only required parameters + * Constructor with only required parameters and all parameters */ public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { this.stringItem = stringItem; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index 3c2cbba3945..34caf580683 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java @@ -38,6 +38,24 @@ public class User { private Integer userStatus; + public User() { + super(); + } + + /** + * Constructor with all args parameters + */ + public User(Long id, String username, String firstName, String lastName, String email, String password, String phone, Integer userStatus) { + this.id = id; + this.username = username; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.phone = phone; + this.userStatus = userStatus; + } + public User id(Long id) { this.id = id; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 401ef00a800..762a2f202ff 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -93,6 +93,45 @@ public class XmlItem { @Valid private List prefixNsWrappedArray = new ArrayList<>(); + public XmlItem() { + super(); + } + + /** + * Constructor with all args parameters + */ + public XmlItem(String attributeString, BigDecimal attributeNumber, Integer attributeInteger, Boolean attributeBoolean, List wrappedArray, String nameString, BigDecimal nameNumber, Integer nameInteger, Boolean nameBoolean, List nameArray, List nameWrappedArray, String prefixString, BigDecimal prefixNumber, Integer prefixInteger, Boolean prefixBoolean, List prefixArray, List prefixWrappedArray, String namespaceString, BigDecimal namespaceNumber, Integer namespaceInteger, Boolean namespaceBoolean, List namespaceArray, List namespaceWrappedArray, String prefixNsString, BigDecimal prefixNsNumber, Integer prefixNsInteger, Boolean prefixNsBoolean, List prefixNsArray, List prefixNsWrappedArray) { + this.attributeString = attributeString; + this.attributeNumber = attributeNumber; + this.attributeInteger = attributeInteger; + this.attributeBoolean = attributeBoolean; + this.wrappedArray = wrappedArray; + this.nameString = nameString; + this.nameNumber = nameNumber; + this.nameInteger = nameInteger; + this.nameBoolean = nameBoolean; + this.nameArray = nameArray; + this.nameWrappedArray = nameWrappedArray; + this.prefixString = prefixString; + this.prefixNumber = prefixNumber; + this.prefixInteger = prefixInteger; + this.prefixBoolean = prefixBoolean; + this.prefixArray = prefixArray; + this.prefixWrappedArray = prefixWrappedArray; + this.namespaceString = namespaceString; + this.namespaceNumber = namespaceNumber; + this.namespaceInteger = namespaceInteger; + this.namespaceBoolean = namespaceBoolean; + this.namespaceArray = namespaceArray; + this.namespaceWrappedArray = namespaceWrappedArray; + this.prefixNsString = prefixNsString; + this.prefixNsNumber = prefixNsNumber; + this.prefixNsInteger = prefixNsInteger; + this.prefixNsBoolean = prefixNsBoolean; + this.prefixNsArray = prefixNsArray; + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; return this; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..f7031df0cc7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..f7031df0cc7 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index a881701d0df..f7031df0cc7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index f3482a08702..2289c9e795f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -124,5 +124,68 @@ public class AdditionalPropertiesAnyType { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesAnyType instance; + + public Builder() { + this(new AdditionalPropertiesAnyType()); + } + + protected Builder(AdditionalPropertiesAnyType instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesAnyType value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesAnyType.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesAnyType.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesAnyType instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesAnyType build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesAnyType.Builder builder() { + return new AdditionalPropertiesAnyType.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesAnyType.Builder toBuilder() { + AdditionalPropertiesAnyType.Builder builder = new AdditionalPropertiesAnyType.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index fee24194267..396a5924f1b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -125,5 +125,68 @@ public class AdditionalPropertiesArray { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesArray instance; + + public Builder() { + this(new AdditionalPropertiesArray()); + } + + protected Builder(AdditionalPropertiesArray instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesArray value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesArray.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesArray.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesArray instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesArray build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesArray.Builder builder() { + return new AdditionalPropertiesArray.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesArray.Builder toBuilder() { + AdditionalPropertiesArray.Builder builder = new AdditionalPropertiesArray.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index eaa4ade300f..65c82890a47 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -124,5 +124,68 @@ public class AdditionalPropertiesBoolean { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesBoolean instance; + + public Builder() { + this(new AdditionalPropertiesBoolean()); + } + + protected Builder(AdditionalPropertiesBoolean instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesBoolean value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesBoolean.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesBoolean.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesBoolean instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesBoolean build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesBoolean.Builder builder() { + return new AdditionalPropertiesBoolean.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesBoolean.Builder toBuilder() { + AdditionalPropertiesBoolean.Builder builder = new AdditionalPropertiesBoolean.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index dd9699694d6..af93588acac 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -410,5 +410,128 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesClass instance; + + public Builder() { + this(new AdditionalPropertiesClass()); + } + + protected Builder(AdditionalPropertiesClass instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesClass value) { + this.instance.setMapString(value.mapString); + this.instance.setMapNumber(value.mapNumber); + this.instance.setMapInteger(value.mapInteger); + this.instance.setMapBoolean(value.mapBoolean); + this.instance.setMapArrayInteger(value.mapArrayInteger); + this.instance.setMapArrayAnytype(value.mapArrayAnytype); + this.instance.setMapMapString(value.mapMapString); + this.instance.setMapMapAnytype(value.mapMapAnytype); + this.instance.setAnytype1(value.anytype1); + this.instance.setAnytype2(value.anytype2); + this.instance.setAnytype3(value.anytype3); + return this; + } + + public AdditionalPropertiesClass.Builder mapString(Map mapString) { + this.instance.mapString(mapString); + return this; + } + + public AdditionalPropertiesClass.Builder mapNumber(Map mapNumber) { + this.instance.mapNumber(mapNumber); + return this; + } + + public AdditionalPropertiesClass.Builder mapInteger(Map mapInteger) { + this.instance.mapInteger(mapInteger); + return this; + } + + public AdditionalPropertiesClass.Builder mapBoolean(Map mapBoolean) { + this.instance.mapBoolean(mapBoolean); + return this; + } + + public AdditionalPropertiesClass.Builder mapArrayInteger(Map> mapArrayInteger) { + this.instance.mapArrayInteger(mapArrayInteger); + return this; + } + + public AdditionalPropertiesClass.Builder mapArrayAnytype(Map> mapArrayAnytype) { + this.instance.mapArrayAnytype(mapArrayAnytype); + return this; + } + + public AdditionalPropertiesClass.Builder mapMapString(Map> mapMapString) { + this.instance.mapMapString(mapMapString); + return this; + } + + public AdditionalPropertiesClass.Builder mapMapAnytype(Map> mapMapAnytype) { + this.instance.mapMapAnytype(mapMapAnytype); + return this; + } + + public AdditionalPropertiesClass.Builder anytype1(Object anytype1) { + this.instance.anytype1(anytype1); + return this; + } + + public AdditionalPropertiesClass.Builder anytype2(Object anytype2) { + this.instance.anytype2(anytype2); + return this; + } + + public AdditionalPropertiesClass.Builder anytype2(JsonNullable anytype2) { + this.instance.anytype2 = anytype2; + return this; + } + + public AdditionalPropertiesClass.Builder anytype3(Object anytype3) { + this.instance.anytype3(anytype3); + return this; + } + + /** + * returns a built AdditionalPropertiesClass instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesClass.Builder builder() { + return new AdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesClass.Builder toBuilder() { + AdditionalPropertiesClass.Builder builder = new AdditionalPropertiesClass.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 6e7d39542e8..c83877b0723 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -124,5 +124,68 @@ public class AdditionalPropertiesInteger { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesInteger instance; + + public Builder() { + this(new AdditionalPropertiesInteger()); + } + + protected Builder(AdditionalPropertiesInteger instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesInteger value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesInteger.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesInteger.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesInteger instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesInteger build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesInteger.Builder builder() { + return new AdditionalPropertiesInteger.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesInteger.Builder toBuilder() { + AdditionalPropertiesInteger.Builder builder = new AdditionalPropertiesInteger.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 0369bf583c3..1b298faa0f0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -125,5 +125,68 @@ public class AdditionalPropertiesNumber { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesNumber instance; + + public Builder() { + this(new AdditionalPropertiesNumber()); + } + + protected Builder(AdditionalPropertiesNumber instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesNumber value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesNumber.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesNumber.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesNumber instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesNumber build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesNumber.Builder builder() { + return new AdditionalPropertiesNumber.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesNumber.Builder toBuilder() { + AdditionalPropertiesNumber.Builder builder = new AdditionalPropertiesNumber.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 24bb62f394c..26145852143 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -125,5 +125,68 @@ public class AdditionalPropertiesObject { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesObject instance; + + public Builder() { + this(new AdditionalPropertiesObject()); + } + + protected Builder(AdditionalPropertiesObject instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesObject value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesObject.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesObject.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesObject instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesObject build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesObject.Builder builder() { + return new AdditionalPropertiesObject.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesObject.Builder toBuilder() { + AdditionalPropertiesObject.Builder builder = new AdditionalPropertiesObject.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 8b6f300c9cc..36caf9fef90 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java @@ -124,5 +124,68 @@ public class AdditionalPropertiesString { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private AdditionalPropertiesString instance; + + public Builder() { + this(new AdditionalPropertiesString()); + } + + protected Builder(AdditionalPropertiesString instance) { + this.instance = instance; + } + + protected Builder copyOf(AdditionalPropertiesString value) { + this.instance.setName(value.name); + return this; + } + + public AdditionalPropertiesString.Builder name(String name) { + this.instance.name(name); + return this; + } + + public AdditionalPropertiesString.Builder additionalProperties(Map additionalProperties) { + this.instance.additionalProperties = additionalProperties; + return this; + } + + /** + * returns a built AdditionalPropertiesString instance. + * + * The builder is not reusable (NullPointerException) + */ + public AdditionalPropertiesString build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static AdditionalPropertiesString.Builder builder() { + return new AdditionalPropertiesString.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesString.Builder toBuilder() { + AdditionalPropertiesString.Builder builder = new AdditionalPropertiesString.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index 1ef9d449bd7..4353ddc4c6a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java @@ -129,5 +129,69 @@ public class Animal { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Animal instance; + + public Builder() { + this(new Animal()); + } + + protected Builder(Animal instance) { + this.instance = instance; + } + + protected Builder copyOf(Animal value) { + this.instance.setClassName(value.className); + this.instance.setColor(value.color); + return this; + } + + public Animal.Builder className(String className) { + this.instance.className(className); + return this; + } + + public Animal.Builder color(String color) { + this.instance.color(color); + return this; + } + + /** + * returns a built Animal instance. + * + * The builder is not reusable (NullPointerException) + */ + public Animal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Animal.Builder builder() { + return new Animal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Animal.Builder toBuilder() { + Animal.Builder builder = new Animal.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 30fd7adc1a6..9a712a49e8c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -93,5 +93,63 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ArrayOfArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfArrayOfNumberOnly()); + } + + protected Builder(ArrayOfArrayOfNumberOnly instance) { + this.instance = instance; + } + + protected Builder copyOf(ArrayOfArrayOfNumberOnly value) { + this.instance.setArrayArrayNumber(value.arrayArrayNumber); + return this; + } + + public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) { + this.instance.arrayArrayNumber(arrayArrayNumber); + return this; + } + + /** + * returns a built ArrayOfArrayOfNumberOnly instance. + * + * The builder is not reusable (NullPointerException) + */ + public ArrayOfArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ArrayOfArrayOfNumberOnly.Builder builder() { + return new ArrayOfArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfArrayOfNumberOnly.Builder toBuilder() { + ArrayOfArrayOfNumberOnly.Builder builder = new ArrayOfArrayOfNumberOnly.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 854caa835ac..d403e0fac43 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -93,5 +93,63 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfNumberOnly()); + } + + protected Builder(ArrayOfNumberOnly instance) { + this.instance = instance; + } + + protected Builder copyOf(ArrayOfNumberOnly value) { + this.instance.setArrayNumber(value.arrayNumber); + return this; + } + + public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) { + this.instance.arrayNumber(arrayNumber); + return this; + } + + /** + * returns a built ArrayOfNumberOnly instance. + * + * The builder is not reusable (NullPointerException) + */ + public ArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ArrayOfNumberOnly.Builder builder() { + return new ArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfNumberOnly.Builder toBuilder() { + ArrayOfNumberOnly.Builder builder = new ArrayOfNumberOnly.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 799661b7c8a..d0b90cf2fb2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -159,5 +159,75 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ArrayTest instance; + + public Builder() { + this(new ArrayTest()); + } + + protected Builder(ArrayTest instance) { + this.instance = instance; + } + + protected Builder copyOf(ArrayTest value) { + this.instance.setArrayOfString(value.arrayOfString); + this.instance.setArrayArrayOfInteger(value.arrayArrayOfInteger); + this.instance.setArrayArrayOfModel(value.arrayArrayOfModel); + return this; + } + + public ArrayTest.Builder arrayOfString(List arrayOfString) { + this.instance.arrayOfString(arrayOfString); + return this; + } + + public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.instance.arrayArrayOfInteger(arrayArrayOfInteger); + return this; + } + + public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) { + this.instance.arrayArrayOfModel(arrayArrayOfModel); + return this; + } + + /** + * returns a built ArrayTest instance. + * + * The builder is not reusable (NullPointerException) + */ + public ArrayTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ArrayTest.Builder builder() { + return new ArrayTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayTest.Builder toBuilder() { + ArrayTest.Builder builder = new ArrayTest.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 6379558e8ce..efc47684d4e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -153,5 +153,84 @@ public class BigCat extends Cat { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Cat.Builder { + + private BigCat instance; + + public Builder() { + this(new BigCat()); + } + + protected Builder(BigCat instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(BigCat value) { + super.copyOf(instance); + this.instance.setKind(value.kind); + return this; + } + + public BigCat.Builder kind(KindEnum kind) { + this.instance.kind(kind); + return this; + } + + @Override + public BigCat.Builder declawed(Boolean declawed) { + this.instance.declawed(declawed); + return this; + } + + @Override + public BigCat.Builder className(String className) { + this.instance.className(className); + return this; + } + + @Override + public BigCat.Builder color(String color) { + this.instance.color(color); + return this; + } + + /** + * returns a built BigCat instance. + * + * The builder is not reusable (NullPointerException) + */ + public BigCat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static BigCat.Builder builder() { + return new BigCat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BigCat.Builder toBuilder() { + BigCat.Builder builder = new BigCat.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 620bb67fd38..ad48299bc3b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java @@ -200,5 +200,93 @@ public class Capitalization { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Capitalization instance; + + public Builder() { + this(new Capitalization()); + } + + protected Builder(Capitalization instance) { + this.instance = instance; + } + + protected Builder copyOf(Capitalization value) { + this.instance.setSmallCamel(value.smallCamel); + this.instance.setCapitalCamel(value.capitalCamel); + this.instance.setSmallSnake(value.smallSnake); + this.instance.setCapitalSnake(value.capitalSnake); + this.instance.setScAETHFlowPoints(value.scAETHFlowPoints); + this.instance.setATTNAME(value.ATT_NAME); + return this; + } + + public Capitalization.Builder smallCamel(String smallCamel) { + this.instance.smallCamel(smallCamel); + return this; + } + + public Capitalization.Builder capitalCamel(String capitalCamel) { + this.instance.capitalCamel(capitalCamel); + return this; + } + + public Capitalization.Builder smallSnake(String smallSnake) { + this.instance.smallSnake(smallSnake); + return this; + } + + public Capitalization.Builder capitalSnake(String capitalSnake) { + this.instance.capitalSnake(capitalSnake); + return this; + } + + public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) { + this.instance.scAETHFlowPoints(scAETHFlowPoints); + return this; + } + + public Capitalization.Builder ATT_NAME(String ATT_NAME) { + this.instance.ATT_NAME(ATT_NAME); + return this; + } + + /** + * returns a built Capitalization instance. + * + * The builder is not reusable (NullPointerException) + */ + public Capitalization build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Capitalization.Builder builder() { + return new Capitalization.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Capitalization.Builder toBuilder() { + Capitalization.Builder builder = new Capitalization.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 330ce4533bf..8e642cf4cb9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -116,5 +116,78 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Animal.Builder { + + private Cat instance; + + public Builder() { + this(new Cat()); + } + + protected Builder(Cat instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Cat value) { + super.copyOf(instance); + this.instance.setDeclawed(value.declawed); + return this; + } + + public Cat.Builder declawed(Boolean declawed) { + this.instance.declawed(declawed); + return this; + } + + @Override + public Cat.Builder className(String className) { + this.instance.className(className); + return this; + } + + @Override + public Cat.Builder color(String color) { + this.instance.color(color); + return this; + } + + /** + * returns a built Cat instance. + * + * The builder is not reusable (NullPointerException) + */ + public Cat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Cat.Builder builder() { + return new Cat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Cat.Builder toBuilder() { + Cat.Builder builder = new Cat.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index b022cb0a8db..cb969bf5925 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java @@ -115,5 +115,69 @@ public class Category { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Category instance; + + public Builder() { + this(new Category()); + } + + protected Builder(Category instance) { + this.instance = instance; + } + + protected Builder copyOf(Category value) { + this.instance.setId(value.id); + this.instance.setName(value.name); + return this; + } + + public Category.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Category.Builder name(String name) { + this.instance.name(name); + return this; + } + + /** + * returns a built Category instance. + * + * The builder is not reusable (NullPointerException) + */ + public Category build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Category.Builder builder() { + return new Category.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Category.Builder toBuilder() { + Category.Builder builder = new Category.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java index cc4022e3321..18ac7cfb271 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -111,5 +111,83 @@ public class ChildWithNullable extends ParentWithNullable { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends ParentWithNullable.Builder { + + private ChildWithNullable instance; + + public Builder() { + this(new ChildWithNullable()); + } + + protected Builder(ChildWithNullable instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(ChildWithNullable value) { + super.copyOf(instance); + this.instance.setOtherProperty(value.otherProperty); + return this; + } + + public ChildWithNullable.Builder otherProperty(String otherProperty) { + this.instance.otherProperty(otherProperty); + return this; + } + + @Override + public ChildWithNullable.Builder type(TypeEnum type) { + this.instance.type(type); + return this; + } + + @Override + public ChildWithNullable.Builder nullableProperty(String nullableProperty) { + this.instance.nullableProperty(nullableProperty); + return this; + } + + public ChildWithNullable.Builder nullableProperty(JsonNullable nullableProperty) { + this.instance.setNullableProperty(nullableProperty); + return this; + } + + /** + * returns a built ChildWithNullable instance. + * + * The builder is not reusable (NullPointerException) + */ + public ChildWithNullable build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ChildWithNullable.Builder builder() { + return new ChildWithNullable.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChildWithNullable.Builder toBuilder() { + ChildWithNullable.Builder builder = new ChildWithNullable.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index 0d68ea6280c..90354be2682 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java @@ -81,5 +81,63 @@ public class ClassModel { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ClassModel instance; + + public Builder() { + this(new ClassModel()); + } + + protected Builder(ClassModel instance) { + this.instance = instance; + } + + protected Builder copyOf(ClassModel value) { + this.instance.setPropertyClass(value.propertyClass); + return this; + } + + public ClassModel.Builder propertyClass(String propertyClass) { + this.instance.propertyClass(propertyClass); + return this; + } + + /** + * returns a built ClassModel instance. + * + * The builder is not reusable (NullPointerException) + */ + public ClassModel build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ClassModel.Builder builder() { + return new ClassModel.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClassModel.Builder toBuilder() { + ClassModel.Builder builder = new ClassModel.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index 30f88f8d341..0b544690e0c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java @@ -80,5 +80,63 @@ public class Client { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Client instance; + + public Builder() { + this(new Client()); + } + + protected Builder(Client instance) { + this.instance = instance; + } + + protected Builder copyOf(Client value) { + this.instance.setClient(value.client); + return this; + } + + public Client.Builder client(String client) { + this.instance.client(client); + return this; + } + + /** + * returns a built Client instance. + * + * The builder is not reusable (NullPointerException) + */ + public Client build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Client.Builder builder() { + return new Client.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Client.Builder toBuilder() { + Client.Builder builder = new Client.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java index b00b2ad22a6..b6c7cbc9da7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -216,5 +216,96 @@ public class ContainerDefaultValue { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ContainerDefaultValue instance; + + public Builder() { + this(new ContainerDefaultValue()); + } + + protected Builder(ContainerDefaultValue instance) { + this.instance = instance; + } + + protected Builder copyOf(ContainerDefaultValue value) { + this.instance.setNullableArray(value.nullableArray); + this.instance.setNullableRequiredArray(value.nullableRequiredArray); + this.instance.setRequiredArray(value.requiredArray); + this.instance.setNullableArrayWithDefault(value.nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue.Builder nullableArray(List nullableArray) { + this.instance.nullableArray(nullableArray); + return this; + } + + public ContainerDefaultValue.Builder nullableArray(JsonNullable> nullableArray) { + this.instance.nullableArray = nullableArray; + return this; + } + + public ContainerDefaultValue.Builder nullableRequiredArray(List nullableRequiredArray) { + this.instance.nullableRequiredArray(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue.Builder nullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.instance.nullableRequiredArray = nullableRequiredArray; + return this; + } + + public ContainerDefaultValue.Builder requiredArray(List requiredArray) { + this.instance.requiredArray(requiredArray); + return this; + } + + public ContainerDefaultValue.Builder nullableArrayWithDefault(List nullableArrayWithDefault) { + this.instance.nullableArrayWithDefault(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue.Builder nullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.instance.nullableArrayWithDefault = nullableArrayWithDefault; + return this; + } + + /** + * returns a built ContainerDefaultValue instance. + * + * The builder is not reusable (NullPointerException) + */ + public ContainerDefaultValue build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ContainerDefaultValue.Builder builder() { + return new ContainerDefaultValue.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ContainerDefaultValue.Builder toBuilder() { + ContainerDefaultValue.Builder builder = new ContainerDefaultValue.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 2929e85f4ff..57fe55cf1bc 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -108,5 +108,78 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } + + public static class Builder extends Animal.Builder { + + private Dog instance; + + public Builder() { + this(new Dog()); + } + + protected Builder(Dog instance) { + super(instance); // the parent builder shares the same instance + this.instance = instance; + } + + protected Builder copyOf(Dog value) { + super.copyOf(instance); + this.instance.setBreed(value.breed); + return this; + } + + public Dog.Builder breed(String breed) { + this.instance.breed(breed); + return this; + } + + @Override + public Dog.Builder className(String className) { + this.instance.className(className); + return this; + } + + @Override + public Dog.Builder color(String color) { + this.instance.color(color); + return this; + } + + /** + * returns a built Dog instance. + * + * The builder is not reusable (NullPointerException) + */ + public Dog build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Dog.Builder builder() { + return new Dog.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Dog.Builder toBuilder() { + Dog.Builder builder = new Dog.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index cb6a04d1e24..f5c08ab1788 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -187,5 +187,69 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private EnumArrays instance; + + public Builder() { + this(new EnumArrays()); + } + + protected Builder(EnumArrays instance) { + this.instance = instance; + } + + protected Builder copyOf(EnumArrays value) { + this.instance.setJustSymbol(value.justSymbol); + this.instance.setArrayEnum(value.arrayEnum); + return this; + } + + public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) { + this.instance.justSymbol(justSymbol); + return this; + } + + public EnumArrays.Builder arrayEnum(List arrayEnum) { + this.instance.arrayEnum(arrayEnum); + return this; + } + + /** + * returns a built EnumArrays instance. + * + * The builder is not reusable (NullPointerException) + */ + public EnumArrays build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static EnumArrays.Builder builder() { + return new EnumArrays.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumArrays.Builder toBuilder() { + EnumArrays.Builder builder = new EnumArrays.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index 556cc720fed..9ec2703c2a4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -335,5 +335,87 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private EnumTest instance; + + public Builder() { + this(new EnumTest()); + } + + protected Builder(EnumTest instance) { + this.instance = instance; + } + + protected Builder copyOf(EnumTest value) { + this.instance.setEnumString(value.enumString); + this.instance.setEnumStringRequired(value.enumStringRequired); + this.instance.setEnumInteger(value.enumInteger); + this.instance.setEnumNumber(value.enumNumber); + this.instance.setOuterEnum(value.outerEnum); + return this; + } + + public EnumTest.Builder enumString(EnumStringEnum enumString) { + this.instance.enumString(enumString); + return this; + } + + public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.instance.enumStringRequired(enumStringRequired); + return this; + } + + public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) { + this.instance.enumInteger(enumInteger); + return this; + } + + public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) { + this.instance.enumNumber(enumNumber); + return this; + } + + public EnumTest.Builder outerEnum(OuterEnum outerEnum) { + this.instance.outerEnum(outerEnum); + return this; + } + + /** + * returns a built EnumTest instance. + * + * The builder is not reusable (NullPointerException) + */ + public EnumTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static EnumTest.Builder builder() { + return new EnumTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumTest.Builder toBuilder() { + EnumTest.Builder builder = new EnumTest.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index b0f864c4c59..721036abc8d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java @@ -81,5 +81,63 @@ public class File { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private File instance; + + public Builder() { + this(new File()); + } + + protected Builder(File instance) { + this.instance = instance; + } + + protected Builder copyOf(File value) { + this.instance.setSourceURI(value.sourceURI); + return this; + } + + public File.Builder sourceURI(String sourceURI) { + this.instance.sourceURI(sourceURI); + return this; + } + + /** + * returns a built File instance. + * + * The builder is not reusable (NullPointerException) + */ + public File build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static File.Builder builder() { + return new File.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public File.Builder toBuilder() { + File.Builder builder = new File.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index f84045c87d6..3890105dd98 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -117,5 +117,69 @@ public class FileSchemaTestClass { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private FileSchemaTestClass instance; + + public Builder() { + this(new FileSchemaTestClass()); + } + + protected Builder(FileSchemaTestClass instance) { + this.instance = instance; + } + + protected Builder copyOf(FileSchemaTestClass value) { + this.instance.setFile(value.file); + this.instance.setFiles(value.files); + return this; + } + + public FileSchemaTestClass.Builder file(File file) { + this.instance.file(file); + return this; + } + + public FileSchemaTestClass.Builder files(List<@Valid File> files) { + this.instance.files(files); + return this; + } + + /** + * returns a built FileSchemaTestClass instance. + * + * The builder is not reusable (NullPointerException) + */ + public FileSchemaTestClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static FileSchemaTestClass.Builder builder() { + return new FileSchemaTestClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSchemaTestClass.Builder toBuilder() { + FileSchemaTestClass.Builder builder = new FileSchemaTestClass.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index fd1feeecf3a..52ecdf2e253 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -426,5 +426,141 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private FormatTest instance; + + public Builder() { + this(new FormatTest()); + } + + protected Builder(FormatTest instance) { + this.instance = instance; + } + + protected Builder copyOf(FormatTest value) { + this.instance.setInteger(value.integer); + this.instance.setInt32(value.int32); + this.instance.setInt64(value.int64); + this.instance.setNumber(value.number); + this.instance.setFloat(value._float); + this.instance.setDouble(value._double); + this.instance.setString(value.string); + this.instance.setByte(value._byte); + this.instance.setBinary(value.binary); + this.instance.setDate(value.date); + this.instance.setDateTime(value.dateTime); + this.instance.setUuid(value.uuid); + this.instance.setPassword(value.password); + this.instance.setBigDecimal(value.bigDecimal); + return this; + } + + public FormatTest.Builder integer(Integer integer) { + this.instance.integer(integer); + return this; + } + + public FormatTest.Builder int32(Integer int32) { + this.instance.int32(int32); + return this; + } + + public FormatTest.Builder int64(Long int64) { + this.instance.int64(int64); + return this; + } + + public FormatTest.Builder number(BigDecimal number) { + this.instance.number(number); + return this; + } + + public FormatTest.Builder _float(Float _float) { + this.instance._float(_float); + return this; + } + + public FormatTest.Builder _double(Double _double) { + this.instance._double(_double); + return this; + } + + public FormatTest.Builder string(String string) { + this.instance.string(string); + return this; + } + + public FormatTest.Builder _byte(byte[] _byte) { + this.instance._byte(_byte); + return this; + } + + public FormatTest.Builder binary(org.springframework.core.io.Resource binary) { + this.instance.binary(binary); + return this; + } + + public FormatTest.Builder date(LocalDate date) { + this.instance.date(date); + return this; + } + + public FormatTest.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime(dateTime); + return this; + } + + public FormatTest.Builder uuid(UUID uuid) { + this.instance.uuid(uuid); + return this; + } + + public FormatTest.Builder password(String password) { + this.instance.password(password); + return this; + } + + public FormatTest.Builder bigDecimal(BigDecimal bigDecimal) { + this.instance.bigDecimal(bigDecimal); + return this; + } + + /** + * returns a built FormatTest instance. + * + * The builder is not reusable (NullPointerException) + */ + public FormatTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static FormatTest.Builder builder() { + return new FormatTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FormatTest.Builder toBuilder() { + FormatTest.Builder builder = new FormatTest.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c9c8eca2712..dad6816f9bf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -106,5 +106,69 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private HasOnlyReadOnly instance; + + public Builder() { + this(new HasOnlyReadOnly()); + } + + protected Builder(HasOnlyReadOnly instance) { + this.instance = instance; + } + + protected Builder copyOf(HasOnlyReadOnly value) { + this.instance.setBar(value.bar); + this.instance.setFoo(value.foo); + return this; + } + + public HasOnlyReadOnly.Builder bar(String bar) { + this.instance.bar(bar); + return this; + } + + public HasOnlyReadOnly.Builder foo(String foo) { + this.instance.foo(foo); + return this; + } + + /** + * returns a built HasOnlyReadOnly instance. + * + * The builder is not reusable (NullPointerException) + */ + public HasOnlyReadOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static HasOnlyReadOnly.Builder builder() { + return new HasOnlyReadOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HasOnlyReadOnly.Builder toBuilder() { + HasOnlyReadOnly.Builder builder = new HasOnlyReadOnly.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 84a22f3344a..97cc5f96ec3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -226,5 +226,81 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private MapTest instance; + + public Builder() { + this(new MapTest()); + } + + protected Builder(MapTest instance) { + this.instance = instance; + } + + protected Builder copyOf(MapTest value) { + this.instance.setMapMapOfString(value.mapMapOfString); + this.instance.setMapOfEnumString(value.mapOfEnumString); + this.instance.setDirectMap(value.directMap); + this.instance.setIndirectMap(value.indirectMap); + return this; + } + + public MapTest.Builder mapMapOfString(Map> mapMapOfString) { + this.instance.mapMapOfString(mapMapOfString); + return this; + } + + public MapTest.Builder mapOfEnumString(Map mapOfEnumString) { + this.instance.mapOfEnumString(mapOfEnumString); + return this; + } + + public MapTest.Builder directMap(Map directMap) { + this.instance.directMap(directMap); + return this; + } + + public MapTest.Builder indirectMap(Map indirectMap) { + this.instance.indirectMap(indirectMap); + return this; + } + + /** + * returns a built MapTest instance. + * + * The builder is not reusable (NullPointerException) + */ + public MapTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static MapTest.Builder builder() { + return new MapTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MapTest.Builder toBuilder() { + MapTest.Builder builder = new MapTest.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3af19ac4be6..cf705f3878e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -144,5 +144,75 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private MixedPropertiesAndAdditionalPropertiesClass instance; + + public Builder() { + this(new MixedPropertiesAndAdditionalPropertiesClass()); + } + + protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) { + this.instance = instance; + } + + protected Builder copyOf(MixedPropertiesAndAdditionalPropertiesClass value) { + this.instance.setUuid(value.uuid); + this.instance.setDateTime(value.dateTime); + this.instance.setMap(value.map); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) { + this.instance.uuid(uuid); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime(dateTime); + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) { + this.instance.map(map); + return this; + } + + /** + * returns a built MixedPropertiesAndAdditionalPropertiesClass instance. + * + * The builder is not reusable (NullPointerException) + */ + public MixedPropertiesAndAdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() { + MixedPropertiesAndAdditionalPropertiesClass.Builder builder = new MixedPropertiesAndAdditionalPropertiesClass.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 74c95f042d1..00f11ffd296 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java @@ -107,5 +107,69 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Model200Response instance; + + public Builder() { + this(new Model200Response()); + } + + protected Builder(Model200Response instance) { + this.instance = instance; + } + + protected Builder copyOf(Model200Response value) { + this.instance.setName(value.name); + this.instance.setPropertyClass(value.propertyClass); + return this; + } + + public Model200Response.Builder name(Integer name) { + this.instance.name(name); + return this; + } + + public Model200Response.Builder propertyClass(String propertyClass) { + this.instance.propertyClass(propertyClass); + return this; + } + + /** + * returns a built Model200Response instance. + * + * The builder is not reusable (NullPointerException) + */ + public Model200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Model200Response.Builder builder() { + return new Model200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Model200Response.Builder toBuilder() { + Model200Response.Builder builder = new Model200Response.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index c2f72affdce..6bfd79baf0a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -130,5 +130,75 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ModelApiResponse instance; + + public Builder() { + this(new ModelApiResponse()); + } + + protected Builder(ModelApiResponse instance) { + this.instance = instance; + } + + protected Builder copyOf(ModelApiResponse value) { + this.instance.setCode(value.code); + this.instance.setType(value.type); + this.instance.setMessage(value.message); + return this; + } + + public ModelApiResponse.Builder code(Integer code) { + this.instance.code(code); + return this; + } + + public ModelApiResponse.Builder type(String type) { + this.instance.type(type); + return this; + } + + public ModelApiResponse.Builder message(String message) { + this.instance.message(message); + return this; + } + + /** + * returns a built ModelApiResponse instance. + * + * The builder is not reusable (NullPointerException) + */ + public ModelApiResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ModelApiResponse.Builder builder() { + return new ModelApiResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelApiResponse.Builder toBuilder() { + ModelApiResponse.Builder builder = new ModelApiResponse.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index b0e5c0fe793..5d8a9e3180f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java @@ -82,5 +82,63 @@ public class ModelList { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ModelList instance; + + public Builder() { + this(new ModelList()); + } + + protected Builder(ModelList instance) { + this.instance = instance; + } + + protected Builder copyOf(ModelList value) { + this.instance.set123list(value._123list); + return this; + } + + public ModelList.Builder _123list(String _123list) { + this.instance._123list(_123list); + return this; + } + + /** + * returns a built ModelList instance. + * + * The builder is not reusable (NullPointerException) + */ + public ModelList build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ModelList.Builder builder() { + return new ModelList.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelList.Builder toBuilder() { + ModelList.Builder builder = new ModelList.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index f522bf19ea2..74f8e788de6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java @@ -83,5 +83,63 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ModelReturn instance; + + public Builder() { + this(new ModelReturn()); + } + + protected Builder(ModelReturn instance) { + this.instance = instance; + } + + protected Builder copyOf(ModelReturn value) { + this.instance.setReturn(value._return); + return this; + } + + public ModelReturn.Builder _return(Integer _return) { + this.instance._return(_return); + return this; + } + + /** + * returns a built ModelReturn instance. + * + * The builder is not reusable (NullPointerException) + */ + public ModelReturn build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ModelReturn.Builder builder() { + return new ModelReturn.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelReturn.Builder toBuilder() { + ModelReturn.Builder builder = new ModelReturn.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index dd939182742..a74933d4ff5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java @@ -164,5 +164,81 @@ public class Name { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Name instance; + + public Builder() { + this(new Name()); + } + + protected Builder(Name instance) { + this.instance = instance; + } + + protected Builder copyOf(Name value) { + this.instance.setName(value.name); + this.instance.setSnakeCase(value.snakeCase); + this.instance.setProperty(value.property); + this.instance.set123number(value._123number); + return this; + } + + public Name.Builder name(Integer name) { + this.instance.name(name); + return this; + } + + public Name.Builder snakeCase(Integer snakeCase) { + this.instance.snakeCase(snakeCase); + return this; + } + + public Name.Builder property(String property) { + this.instance.property(property); + return this; + } + + public Name.Builder _123number(Integer _123number) { + this.instance._123number(_123number); + return this; + } + + /** + * returns a built Name instance. + * + * The builder is not reusable (NullPointerException) + */ + public Name build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Name.Builder builder() { + return new Name.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Name.Builder toBuilder() { + Name.Builder builder = new Name.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java index ecf19dab048..d018473ee5c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -105,5 +105,68 @@ public class NullableMapProperty { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private NullableMapProperty instance; + + public Builder() { + this(new NullableMapProperty()); + } + + protected Builder(NullableMapProperty instance) { + this.instance = instance; + } + + protected Builder copyOf(NullableMapProperty value) { + this.instance.setLanguageValues(value.languageValues); + return this; + } + + public NullableMapProperty.Builder languageValues(Map languageValues) { + this.instance.languageValues(languageValues); + return this; + } + + public NullableMapProperty.Builder languageValues(JsonNullable> languageValues) { + this.instance.languageValues = languageValues; + return this; + } + + /** + * returns a built NullableMapProperty instance. + * + * The builder is not reusable (NullPointerException) + */ + public NullableMapProperty build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static NullableMapProperty.Builder builder() { + return new NullableMapProperty.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NullableMapProperty.Builder toBuilder() { + NullableMapProperty.Builder builder = new NullableMapProperty.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index baee30a5dcb..7756074ae88 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -81,5 +81,63 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private NumberOnly instance; + + public Builder() { + this(new NumberOnly()); + } + + protected Builder(NumberOnly instance) { + this.instance = instance; + } + + protected Builder copyOf(NumberOnly value) { + this.instance.setJustNumber(value.justNumber); + return this; + } + + public NumberOnly.Builder justNumber(BigDecimal justNumber) { + this.instance.justNumber(justNumber); + return this; + } + + /** + * returns a built NumberOnly instance. + * + * The builder is not reusable (NullPointerException) + */ + public NumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static NumberOnly.Builder builder() { + return new NumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NumberOnly.Builder toBuilder() { + NumberOnly.Builder builder = new NumberOnly.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 18eb5a80902..4f1bd73dd86 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java @@ -241,5 +241,93 @@ public class Order { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Order instance; + + public Builder() { + this(new Order()); + } + + protected Builder(Order instance) { + this.instance = instance; + } + + protected Builder copyOf(Order value) { + this.instance.setId(value.id); + this.instance.setPetId(value.petId); + this.instance.setQuantity(value.quantity); + this.instance.setShipDate(value.shipDate); + this.instance.setStatus(value.status); + this.instance.setComplete(value.complete); + return this; + } + + public Order.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Order.Builder petId(Long petId) { + this.instance.petId(petId); + return this; + } + + public Order.Builder quantity(Integer quantity) { + this.instance.quantity(quantity); + return this; + } + + public Order.Builder shipDate(OffsetDateTime shipDate) { + this.instance.shipDate(shipDate); + return this; + } + + public Order.Builder status(StatusEnum status) { + this.instance.status(status); + return this; + } + + public Order.Builder complete(Boolean complete) { + this.instance.complete(complete); + return this; + } + + /** + * returns a built Order instance. + * + * The builder is not reusable (NullPointerException) + */ + public Order build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Order.Builder builder() { + return new Order.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Order.Builder toBuilder() { + Order.Builder builder = new Order.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index 567e1702b5a..35bf6021136 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -129,5 +129,75 @@ public class OuterComposite { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private OuterComposite instance; + + public Builder() { + this(new OuterComposite()); + } + + protected Builder(OuterComposite instance) { + this.instance = instance; + } + + protected Builder copyOf(OuterComposite value) { + this.instance.setMyNumber(value.myNumber); + this.instance.setMyString(value.myString); + this.instance.setMyBoolean(value.myBoolean); + return this; + } + + public OuterComposite.Builder myNumber(BigDecimal myNumber) { + this.instance.myNumber(myNumber); + return this; + } + + public OuterComposite.Builder myString(String myString) { + this.instance.myString(myString); + return this; + } + + public OuterComposite.Builder myBoolean(Boolean myBoolean) { + this.instance.myBoolean(myBoolean); + return this; + } + + /** + * returns a built OuterComposite instance. + * + * The builder is not reusable (NullPointerException) + */ + public OuterComposite build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static OuterComposite.Builder builder() { + return new OuterComposite.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OuterComposite.Builder toBuilder() { + OuterComposite.Builder builder = new OuterComposite.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index c2da440bfd8..11da2d842b7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -42,7 +42,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; @@ -164,5 +164,74 @@ public class ParentWithNullable { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ParentWithNullable instance; + + public Builder() { + this(new ParentWithNullable()); + } + + protected Builder(ParentWithNullable instance) { + this.instance = instance; + } + + protected Builder copyOf(ParentWithNullable value) { + this.instance.setType(value.type); + this.instance.setNullableProperty(value.nullableProperty); + return this; + } + + public ParentWithNullable.Builder type(TypeEnum type) { + this.instance.type(type); + return this; + } + + public ParentWithNullable.Builder nullableProperty(String nullableProperty) { + this.instance.nullableProperty(nullableProperty); + return this; + } + + public ParentWithNullable.Builder nullableProperty(JsonNullable nullableProperty) { + this.instance.nullableProperty = nullableProperty; + return this; + } + + /** + * returns a built ParentWithNullable instance. + * + * The builder is not reusable (NullPointerException) + */ + public ParentWithNullable build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ParentWithNullable.Builder builder() { + return new ParentWithNullable.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentWithNullable.Builder toBuilder() { + ParentWithNullable.Builder builder = new ParentWithNullable.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index f741b1758e1..2a8d513a460 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -284,5 +284,95 @@ public class Pet { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Pet instance; + + public Builder() { + this(new Pet()); + } + + protected Builder(Pet instance) { + this.instance = instance; + } + + protected Builder copyOf(Pet value) { + this.instance.setId(value.id); + this.instance.setCategory(value.category); + this.instance.setName(value.name); + this.instance.setPhotoUrls(value.photoUrls); + this.instance.setTags(value.tags); + this.instance.setStatus(value.status); + return this; + } + + public Pet.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Pet.Builder category(Category category) { + this.instance.category(category); + return this; + } + + public Pet.Builder name(String name) { + this.instance.name(name); + return this; + } + + public Pet.Builder photoUrls(Set photoUrls) { + this.instance.photoUrls(photoUrls); + return this; + } + + public Pet.Builder tags(List<@Valid Tag> tags) { + this.instance.tags(tags); + return this; + } + + @Deprecated + public Pet.Builder status(StatusEnum status) { + this.instance.status(status); + return this; + } + @Deprecated + + /** + * returns a built Pet instance. + * + * The builder is not reusable (NullPointerException) + */ + public Pet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Pet.Builder builder() { + return new Pet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pet.Builder toBuilder() { + Pet.Builder builder = new Pet.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 6ca432ca070..ec43a291e88 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -104,5 +104,69 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ReadOnlyFirst instance; + + public Builder() { + this(new ReadOnlyFirst()); + } + + protected Builder(ReadOnlyFirst instance) { + this.instance = instance; + } + + protected Builder copyOf(ReadOnlyFirst value) { + this.instance.setBar(value.bar); + this.instance.setBaz(value.baz); + return this; + } + + public ReadOnlyFirst.Builder bar(String bar) { + this.instance.bar(bar); + return this; + } + + public ReadOnlyFirst.Builder baz(String baz) { + this.instance.baz(baz); + return this; + } + + /** + * returns a built ReadOnlyFirst instance. + * + * The builder is not reusable (NullPointerException) + */ + public ReadOnlyFirst build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ReadOnlyFirst.Builder builder() { + return new ReadOnlyFirst.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadOnlyFirst.Builder toBuilder() { + ReadOnlyFirst.Builder builder = new ReadOnlyFirst.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index a6ca3047b2a..5602b3a973d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java @@ -152,5 +152,81 @@ public class ResponseObjectWithDifferentFieldNames { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private ResponseObjectWithDifferentFieldNames instance; + + public Builder() { + this(new ResponseObjectWithDifferentFieldNames()); + } + + protected Builder(ResponseObjectWithDifferentFieldNames instance) { + this.instance = instance; + } + + protected Builder copyOf(ResponseObjectWithDifferentFieldNames value) { + this.instance.setNormalPropertyName(value.normalPropertyName); + this.instance.setUPPERCASEPROPERTYSNAKE(value.UPPER_CASE_PROPERTY_SNAKE); + this.instance.setLowerCasePropertyDashes(value.lowerCasePropertyDashes); + this.instance.setPropertyNameWithSpaces(value.propertyNameWithSpaces); + return this; + } + + public ResponseObjectWithDifferentFieldNames.Builder normalPropertyName(String normalPropertyName) { + this.instance.normalPropertyName(normalPropertyName); + return this; + } + + public ResponseObjectWithDifferentFieldNames.Builder UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) { + this.instance.UPPER_CASE_PROPERTY_SNAKE(UPPER_CASE_PROPERTY_SNAKE); + return this; + } + + public ResponseObjectWithDifferentFieldNames.Builder lowerCasePropertyDashes(String lowerCasePropertyDashes) { + this.instance.lowerCasePropertyDashes(lowerCasePropertyDashes); + return this; + } + + public ResponseObjectWithDifferentFieldNames.Builder propertyNameWithSpaces(String propertyNameWithSpaces) { + this.instance.propertyNameWithSpaces(propertyNameWithSpaces); + return this; + } + + /** + * returns a built ResponseObjectWithDifferentFieldNames instance. + * + * The builder is not reusable (NullPointerException) + */ + public ResponseObjectWithDifferentFieldNames build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static ResponseObjectWithDifferentFieldNames.Builder builder() { + return new ResponseObjectWithDifferentFieldNames.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ResponseObjectWithDifferentFieldNames.Builder toBuilder() { + ResponseObjectWithDifferentFieldNames.Builder builder = new ResponseObjectWithDifferentFieldNames.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index fda7987b27e..fed007bb06f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -82,5 +82,63 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private SpecialModelName instance; + + public Builder() { + this(new SpecialModelName()); + } + + protected Builder(SpecialModelName instance) { + this.instance = instance; + } + + protected Builder copyOf(SpecialModelName value) { + this.instance.set$SpecialPropertyName(value.$specialPropertyName); + return this; + } + + public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) { + this.instance.$specialPropertyName($specialPropertyName); + return this; + } + + /** + * returns a built SpecialModelName instance. + * + * The builder is not reusable (NullPointerException) + */ + public SpecialModelName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static SpecialModelName.Builder builder() { + return new SpecialModelName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialModelName.Builder toBuilder() { + SpecialModelName.Builder builder = new SpecialModelName.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index d6df46723be..e96fa45e045 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java @@ -104,5 +104,69 @@ public class Tag { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private Tag instance; + + public Builder() { + this(new Tag()); + } + + protected Builder(Tag instance) { + this.instance = instance; + } + + protected Builder copyOf(Tag value) { + this.instance.setId(value.id); + this.instance.setName(value.name); + return this; + } + + public Tag.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public Tag.Builder name(String name) { + this.instance.name(name); + return this; + } + + /** + * returns a built Tag instance. + * + * The builder is not reusable (NullPointerException) + */ + public Tag build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static Tag.Builder builder() { + return new Tag.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Tag.Builder toBuilder() { + Tag.Builder builder = new Tag.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index 82a6b877a45..e583e780e7d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -204,5 +204,87 @@ public class TypeHolderDefault { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private TypeHolderDefault instance; + + public Builder() { + this(new TypeHolderDefault()); + } + + protected Builder(TypeHolderDefault instance) { + this.instance = instance; + } + + protected Builder copyOf(TypeHolderDefault value) { + this.instance.setStringItem(value.stringItem); + this.instance.setNumberItem(value.numberItem); + this.instance.setIntegerItem(value.integerItem); + this.instance.setBoolItem(value.boolItem); + this.instance.setArrayItem(value.arrayItem); + return this; + } + + public TypeHolderDefault.Builder stringItem(String stringItem) { + this.instance.stringItem(stringItem); + return this; + } + + public TypeHolderDefault.Builder numberItem(BigDecimal numberItem) { + this.instance.numberItem(numberItem); + return this; + } + + public TypeHolderDefault.Builder integerItem(Integer integerItem) { + this.instance.integerItem(integerItem); + return this; + } + + public TypeHolderDefault.Builder boolItem(Boolean boolItem) { + this.instance.boolItem(boolItem); + return this; + } + + public TypeHolderDefault.Builder arrayItem(List arrayItem) { + this.instance.arrayItem(arrayItem); + return this; + } + + /** + * returns a built TypeHolderDefault instance. + * + * The builder is not reusable (NullPointerException) + */ + public TypeHolderDefault build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static TypeHolderDefault.Builder builder() { + return new TypeHolderDefault.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TypeHolderDefault.Builder toBuilder() { + TypeHolderDefault.Builder builder = new TypeHolderDefault.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index ad569da360c..d2d73fcfb8b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -229,5 +229,93 @@ public class TypeHolderExample { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private TypeHolderExample instance; + + public Builder() { + this(new TypeHolderExample()); + } + + protected Builder(TypeHolderExample instance) { + this.instance = instance; + } + + protected Builder copyOf(TypeHolderExample value) { + this.instance.setStringItem(value.stringItem); + this.instance.setNumberItem(value.numberItem); + this.instance.setFloatItem(value.floatItem); + this.instance.setIntegerItem(value.integerItem); + this.instance.setBoolItem(value.boolItem); + this.instance.setArrayItem(value.arrayItem); + return this; + } + + public TypeHolderExample.Builder stringItem(String stringItem) { + this.instance.stringItem(stringItem); + return this; + } + + public TypeHolderExample.Builder numberItem(BigDecimal numberItem) { + this.instance.numberItem(numberItem); + return this; + } + + public TypeHolderExample.Builder floatItem(Float floatItem) { + this.instance.floatItem(floatItem); + return this; + } + + public TypeHolderExample.Builder integerItem(Integer integerItem) { + this.instance.integerItem(integerItem); + return this; + } + + public TypeHolderExample.Builder boolItem(Boolean boolItem) { + this.instance.boolItem(boolItem); + return this; + } + + public TypeHolderExample.Builder arrayItem(List arrayItem) { + this.instance.arrayItem(arrayItem); + return this; + } + + /** + * returns a built TypeHolderExample instance. + * + * The builder is not reusable (NullPointerException) + */ + public TypeHolderExample build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static TypeHolderExample.Builder builder() { + return new TypeHolderExample.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TypeHolderExample.Builder toBuilder() { + TypeHolderExample.Builder builder = new TypeHolderExample.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index 4d1741c7f6b..910d18e5aaa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java @@ -248,5 +248,105 @@ public class User { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private User instance; + + public Builder() { + this(new User()); + } + + protected Builder(User instance) { + this.instance = instance; + } + + protected Builder copyOf(User value) { + this.instance.setId(value.id); + this.instance.setUsername(value.username); + this.instance.setFirstName(value.firstName); + this.instance.setLastName(value.lastName); + this.instance.setEmail(value.email); + this.instance.setPassword(value.password); + this.instance.setPhone(value.phone); + this.instance.setUserStatus(value.userStatus); + return this; + } + + public User.Builder id(Long id) { + this.instance.id(id); + return this; + } + + public User.Builder username(String username) { + this.instance.username(username); + return this; + } + + public User.Builder firstName(String firstName) { + this.instance.firstName(firstName); + return this; + } + + public User.Builder lastName(String lastName) { + this.instance.lastName(lastName); + return this; + } + + public User.Builder email(String email) { + this.instance.email(email); + return this; + } + + public User.Builder password(String password) { + this.instance.password(password); + return this; + } + + public User.Builder phone(String phone) { + this.instance.phone(phone); + return this; + } + + public User.Builder userStatus(Integer userStatus) { + this.instance.userStatus(userStatus); + return this; + } + + /** + * returns a built User instance. + * + * The builder is not reusable (NullPointerException) + */ + public User build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static User.Builder builder() { + return new User.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public User.Builder toBuilder() { + User.Builder builder = new User.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 04fc6070fb0..c62eee266d3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -837,5 +837,231 @@ public class XmlItem { } return o.toString().replace("\n", "\n "); } + + public static class Builder { + + private XmlItem instance; + + public Builder() { + this(new XmlItem()); + } + + protected Builder(XmlItem instance) { + this.instance = instance; + } + + protected Builder copyOf(XmlItem value) { + this.instance.setAttributeString(value.attributeString); + this.instance.setAttributeNumber(value.attributeNumber); + this.instance.setAttributeInteger(value.attributeInteger); + this.instance.setAttributeBoolean(value.attributeBoolean); + this.instance.setWrappedArray(value.wrappedArray); + this.instance.setNameString(value.nameString); + this.instance.setNameNumber(value.nameNumber); + this.instance.setNameInteger(value.nameInteger); + this.instance.setNameBoolean(value.nameBoolean); + this.instance.setNameArray(value.nameArray); + this.instance.setNameWrappedArray(value.nameWrappedArray); + this.instance.setPrefixString(value.prefixString); + this.instance.setPrefixNumber(value.prefixNumber); + this.instance.setPrefixInteger(value.prefixInteger); + this.instance.setPrefixBoolean(value.prefixBoolean); + this.instance.setPrefixArray(value.prefixArray); + this.instance.setPrefixWrappedArray(value.prefixWrappedArray); + this.instance.setNamespaceString(value.namespaceString); + this.instance.setNamespaceNumber(value.namespaceNumber); + this.instance.setNamespaceInteger(value.namespaceInteger); + this.instance.setNamespaceBoolean(value.namespaceBoolean); + this.instance.setNamespaceArray(value.namespaceArray); + this.instance.setNamespaceWrappedArray(value.namespaceWrappedArray); + this.instance.setPrefixNsString(value.prefixNsString); + this.instance.setPrefixNsNumber(value.prefixNsNumber); + this.instance.setPrefixNsInteger(value.prefixNsInteger); + this.instance.setPrefixNsBoolean(value.prefixNsBoolean); + this.instance.setPrefixNsArray(value.prefixNsArray); + this.instance.setPrefixNsWrappedArray(value.prefixNsWrappedArray); + return this; + } + + public XmlItem.Builder attributeString(String attributeString) { + this.instance.attributeString(attributeString); + return this; + } + + public XmlItem.Builder attributeNumber(BigDecimal attributeNumber) { + this.instance.attributeNumber(attributeNumber); + return this; + } + + public XmlItem.Builder attributeInteger(Integer attributeInteger) { + this.instance.attributeInteger(attributeInteger); + return this; + } + + public XmlItem.Builder attributeBoolean(Boolean attributeBoolean) { + this.instance.attributeBoolean(attributeBoolean); + return this; + } + + public XmlItem.Builder wrappedArray(List wrappedArray) { + this.instance.wrappedArray(wrappedArray); + return this; + } + + public XmlItem.Builder nameString(String nameString) { + this.instance.nameString(nameString); + return this; + } + + public XmlItem.Builder nameNumber(BigDecimal nameNumber) { + this.instance.nameNumber(nameNumber); + return this; + } + + public XmlItem.Builder nameInteger(Integer nameInteger) { + this.instance.nameInteger(nameInteger); + return this; + } + + public XmlItem.Builder nameBoolean(Boolean nameBoolean) { + this.instance.nameBoolean(nameBoolean); + return this; + } + + public XmlItem.Builder nameArray(List nameArray) { + this.instance.nameArray(nameArray); + return this; + } + + public XmlItem.Builder nameWrappedArray(List nameWrappedArray) { + this.instance.nameWrappedArray(nameWrappedArray); + return this; + } + + public XmlItem.Builder prefixString(String prefixString) { + this.instance.prefixString(prefixString); + return this; + } + + public XmlItem.Builder prefixNumber(BigDecimal prefixNumber) { + this.instance.prefixNumber(prefixNumber); + return this; + } + + public XmlItem.Builder prefixInteger(Integer prefixInteger) { + this.instance.prefixInteger(prefixInteger); + return this; + } + + public XmlItem.Builder prefixBoolean(Boolean prefixBoolean) { + this.instance.prefixBoolean(prefixBoolean); + return this; + } + + public XmlItem.Builder prefixArray(List prefixArray) { + this.instance.prefixArray(prefixArray); + return this; + } + + public XmlItem.Builder prefixWrappedArray(List prefixWrappedArray) { + this.instance.prefixWrappedArray(prefixWrappedArray); + return this; + } + + public XmlItem.Builder namespaceString(String namespaceString) { + this.instance.namespaceString(namespaceString); + return this; + } + + public XmlItem.Builder namespaceNumber(BigDecimal namespaceNumber) { + this.instance.namespaceNumber(namespaceNumber); + return this; + } + + public XmlItem.Builder namespaceInteger(Integer namespaceInteger) { + this.instance.namespaceInteger(namespaceInteger); + return this; + } + + public XmlItem.Builder namespaceBoolean(Boolean namespaceBoolean) { + this.instance.namespaceBoolean(namespaceBoolean); + return this; + } + + public XmlItem.Builder namespaceArray(List namespaceArray) { + this.instance.namespaceArray(namespaceArray); + return this; + } + + public XmlItem.Builder namespaceWrappedArray(List namespaceWrappedArray) { + this.instance.namespaceWrappedArray(namespaceWrappedArray); + return this; + } + + public XmlItem.Builder prefixNsString(String prefixNsString) { + this.instance.prefixNsString(prefixNsString); + return this; + } + + public XmlItem.Builder prefixNsNumber(BigDecimal prefixNsNumber) { + this.instance.prefixNsNumber(prefixNsNumber); + return this; + } + + public XmlItem.Builder prefixNsInteger(Integer prefixNsInteger) { + this.instance.prefixNsInteger(prefixNsInteger); + return this; + } + + public XmlItem.Builder prefixNsBoolean(Boolean prefixNsBoolean) { + this.instance.prefixNsBoolean(prefixNsBoolean); + return this; + } + + public XmlItem.Builder prefixNsArray(List prefixNsArray) { + this.instance.prefixNsArray(prefixNsArray); + return this; + } + + public XmlItem.Builder prefixNsWrappedArray(List prefixNsWrappedArray) { + this.instance.prefixNsWrappedArray(prefixNsWrappedArray); + return this; + } + + /** + * returns a built XmlItem instance. + * + * The builder is not reusable (NullPointerException) + */ + public XmlItem build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field (except for the default values). + */ + public static XmlItem.Builder builder() { + return new XmlItem.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public XmlItem.Builder toBuilder() { + XmlItem.Builder builder = new XmlItem.Builder(); + return builder.copyOf(this); + } + } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java index 9aabb5d10c1..0cbb5de0db9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ParentWithNullable.java @@ -41,7 +41,7 @@ public class ParentWithNullable { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 4f0fc1008ed..9c08046a256 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -43,7 +43,7 @@ public class ParentWithNullableDto { * Gets or Sets type */ public enum TypeEnum { - CHILDWITHNULLABLE("ChildWithNullable"); + CHILD_WITH_NULLABLE("ChildWithNullable"); private String value; diff --git a/website/src/dynamic/sponsors.yml b/website/src/dynamic/sponsors.yml index 3382994fefe..0ddf0d18606 100644 --- a/website/src/dynamic/sponsors.yml +++ b/website/src/dynamic/sponsors.yml @@ -118,3 +118,8 @@ image: "img/companies/designli.jpg" infoLink: "https://designli.co?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship" bronze: true +- + caption: "it@m" + image: "img/companies/itm.png" + infoLink: "https://opensource.muenchen.de/?utm_source=openapi-generator&utm_medium=sponsorship&utm_campaign=oss-sponsorship" + bronze: true diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index 2dabc635d33..edaa7c613ab 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -493,6 +493,11 @@ image: "img/companies/robocorp.svg" infoLink: "https://www.robocorp.com" pinned: false +- + caption: "SearchApi" + image: "img/companies/searchapi.png" + infoLink: "https://www.searchapi.io/" + pinned: false - caption: "Shotstack" image: "img/companies/shotstack.svg" diff --git a/website/static/img/companies/itm.png b/website/static/img/companies/itm.png new file mode 100644 index 00000000000..ebf32cdae0b Binary files /dev/null and b/website/static/img/companies/itm.png differ diff --git a/website/static/img/companies/searchapi.png b/website/static/img/companies/searchapi.png new file mode 100644 index 00000000000..fcdfac3af53 Binary files /dev/null and b/website/static/img/companies/searchapi.png differ

    Description
    SetMinusCookieSet-Cookie String Cookie authentication key for use with the `api_key` apiKey authentication.
    XMinusRateMinusLimitX-Rate-Limit Integer int32 calls per hour allowed by the user
    XMinusExpiresMinusAfterX-Expires-After Date date-time date in UTC when token expires